BIOP / ijl-utilities-wrappers

Wrappers for external software calls (Cellpose, Elastix, Ilastix...) and java utilities (object conversions and display)
31 stars 6 forks source link

Get a nicer LUT on Cellpose output #44

Open NicoKiaru opened 3 months ago

NicoKiaru commented 3 months ago

Setting a LUT to an ImagePlus without using IJ.runis nightmarish. IJ.run works, but it interferes with the macro recording and thus can't be used.

Here's the few things I tried but didn't work:

            new LUT()
            /*LutLoader ll = new LutLoader();
            ll.run("3-3-2 RGB.lut");
            //IndexColorModel lut = LutLoader.getLut("3-3-2 RGB");
            LutLoader.getLut("3-3-2 RGB.lut")
            //LUT lut = LutLoader.getLut("3-3-2 RGB");*/
            //new LutLoader("3-3-2 RGB").

            /*String IJ_LUT_FOLDER = IJ.getDirectory("luts");

            File lutFile = lutFiles.get(b);

            LUT currentLUT = LutLoader.openLut(lutFile.getAbsolutePath());

            Map<String, URL> luts = lutservice.findLUTs();

            if (luts.containsKey("3-3-2 RGB.lut")) {
                ColorTable lut = lutservice.loadLUT(luts.get("3-3-2 RGB.lut"));

                /*lutservice.applyLUT();

                DefaultLUTService dls;*/

                /*luts.get("3-3-2 RGB.lut")
                //String path = java.net.URLDecoder.decode(luts.get("3-3-2 RGB.lut").toString(), StandardCharsets.UTF_8.name()); // Because 3-3-2 RGB has a space
                lut = LutLoader.openLut(luts.get("3-3-2 RGB.lut"));
                cellpose_imp.setLut(lut);*/
            // }

            //add a LUT
            //IJ.run(cellpose_imp, "3-3-2 RGB", "");

So until we find a solution that is simple, the output is going to be in grayscale.

imagesc-bot commented 3 months ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-wrapper-s-for-cellpose-and-omnipose-new-version-big-decisions/94735/33

NicoKiaru commented 2 weeks ago

issue was duplicated in https://github.com/BIOP/ijl-utilities-wrappers/issues/40

NicoKiaru commented 2 weeks ago

See @tferr's solution in

in https://forum.image.sc/t/fiji-wrapper-s-for-cellpose-and-omnipose-new-version-big-decisions/94735/36