Hi there,
I'm wondering if there's a repository where we can access older versions of imageJ such as 1.51q etc. I had been using that version (1.51q) and recently upgraded it to the latest 1.51s. From which, I realised that the scripts that used to work in the older versions are no longer working. Hence, I would like to downgrade my current version to the older ones to see if that would resolve the problem. Also, I'm a Mac user (High sierra; 10.13.2). Will my OS affect the running of my old scripts? Please advise. Many thanks. Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Good day Adam,
please have a look at "Help >> Update ImageJ... >> Upgrade to" where you can select older versions. Regarding macOS "High Sierra" there exist a number of problems due to Java versions. Please consult: <https://imagej.nih.gov/ij/docs/install/osx.html> Regards Herbie :::::::::::::::::::::::::::::::::::::: Am 25.12.17 um 05:44 schrieb wei.jian: > Hi there, > > I'm wondering if there's a repository where we can access older versions > of > imageJ such as 1.51q etc. > > I had been using that version (1.51q) and recently upgraded it to the > latest > 1.51s. From which, I realised that the scripts that used to work in the > older versions are no longer working. Hence, I would like to downgrade my > current version to the older ones to see if that would resolve the > problem. > > Also, I'm a Mac user (High sierra; 10.13.2). Will my OS affect the running > of my old scripts? > > Please advise. > Many thanks. > Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by wei.jian
> On Dec 24, 2017, at 11:44 PM, wei.jian <[hidden email]> wrote:
> > Hi there, > > I'm wondering if there's a repository where we can access older versions of > imageJ such as 1.51q etc. You can use the Help>Update ImageJ command to downgrade to earlier versions of ImageJ, including version 1.50 and version 1.51r, by selecting “previous” from the drop down menu. The best thing to do, however, is to provide a small script that reproduces the problem so it can be fixed. > I had been using that version (1.51q) and recently upgraded it to the latest > 1.51s. From which, I realised that the scripts that used to work in the > older versions are no longer working. Hence, I would like to downgrade my > current version to the older ones to see if that would resolve the problem. > Also, I'm a Mac user (High sierra; 10.13.2). Will my OS affect the running > of my old scripts? Jave 6 is broken on macOS High Sierra. You need to use a version of ImageJ bundled with Java 8, such as the one available from <https://imagej.nih.gov/ij/download.html>. -wayne -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi everyone,
Thanks for the suggestions. Wayne, I'm already on Java 8. This version was installed independently of the bundle (ImageJ+java8) that's available on the imageJ website. Will this give rise to the problem? Or should I use the bundled version? I've attached the script that used to work in the older ImageJ version (1.50) below. This is a script that performs intensity and background measurements on a specific channel of a multichannel image. It should open .zip files in a folder (called MaxPfolder) and then open images with the corresponding names (based on the first 5 characters of the .zip file name ) in a pairwise manner. In the .zip files, there are selections that have been saved. Eventually, they will be replaced with boxes for intensity and background measurements in my channel of interest (Channel 2). The problem: 1) The script stops working after the initial selections in my .zip files have been updated to box selections. 2) The selections cannot be seen in my channel of interest (C2), which used to appear before the prompt for me to adjust the boxes to place them over my signal of interest. 3) Moreover, C3 (the 3rd channel) is the last channel that appears. C3 should not be the active image as only C2 was selected in the prior line of code where I used setBatchmode("show") to show C2. Possible problem: I suspect the setBatchmode function is the cause of the problem as the removal of this function from the script solves the problem. However, I'm unclear what/ why exactly that would be the case. Here's the script I wrote: START: waitForUser("Choose MaxP folder"); MaxPfolder=getDirectory("Choose"); MaxPfolderlist=getFileList(MaxPfolder); waitForUser("Choose MaxP Intensity folder"); MaxPintensityfolder = getDirectory("Choose"); MaxPintensityfolderlist = getFileList(MaxPintensityfolder); for (max=0; max<MaxPfolderlist.length; max++) { if (endsWith(MaxPfolderlist[max], ".zip")) { open(MaxPfolder + MaxPfolderlist[max]); title = File.name(); RoiID = substring(title, 0,5); //set string criteria for (max2=0; max2<MaxPfolderlist.length; max2++) { setBatchMode("hide"); if (endsWith(MaxPfolderlist[max2], ".tif") && indexOf(MaxPfolderlist[max2],RoiID)>=0) { open(MaxPfolder + MaxPfolderlist[max2]); run("Split Channels"); selectWindow("C2-" + MaxPfolderlist[max2]); run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel"); setBatchMode("show"); for (remove=0; remove<roiManager("Count"); remove++) { roiManager("select", remove); typeIII = Roi.getType(); color = Roi.getStrokeColor(); if (typeIII == "composite") { roiManager("delete"); remove--; } if (typeIII == "point" && color == "magenta") { Roi.getCoordinates(xpoints,ypoints); //Identify coordinates for(iii=0; iii<xpoints.length; iii++){ rectx=xpoints[iii]; recty=ypoints[iii]; makeRectangle(rectx, recty, 1,1); BrightestPxID(10, 15, 15, 3); } } if (typeIII == "point" && color == "yellow") { roiManager("delete"); remove--; } if (typeIII == "point" && color == "blue") { roiManager("delete"); remove--; } if (typeIII == "point" && color == "cyan") { roiManager("delete"); remove--; } } run("To ROI Manager"); setBatchMode("show"); roiManager("Show All"); setTool("zoom"); waitForUser("adjust box selection for intensity measurements"); filename = getTitle(); roiManager("save", MaxPintensityfolder +filename+"intensity.zip") for (box=0; box<roiManager("Count"); box++) { roiManager("select", box); getStatistics(area,mean); IntDen = area * mean; color2 = Roi.getStrokeColor(); if (color2 == "red") { TotalCherryIntensity = Array.concat(TotalCherryIntensity, IntDen); imageTitle = getTitle() + "_selectionNo: " + box; Title = Array.concat(Title, imageTitle); } if (color2 == "green") { bkgroundIntensityI = Array.concat(bkgroundIntensityI, IntDen*9); } if (color2 == "blue") { bkgroundIntensityII = Array.concat(bkgroundIntensityII, IntDen*9); } } bkgdsub=newArray(bkgroundIntensityI.length); j=0; for (array=0; array<bkgroundIntensityI.length; array++) { bkgdsub[j] = TotalCherryIntensity[array] - (bkgroundIntensityI[array] + bkgroundIntensityII[array])/2; j++; } Array.show("Results", TotalCherryIntensity, bkgroundIntensityI, bkgroundIntensityII, bkgdsub, Title); setBatchMode("show"); run("Close All"); roiManager("Reset"); } } } } function BrightestPxID(boxsize, boxW, boxH, boxFactor) { getSelectionCoordinates(x,y); for (iii=0; iii<x.length; iii++) { X=x[iii]; Y=y[iii]; } //makePoint(X, Y); //print(X,Y); Intenvalue = newArray(boxsize*boxsize*4+boxsize*4+1); Xvalue = newArray(boxsize*boxsize*4+boxsize*4+1); Yvalue = newArray(boxsize*boxsize*4+boxsize*4+1); j=0; for (i=X-boxsize; i<X+boxsize+1; i++) { for (ii=Y-boxsize; ii<Y+boxsize+1; ii++) { value = getPixel(i, ii); Intenvalue[j] = getPixel(i, ii); Xvalue[j] = i; Yvalue[j] = ii; j++; } } Array.getStatistics(Intenvalue, min, max2, mean, stdDev); //print(max2); //Array.print(Intenvalue); for (a=0; a<Intenvalue.length; a++) { if (Intenvalue[a] == max2) { Xpos = Xvalue[a]; Ypos = Yvalue[a]; } } pos = newArray(Xpos, Ypos); setColor("red"); Overlay.drawRect(Xpos-(boxW-1)/2, Ypos-(boxH-1)/2, boxW, boxH); Overlay.show(); setColor("green"); Overlay.drawRect(Xpos-(boxW-1)/2-boxW/boxFactor-1, Ypos-(boxH-1)/2, boxW/boxFactor, boxH/boxFactor); Overlay.show(); setColor("blue"); Overlay.drawRect(Xpos-(boxW-1)/2+boxW+1, Ypos-(boxH-1)/2, boxW/boxFactor, boxH/boxFactor); Overlay.show(); //Array.print(pos); } END Thanks in advance. Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Herbie
Hi Herbie,
Thanks for getting back to me. Do you think if 'Path randomization' can affect the order at which files are opened in a script? My script used to be able to open files based on the numerical order but upon upgrading to High sierra, this no longer works. Also, I didn't have to use "Image Sequence" previously. It seems like a OS specific problem.. Do you know of a quick fix to this? Many thanks. Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Good day Adam,
I'm sorry but I can't help you further because I don't run macOS "High Sierra". I'm pretty sure that the problem with your script has different causes. Did you check the ImageJ-options for possible changes you've made? I highly recommend to download the Java-bundled ImageJ from the website indicated in my previous post. Good luck Herbie :::::::::::::::::::::::::::::::::::::: Am 26.12.17 um 01:08 schrieb wei.jian: > Hi Herbie, > > Thanks for getting back to me. > > Do you think if 'Path randomization' can affect the order at which files > are > opened in a script? > > My script used to be able to open files based on the numerical order but > upon upgrading to High sierra, this no longer works. Also, I didn't have > to > use "Image Sequence" previously. > > It seems like a OS specific problem.. Do you know of a quick fix to this? > > Many thanks. > Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Herbie,
Thanks for getting back. Really appreciate your help. There was no changes made to my script since my OS and imageJ updates. Hence, I suspect that either factor or both must have contributed to the error I saw. May I know what can I learn from ImageJ-options? Thanks. Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Adam,
I didn't suggest that you changed something in your script. ImageJ-options are certain preferences of ImageJ: "Edit >> Options" Furthermore, if you use "Analyze Particles" or ""Measure", please check "Analyze >> Set Measurements..." And yes, it is always a good idea to study the docs: <https://imagej.nih.gov/ij/docs/index.html> Regards Herbie :::::::::::::::::::::::::::::::::::::: Am 26.12.17 um 13:17 schrieb wei.jian: > Hi Herbie, > > Thanks for getting back. Really appreciate your help. > > There was no changes made to my script since my OS and imageJ updates. > Hence, I suspect that either factor or both must have contributed to the > error I saw. > > May I know what can I learn from ImageJ-options? > > Thanks. > Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by wei.jian
Hi Adam,
without fully reading your macro, I noticed that some quotes got converted to the HTML code '"' and some '&' (ampersand) characters had been converted to '&' Other quote and ampersand characters have been untouched, so it seems this was not caused by your mailing program (it should have converted either all or none). So make sure that no characters in your macro have been converted to these HTML entities. > My script used to be able to open files based on the numerical order > but > upon upgrading to High sierra, this no longer works. Also, I didn't > have to > use "Image Sequence" previously. You should never assume that a directory listing function like the "getFileList" macro command gives you a certain order of the files; this definitely depends on the operating system and it is sometimes also affected by settings of the operating system. If alphanumeric sorting helps, use Array.sort(myFileList). Path randomization: As I understand it, this only affects files inside the ImageJ folder. See here how to avoid it: https://imagej.net/docs/install/osx.html (paragraph "macOS 10.12 (Sierra)") What you might also check: http://imagej.net/Troubleshooting#The_same_plugin_gives_different_results_on_different_machines.21 Michael ________________________________________________________________ On 2017-12-26 01:02, wei.jian wrote: > Hi everyone, > > Thanks for the suggestions. > > Wayne, I'm already on Java 8. This version was installed independently > of > the bundle (ImageJ+java8) that's available on the imageJ website. Will > this > give rise to the problem? Or should I use the bundled version? > > I've attached the script that used to work in the older ImageJ version > (1.50) below. This is a script that performs intensity and background > measurements on a specific channel of a multichannel image. It should > open > .zip files in a folder (called MaxPfolder) and then open images with > the > corresponding names (based on the first 5 characters of the .zip file > name ) > in a pairwise manner. In the .zip files, there are selections that have > been > saved. Eventually, they will be replaced with boxes for intensity and > background measurements in my channel of interest (Channel 2). > > The problem: > 1) The script stops working after the initial selections in my .zip > files > have been updated to box selections. 2) The selections cannot be seen > in my > channel of interest (C2), which used to appear before the prompt for me > to > adjust the boxes to place them over my signal of interest. 3) Moreover, > C3 > (the 3rd channel) is the last channel that appears. C3 should not be > the > active image as only C2 was selected in the prior line of code where I > used > setBatchmode("show") to show C2. > > Possible problem: > I suspect the setBatchmode function is the cause of the problem as the > removal of this function from the script solves the problem. However, > I'm > unclear what/ why exactly that would be the case. > > Here's the script I wrote: > START: > waitForUser("Choose MaxP folder"); > MaxPfolder=getDirectory("Choose"); > MaxPfolderlist=getFileList(MaxPfolder); > waitForUser("Choose MaxP Intensity folder"); > MaxPintensityfolder = getDirectory("Choose"); > MaxPintensityfolderlist = getFileList(MaxPintensityfolder); > > for (max=0; max<MaxPfolderlist.length; max++) { > if (endsWith(MaxPfolderlist[max], ".zip")) { > open(MaxPfolder + MaxPfolderlist[max]); > title = File.name(); > RoiID = substring(title, 0,5); //set string criteria > > for (max2=0; max2<MaxPfolderlist.length; max2++) { > setBatchMode("hide"); > if (endsWith(MaxPfolderlist[max2], ".tif") && > indexOf(MaxPfolderlist[max2],RoiID)>=0) { > open(MaxPfolder + MaxPfolderlist[max2]); > run("Split Channels"); > selectWindow("C2-" + MaxPfolderlist[max2]); > run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel"); > setBatchMode("show"); > for (remove=0; remove<roiManager("Count"); remove++) { > roiManager("select", remove); > typeIII = Roi.getType(); > color = Roi.getStrokeColor(); > if (typeIII == "composite") { > roiManager("delete"); > remove--; > } > > if (typeIII == "point" && color == "magenta") { > Roi.getCoordinates(xpoints,ypoints); //Identify coordinates > for(iii=0; iii<xpoints.length; iii++){ > rectx=xpoints[iii]; > recty=ypoints[iii]; > makeRectangle(rectx, recty, 1,1); > BrightestPxID(10, 15, 15, 3); > } > } > > if (typeIII == "point" && color == "yellow") { > roiManager("delete"); > remove--; > } > > if (typeIII == "point" && color == "blue") { > roiManager("delete"); > remove--; > } > > if (typeIII == "point" && color == "cyan") { > roiManager("delete"); > remove--; > } > } > > run("To ROI Manager"); > setBatchMode("show"); > roiManager("Show All"); > setTool("zoom"); > waitForUser("adjust box selection for intensity measurements"); > filename = getTitle(); > roiManager("save", MaxPintensityfolder +filename+"intensity.zip") > > for (box=0; box<roiManager("Count"); box++) { > roiManager("select", box); > getStatistics(area,mean); > IntDen = area * mean; > color2 = Roi.getStrokeColor(); > if (color2 == "red") { > TotalCherryIntensity = Array.concat(TotalCherryIntensity, IntDen); > imageTitle = getTitle() + "_selectionNo: " + box; > Title = Array.concat(Title, imageTitle); > } > if (color2 == "green") { > bkgroundIntensityI = Array.concat(bkgroundIntensityI, IntDen*9); > } > > if (color2 == "blue") { > bkgroundIntensityII = Array.concat(bkgroundIntensityII, IntDen*9); > } > } > > bkgdsub=newArray(bkgroundIntensityI.length); > j=0; > for (array=0; array<bkgroundIntensityI.length; array++) { > bkgdsub[j] = TotalCherryIntensity[array] - > (bkgroundIntensityI[array] + > bkgroundIntensityII[array])/2; > j++; > } > > Array.show("Results", TotalCherryIntensity, bkgroundIntensityI, > bkgroundIntensityII, bkgdsub, Title); > setBatchMode("show"); > run("Close All"); > roiManager("Reset"); > } > } > } > } > > function BrightestPxID(boxsize, boxW, boxH, boxFactor) { > getSelectionCoordinates(x,y); > for (iii=0; iii<x.length; iii++) { > X=x[iii]; > Y=y[iii]; > } > //makePoint(X, Y); > //print(X,Y); > Intenvalue = newArray(boxsize*boxsize*4+boxsize*4+1); > Xvalue = newArray(boxsize*boxsize*4+boxsize*4+1); > Yvalue = newArray(boxsize*boxsize*4+boxsize*4+1); > j=0; > for (i=X-boxsize; i<X+boxsize+1; i++) { > for (ii=Y-boxsize; ii<Y+boxsize+1; ii++) { > value = getPixel(i, ii); > Intenvalue[j] = getPixel(i, ii); > Xvalue[j] = i; > Yvalue[j] = ii; > j++; > } > } > Array.getStatistics(Intenvalue, min, max2, mean, stdDev); > //print(max2); > //Array.print(Intenvalue); > for (a=0; a<Intenvalue.length; a++) { > if (Intenvalue[a] == max2) { > Xpos = Xvalue[a]; > Ypos = Yvalue[a]; > } > } > pos = newArray(Xpos, Ypos); > setColor("red"); > Overlay.drawRect(Xpos-(boxW-1)/2, Ypos-(boxH-1)/2, boxW, boxH); > Overlay.show(); > setColor("green"); > Overlay.drawRect(Xpos-(boxW-1)/2-boxW/boxFactor-1, Ypos-(boxH-1)/2, > boxW/boxFactor, boxH/boxFactor); > Overlay.show(); > setColor("blue"); > Overlay.drawRect(Xpos-(boxW-1)/2+boxW+1, Ypos-(boxH-1)/2, > boxW/boxFactor, > boxH/boxFactor); > Overlay.show(); > //Array.print(pos); > } > END > > Thanks in advance. > Adam > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by wei.jian
> On Dec 25, 2017, at 7:02 PM, wei.jian <[hidden email]> wrote:
> > Hi everyone, > > Thanks for the suggestions. > > Wayne, I'm already on Java 8. This version was installed independently of > the bundle (ImageJ+java8) that's available on the imageJ website. Will this > give rise to the problem? Or should I use the bundled version? The version of ImageJ for macOS at https://imagej.nih.gov/ij/download.html is bundled with Java 1.8.0_101. Other versions of Java 8 for macOS may give rise to problems. > I've attached the script that used to work in the older ImageJ version > (1.50) below. I see that your macro uses setBatchMode("show”). Try updating to the latest ImageJ daily build (1.51t18). It fixes a v1.51r26 regression that caused setBatchMode("show”) to not work as expected. To upgrade, use the Help>Update ImageJ command and select “daily build” from the drop down menu. -wayne > This is a script that performs intensity and background > measurements on a specific channel of a multichannel image. It should open > .zip files in a folder (called MaxPfolder) and then open images with the > corresponding names (based on the first 5 characters of the .zip file name ) > in a pairwise manner. In the .zip files, there are selections that have been > saved. Eventually, they will be replaced with boxes for intensity and > background measurements in my channel of interest (Channel 2). > > The problem: > 1) The script stops working after the initial selections in my .zip files > have been updated to box selections. 2) The selections cannot be seen in my > channel of interest (C2), which used to appear before the prompt for me to > adjust the boxes to place them over my signal of interest. 3) Moreover, C3 > (the 3rd channel) is the last channel that appears. C3 should not be the > active image as only C2 was selected in the prior line of code where I used > setBatchmode("show") to show C2. > > Possible problem: > I suspect the setBatchmode function is the cause of the problem as the > removal of this function from the script solves the problem. However, I'm > unclear what/ why exactly that would be the case. > > Here's the script I wrote: > START: > waitForUser("Choose MaxP folder"); > MaxPfolder=getDirectory("Choose"); > MaxPfolderlist=getFileList(MaxPfolder); > waitForUser("Choose MaxP Intensity folder"); > MaxPintensityfolder = getDirectory("Choose"); > MaxPintensityfolderlist = getFileList(MaxPintensityfolder); > > for (max=0; max<MaxPfolderlist.length; max++) { > if (endsWith(MaxPfolderlist[max], ".zip")) { > open(MaxPfolder + MaxPfolderlist[max]); > title = File.name(); > RoiID = substring(title, 0,5); //set string criteria > > for (max2=0; max2<MaxPfolderlist.length; max2++) { > setBatchMode("hide"); > if (endsWith(MaxPfolderlist[max2], ".tif") && > indexOf(MaxPfolderlist[max2],RoiID)>=0) { > open(MaxPfolder + MaxPfolderlist[max2]); > run("Split Channels"); > selectWindow("C2-" + MaxPfolderlist[max2]); > run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel"); > setBatchMode("show"); > for (remove=0; remove<roiManager("Count"); remove++) { > roiManager("select", remove); > typeIII = Roi.getType(); > color = Roi.getStrokeColor(); > if (typeIII == "composite") { > roiManager("delete"); > remove--; > } > > if (typeIII == "point" && color == "magenta") { > Roi.getCoordinates(xpoints,ypoints); //Identify coordinates > for(iii=0; iii<xpoints.length; iii++){ > rectx=xpoints[iii]; > recty=ypoints[iii]; > makeRectangle(rectx, recty, 1,1); > BrightestPxID(10, 15, 15, 3); > } > } > > if (typeIII == "point" && color == "yellow") { > roiManager("delete"); > remove--; > } > > if (typeIII == "point" && color == "blue") { > roiManager("delete"); > remove--; > } > > if (typeIII == "point" && color == "cyan") { > roiManager("delete"); > remove--; > } > } > > run("To ROI Manager"); > setBatchMode("show"); > roiManager("Show All"); > setTool("zoom"); > waitForUser("adjust box selection for intensity measurements"); > filename = getTitle(); > roiManager("save", MaxPintensityfolder +filename+"intensity.zip") > > for (box=0; box<roiManager("Count"); box++) { > roiManager("select", box); > getStatistics(area,mean); > IntDen = area * mean; > color2 = Roi.getStrokeColor(); > if (color2 == "red") { > TotalCherryIntensity = Array.concat(TotalCherryIntensity, IntDen); > imageTitle = getTitle() + "_selectionNo: " + box; > Title = Array.concat(Title, imageTitle); > } > if (color2 == "green") { > bkgroundIntensityI = Array.concat(bkgroundIntensityI, IntDen*9); > } > > if (color2 == "blue") { > bkgroundIntensityII = Array.concat(bkgroundIntensityII, IntDen*9); > } > } > > bkgdsub=newArray(bkgroundIntensityI.length); > j=0; > for (array=0; array<bkgroundIntensityI.length; array++) { > bkgdsub[j] = TotalCherryIntensity[array] - (bkgroundIntensityI[array] + > bkgroundIntensityII[array])/2; > j++; > } > > Array.show("Results", TotalCherryIntensity, bkgroundIntensityI, > bkgroundIntensityII, bkgdsub, Title); > setBatchMode("show"); > run("Close All"); > roiManager("Reset"); > } > } > } > } > > function BrightestPxID(boxsize, boxW, boxH, boxFactor) { > getSelectionCoordinates(x,y); > for (iii=0; iii<x.length; iii++) { > X=x[iii]; > Y=y[iii]; > } > //makePoint(X, Y); > //print(X,Y); > Intenvalue = newArray(boxsize*boxsize*4+boxsize*4+1); > Xvalue = newArray(boxsize*boxsize*4+boxsize*4+1); > Yvalue = newArray(boxsize*boxsize*4+boxsize*4+1); > j=0; > for (i=X-boxsize; i<X+boxsize+1; i++) { > for (ii=Y-boxsize; ii<Y+boxsize+1; ii++) { > value = getPixel(i, ii); > Intenvalue[j] = getPixel(i, ii); > Xvalue[j] = i; > Yvalue[j] = ii; > j++; > } > } > Array.getStatistics(Intenvalue, min, max2, mean, stdDev); > //print(max2); > //Array.print(Intenvalue); > for (a=0; a<Intenvalue.length; a++) { > if (Intenvalue[a] == max2) { > Xpos = Xvalue[a]; > Ypos = Yvalue[a]; > } > } > pos = newArray(Xpos, Ypos); > setColor("red"); > Overlay.drawRect(Xpos-(boxW-1)/2, Ypos-(boxH-1)/2, boxW, boxH); > Overlay.show(); > setColor("green"); > Overlay.drawRect(Xpos-(boxW-1)/2-boxW/boxFactor-1, Ypos-(boxH-1)/2, > boxW/boxFactor, boxH/boxFactor); > Overlay.show(); > setColor("blue"); > Overlay.drawRect(Xpos-(boxW-1)/2+boxW+1, Ypos-(boxH-1)/2, boxW/boxFactor, > boxH/boxFactor); > Overlay.show(); > //Array.print(pos); > } > END > > Thanks in advance. > Adam -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Michael Schmid
Hi Michael,
Sorry for the late reply. Thanks for your suggestions. Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Herbie
Hi Herbie,
Got it! Thanks for your suggestions. Adam -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |