Dear All,
I have tried to implement the latest Wayne's feature of NonBlocking Dialog and updated ImageJ to 1.52o19 build. The feature works but something else about color is broken now. I have used my macro published on ImageJ website (https://imagej.nih.gov/ij/macros/Cavalieri_V_estimator.txt). When I go with default option of first dialog ("open example stack") 1.52o19 selects single color (green) for all drawing on the opened image. 1.52n does drawing with proper colors. What can be causing that? I am putting the extract of my macro below. Just run it and you will see the difference between 1.52n and 1.52o19: ------------------ run("MRI Stack (528K)"); run("Make Substack...", " slices=4"); run("Size...", "width=372 height=452 constrain average interpolation=Bicubic"); screen = screenHeight; if (screen>1500) run("In [+]"); rename("Instructions for mri-stack"); //Printing instructions run("RGB Color"); setLocation(0, 0); setColor("green"); setFont("SansSerif", 20, "antialiased"); drawString("Instructions for MRI stack example:", 5, 150); setFont("SansSerif", 14, "antialiased"); setColor("cyan"); drawString("- Use default counting parameters", 5, 190); drawString("- Name 2 counters for eyeballs", 5, 220); drawString("- Count points hitting eyeballs on relevant slices", 5, 250); drawString("- Change counters by double click on", 5, 280); drawString(" [Multipoint Tool] in ImageJ Menu", 5, 310); drawString("- Eyeball structures are shown in red circle", 5, 340); drawString("- Eyeball volume should be about 6cm3", 5, 370); setColor("yellow"); drawString("Use 'Help' button in dialog to see full instructions", 5, 420); //Identifying eyeball setColor("red"); drawOval(220, 47, 65, 65); //Making Multipoint Tool Icon setColor("white"); drawRect(278,258,30,30); setColor("black"); drawRect(279,259,28,28); setColor(180, 180, 180); fillRect(280, 260, 26, 26); xcross = newArray(286,286,284,288,287,287,285,289,294,294,292,296,295,295,293,297,300,300,298,302); ycross = newArray(266,270,268,268,275,279,277,277,264,268,266,266,274,278,276,276,268,272,270,270); xpoints = newArray(286,294,287,295,300); ypoints = newArray(268,266,277,276,270); xarrow = newArray(300,304,301,303,302,302); yarrow = newArray(280,280,281,281,282,282); setColor("black"); for (i=0; i<20; i++) { j=i+1; drawLine(xcross[i], ycross[i], xcross[j], ycross[j]); i=i+1; } setColor("yellow"); for (i=0; i<5; i++) { drawLine(xpoints[i], ypoints[i], xpoints[i], ypoints[i]); } setColor(150, 0, 0); for (i=0; i<6; i++) { j=i+1; drawLine(xarrow[i], yarrow[i], xarrow[j], yarrow[j]); i=i+1; } run("Select None"); selectWindow("mri-stack.tif"); setLocation(400, 0); run("Set Scale...", "distance=30 known=2.4 pixel=1 unit=cm"); -------------------------------------------------------- Sincerely, Alex -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Alex,
The issue you are seeing is more than probably due to the update 1.52o13 where the setColor() and setLineWidth() settings became both global, see: http://imagej.1557.x6.nabble.com/Re-Using-setColor-without-an-open-image-td5021956.html My best regards, Philippe Philippe CARL Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 41 84 -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Aleksandr Mironov Envoyé : vendredi 5 avril 2019 14:34 À : [hidden email] Objet : In daily built 1.52o19 something is broken about drawing colors Dear All, I have tried to implement the latest Wayne's feature of NonBlocking Dialog and updated ImageJ to 1.52o19 build. The feature works but something else about color is broken now. I have used my macro published on ImageJ website (https://imagej.nih.gov/ij/macros/Cavalieri_V_estimator.txt). When I go with default option of first dialog ("open example stack") 1.52o19 selects single color (green) for all drawing on the opened image. 1.52n does drawing with proper colors. What can be causing that? I am putting the extract of my macro below. Just run it and you will see the difference between 1.52n and 1.52o19: ------------------ run("MRI Stack (528K)"); run("Make Substack...", " slices=4"); run("Size...", "width=372 height=452 constrain average interpolation=Bicubic"); screen = screenHeight; if (screen>1500) run("In [+]"); rename("Instructions for mri-stack"); //Printing instructions run("RGB Color"); setLocation(0, 0); setColor("green"); setFont("SansSerif", 20, "antialiased"); drawString("Instructions for MRI stack example:", 5, 150); setFont("SansSerif", 14, "antialiased"); setColor("cyan"); drawString("- Use default counting parameters", 5, 190); drawString("- Name 2 counters for eyeballs", 5, 220); drawString("- Count points hitting eyeballs on relevant slices", 5, 250); drawString("- Change counters by double click on", 5, 280); drawString(" [Multipoint Tool] in ImageJ Menu", 5, 310); drawString("- Eyeball structures are shown in red circle", 5, 340); drawString("- Eyeball volume should be about 6cm3", 5, 370); setColor("yellow"); drawString("Use 'Help' button in dialog to see full instructions", 5, 420); //Identifying eyeball setColor("red"); drawOval(220, 47, 65, 65); //Making Multipoint Tool Icon setColor("white"); drawRect(278,258,30,30); setColor("black"); drawRect(279,259,28,28); setColor(180, 180, 180); fillRect(280, 260, 26, 26); xcross = newArray(286,286,284,288,287,287,285,289,294,294,292,296,295,295,293,297,300,300,298,302); ycross = newArray(266,270,268,268,275,279,277,277,264,268,266,266,274,278,276,276,268,272,270,270); xpoints = newArray(286,294,287,295,300); ypoints = newArray(268,266,277,276,270); xarrow = newArray(300,304,301,303,302,302); yarrow = newArray(280,280,281,281,282,282); setColor("black"); for (i=0; i<20; i++) { j=i+1; drawLine(xcross[i], ycross[i], xcross[j], ycross[j]); i=i+1; } setColor("yellow"); for (i=0; i<5; i++) { drawLine(xpoints[i], ypoints[i], xpoints[i], ypoints[i]); } setColor(150, 0, 0); for (i=0; i<6; i++) { j=i+1; drawLine(xarrow[i], yarrow[i], xarrow[j], yarrow[j]); i=i+1; } run("Select None"); selectWindow("mri-stack.tif"); setLocation(400, 0); run("Set Scale...", "distance=30 known=2.4 pixel=1 unit=cm"); -------------------------------------------------------- Sincerely, Alex -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by AAM71
> On Apr 5, 2019, at 8:34 AM, Aleksandr Mironov <[hidden email]> wrote:
> > Dear All, > > I have tried to implement the latest Wayne's feature of NonBlocking Dialog and updated ImageJ to 1.52o19 build. The feature works but something else about color is broken now. This 1.52o13 regression is fixed in the latest ImageJ daily build (1.52o20). -wayne > > I have used my macro published on ImageJ website (https://imagej.nih.gov/ij/macros/Cavalieri_V_estimator.txt). When I go with default option of first dialog ("open example stack") 1.52o19 selects single color (green) for all drawing on the opened image. 1.52n does drawing with proper colors. > > What can be causing that? > > I am putting the extract of my macro below. Just run it and you will see the difference between 1.52n and 1.52o19: > > ------------------ > > run("MRI Stack (528K)"); > run("Make Substack...", " slices=4"); > run("Size...", "width=372 height=452 constrain average interpolation=Bicubic"); > screen = screenHeight; > if (screen>1500) run("In [+]"); > rename("Instructions for mri-stack"); > > //Printing instructions > run("RGB Color"); > setLocation(0, 0); > setColor("green"); > setFont("SansSerif", 20, "antialiased"); > drawString("Instructions for MRI stack example:", 5, 150); > setFont("SansSerif", 14, "antialiased"); > setColor("cyan"); > drawString("- Use default counting parameters", 5, 190); > drawString("- Name 2 counters for eyeballs", 5, 220); > drawString("- Count points hitting eyeballs on relevant slices", 5, 250); > drawString("- Change counters by double click on", 5, 280); > drawString(" [Multipoint Tool] in ImageJ Menu", 5, 310); > drawString("- Eyeball structures are shown in red circle", 5, 340); > drawString("- Eyeball volume should be about 6cm3", 5, 370); > setColor("yellow"); > drawString("Use 'Help' button in dialog to see full instructions", 5, 420); > > //Identifying eyeball > setColor("red"); > drawOval(220, 47, 65, 65); > > //Making Multipoint Tool Icon > setColor("white"); > drawRect(278,258,30,30); > setColor("black"); > drawRect(279,259,28,28); > setColor(180, 180, 180); > fillRect(280, 260, 26, 26); > xcross = newArray(286,286,284,288,287,287,285,289,294,294,292,296,295,295,293,297,300,300,298,302); > ycross = newArray(266,270,268,268,275,279,277,277,264,268,266,266,274,278,276,276,268,272,270,270); > xpoints = newArray(286,294,287,295,300); > ypoints = newArray(268,266,277,276,270); > xarrow = newArray(300,304,301,303,302,302); > yarrow = newArray(280,280,281,281,282,282); > > setColor("black"); > for (i=0; i<20; i++) { > j=i+1; > drawLine(xcross[i], ycross[i], xcross[j], ycross[j]); > i=i+1; > } > setColor("yellow"); > for (i=0; i<5; i++) { > drawLine(xpoints[i], ypoints[i], xpoints[i], ypoints[i]); > } > setColor(150, 0, 0); > for (i=0; i<6; i++) { > j=i+1; > drawLine(xarrow[i], yarrow[i], xarrow[j], yarrow[j]); > i=i+1; > } > run("Select None"); > > selectWindow("mri-stack.tif"); > setLocation(400, 0); > run("Set Scale...", "distance=30 known=2.4 pixel=1 unit=cm"); > > -------------------------------------------------------- > > Sincerely, > Alex -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |