Waiting for run() command to complete before proceeding with macro execution

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Waiting for run() command to complete before proceeding with macro execution

Jeff Hardin
Dear friends,

I'm trying to write ImageJ macro equivalents of some old NIH Image  
macros that did batch rotations on 4d datasets. I'm trying to do this  
using the macro language, since it's a bit easier than the full-blown  
java in plugins.

The macros work as advertised, except that sometime cropping or  
rotation of stacks or projections get out of sink, perhaps due to  
times of heavier CPU usage or Java garbage collector operation. Is  
there a way to wait until commands that execute in their own thread  
complete when called via the "run" macro command?

Thanks in advance,

Jeff
----------------------------------------------
Jeff Hardin
Professor, Department of Zoology
Director, Biology Core Curriculum
University of Wisconsin
1117 W. Johnson St.
Madison, WI 53706
voice: (608) 262-9634
fax: (608) 262-7319
email: [hidden email]


On Nov 2, 2006, at 11:00 PM, IMAGEJ automatic digest system wrote:

> There are 14 messages totalling 1231 lines in this issue.
>
> Topics of the day:
>
>   1. AW: Out of available memory? Help! (2)
>   2. Image J - overlay (5)
>   3. Test of radialness
>   4. Create an image composed of the profile plot???
>   5. Out of available memory? Help! (3)
>   6. Nearest Neighbour Analysis (2)
>
> ----------------------------------------------------------------------
>
> Date:    Thu, 2 Nov 2006 10:20:23 +0100
> From:    "Lucas, Falk /BDF HAM" <[hidden email]>
> Subject: AW: Out of available memory? Help!
>
> Hi,
>
> we have encountered this issue too and found an solution, but only  
> for some of our machines...
>
> We had an early version (1.31) on hte machines and I set up an  
> script for just overwriting hte old version with a new one, which  
> results in the same error message you get.
> Solution: Delete the ImagJ Folder completly and install/copy the  
> current version again.
> However, if your account (on a PC) is  just associated with the  
> user group (minimum rights), this message can still be there. We  
> never encountered the message  if the user is in the main user or  
> admin group.
>
> Falk
>
> -----Ursprüngliche Nachricht-----
> Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag  
> von Jonathan Thomas
> Gesendet: Mittwoch, 1. November 2006 23:23
> An: [hidden email]
> Betreff: Out of available memory? Help!
>
> (cliffs at bottom)
>
> I am currently trying to use ImageJ to do image segmentation on  
> some ~11MB RGB images.  The images load fine into ImageJ, but if I  
> attempt to do any filtering on them ImageJ throws this error:
>
> <Out of memory>
> <All available memory (63MB) has been>
> <used. Instructions for making more>
> <available can be found in the "Memory" > <sections of the  
> installation notes at> <http://rsb.info.nih.gov/ij/docs/install/>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> I then poked through the options and raised the memory alotted to  
> 500MB, closed ImageJ and reopened it attempted the same operation  
> and got an identical error.  Even mentioning 63MB.  Note that the  
> default was not 63 MB nor was the max memory set anywhere near 63MB  
> after I changed it.
>
>
> So I came here, and I see people recommending changing the command  
> given to the executable, so I checked my ImageJ.cfg and it reads:
>
> .
> C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
> -Xmx500m -cp ij.jar ij.ImageJ
>
> In a previous thread someone mentioned a similar problem and  
> modifying this line fixed the problem but I believe that java  
> should have plenty of memory the way I have it configured.
>
> So that's my problem, I'd appreciate any help you guys can give me.
>
> If you have read this far here is some more information that may be
> helpful:
>
> 2.99Ghz Pentium D
> 2GB Ram
>
> ImageJ 1.36b
> Java 1.5.0_06
> About ImageJ displays 55MB of 500MB (11%) while the error message  
> is still in the log.
>
> The java is on this machine, while the ImageJ is being run from a  
> network drive.  The same error arrizes when I run ImageJ as an  
> applet from the NIH page.
>
> I have contacted the sys admin and he assures me that there is no  
> constraint put on memory used by a user, with the exception of the  
> physical memory on the machine and what is being used by other  
> software.
>
> Software running in the background or not has no effect on the  
> error message.
>
> I have replicated this error on 2 machines, each using their own  
> local java but the same ImageJ off the same network drive.  I have  
> also replicated it running ImageJ as an applet on both machines.
>
> Curiously when I look at the size of the image in windows it is  
> listed as 11MB, but ImageJ claims it's 27MB.  (perhaps this is  
> extra space for a
> buffer?)  One image is 2915x2456 pixel tiff.  The others are  
> similar.  All tiffs, all RGB, all produce the same error.
>
> If you have made it this far I truly commend you.  Thank you for  
> the attention and here's a quote for your efforts.
>
> "'That is indisputable,' was the answer, 'but in this country it is  
> a good thing to kill an admiral from time to time to encourage the  
> others.'"
> -Voltaire (François-Marie Arouet), Candide
>
> Thank you for any help you can give me.
> -Stumped in StonyBrook
>
>
>
>
>
> finally cliffnotes:
> 1. ImageJ throws an out of memory error when I try to analyze some  
> large tiff images 2. The machine has plenty of memory and so does  
> java.
> 3. Solutions to similar problems from this listserv do not help.
> 4. Recent software, reproducible.
> 5. HELP!
> 6. quote for your efforts, thanks!
>
> _____________________  Confidentiality  _____________________
>
> This electronic transmission is strictly confidential and intended
> solely for the addressee.  It may contain information which is covered
> by legal, professional or other privilege.  If you are not the  
> intended
> addressee, you must not disclose, copy or take any action in reliance
> of this transmission.  If you have received this transmission in  
> error,
> please notify us and delete the received data as soon as possible.
>
> This footnote also confirms that this email message has been swept
> for the presence of computer viruses.
> _______________________________________________________
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 14:09:50 +0100
> From:    Michael Weber <[hidden email]>
> Subject: Re: AW: Out of available memory? Help!
>
> Hi,
>
> it usually works for us if we:
>
> - define the amount of RAM in the config (~75% of system memory)
> - have this amount of RAM free (double check with the task manager, if
> you're a Windows user)
> - use the newest Java version
> - run only one instance of ImageJ
>
> Maybe this helps.
>
> cheers,
> Michael
>
>
> Lucas, Falk /BDF HAM schrieb:
>> Hi,
>>
>> we have encountered this issue too and found an solution, but only  
>> for some of our machines...
>>
>> We had an early version (1.31) on hte machines and I set up an  
>> script for just overwriting hte old version with a new one, which  
>> results in the same error message you get.
>> Solution: Delete the ImagJ Folder completly and install/copy the  
>> current version again.
>> However, if your account (on a PC) is  just associated with the  
>> user group (minimum rights), this message can still be there. We  
>> never encountered the message  if the user is in the main user or  
>> admin group.
>>
>> Falk
>>
>> -----Ursprüngliche Nachricht-----
>> Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag  
>> von Jonathan Thomas
>> Gesendet: Mittwoch, 1. November 2006 23:23
>> An: [hidden email]
>> Betreff: Out of available memory? Help!
>>
>> (cliffs at bottom)
>>
>> I am currently trying to use ImageJ to do image segmentation on  
>> some ~11MB RGB images.  The images load fine into ImageJ, but if I  
>> attempt to do any filtering on them ImageJ throws this error:
>>
>> <Out of memory>
>> <All available memory (63MB) has been>
>> <used. Instructions for making more>
>> <available can be found in the "Memory" > <sections of the  
>> installation notes at> <http://rsb.info.nih.gov/ij/docs/install/>
>>
>> I then poked through the options and raised the memory alotted to  
>> 500MB, closed ImageJ and reopened it attempted the same operation  
>> and got an identical error.  Even mentioning 63MB.  Note that the  
>> default was not 63 MB nor was the max memory set anywhere near  
>> 63MB after I changed it.
>>
>>
>> So I came here, and I see people recommending changing the command  
>> given to the executable, so I checked my ImageJ.cfg and it reads:
>>
>> .
>> C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
>> -Xmx500m -cp ij.jar ij.ImageJ
>>
>> In a previous thread someone mentioned a similar problem and  
>> modifying this line fixed the problem but I believe that java  
>> should have plenty of memory the way I have it configured.
>>
>> So that's my problem, I'd appreciate any help you guys can give me.
>>
>> If you have read this far here is some more information that may be
>> helpful:
>>
>> 2.99Ghz Pentium D
>> 2GB Ram
>>
>> ImageJ 1.36b
>> Java 1.5.0_06
>> About ImageJ displays 55MB of 500MB (11%) while the error message  
>> is still in the log.
>>
>> The java is on this machine, while the ImageJ is being run from a  
>> network drive.  The same error arrizes when I run ImageJ as an  
>> applet from the NIH page.
>>
>> I have contacted the sys admin and he assures me that there is no  
>> constraint put on memory used by a user, with the exception of the  
>> physical memory on the machine and what is being used by other  
>> software.
>>
>> Software running in the background or not has no effect on the  
>> error message.
>>
>> I have replicated this error on 2 machines, each using their own  
>> local java but the same ImageJ off the same network drive.  I have  
>> also replicated it running ImageJ as an applet on both machines.
>>
>> Curiously when I look at the size of the image in windows it is  
>> listed as 11MB, but ImageJ claims it's 27MB.  (perhaps this is  
>> extra space for a
>> buffer?)  One image is 2915x2456 pixel tiff.  The others are  
>> similar.  All tiffs, all RGB, all produce the same error.
>>
>> If you have made it this far I truly commend you.  Thank you for  
>> the attention and here's a quote for your efforts.
>>
>> "'That is indisputable,' was the answer, 'but in this country it  
>> is a good thing to kill an admiral from time to time to encourage  
>> the others.'"
>> -Voltaire (François-Marie Arouet), Candide
>>
>> Thank you for any help you can give me.
>> -Stumped in StonyBrook
>>
>>
>>
>>
>>
>> finally cliffnotes:
>> 1. ImageJ throws an out of memory error when I try to analyze some  
>> large tiff images 2. The machine has plenty of memory and so does  
>> java.
>> 3. Solutions to similar problems from this listserv do not help.
>> 4. Recent software, reproducible.
>> 5. HELP!
>> 6. quote for your efforts, thanks!
>>
>> _____________________  Confidentiality  _____________________
>>
>> This electronic transmission is strictly confidential and intended
>> solely for the addressee.  It may contain information which is  
>> covered
>> by legal, professional or other privilege.  If you are not the  
>> intended
>> addressee, you must not disclose, copy or take any action in reliance
>> of this transmission.  If you have received this transmission in  
>> error,
>> please notify us and delete the received data as soon as possible.
>>
>> This footnote also confirms that this email message has been swept
>> for the presence of computer viruses.
>> _______________________________________________________
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 14:24:50 -0000
> From:    "O'Brien.Joseph" <Joseph.O'[hidden email]>
> Subject: Image J - overlay
>
> Dear Image J community.
>
> It's a cold afternoon here in the UK and Im struggling with the  
> program.. Can u help?
>
> The question is.......Can imageJ perform an 'overlay' function?
>
> "What is overlay ?" I hear you ask.
> Other software performs overlay by mixing pixels i.e pixel 1 from  
> col 1, row1 belongs to ct image. Then pixel 2 from col 2, row 1  
> belongs to nuc med image. Then pixel 3 from col 3, row1 belongs to  
> ct image. And so on.
>
> I want to overaly a nucmed functional image over a CT structural  
> image.
>
> Can it be done?
>
> Kind regards in advance
>
> Yours shiveringly
>
> Joe O'Brien
> Clinical Scientist (Nuclear Medicine)
> Department of Physics and Nuclear Medicine
> City Hospital
> Dudley Road
> Birmingham
> UK
>
>
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf  
> Of Michael Weber
> Sent: 02 November 2006 13.10
> To: [hidden email]
> Subject: Re: AW: Out of available memory? Help!
>
>
> Hi,
>
> it usually works for us if we:
>
> - define the amount of RAM in the config (~75% of system memory)
> - have this amount of RAM free (double check with the task manager, if
> you're a Windows user)
> - use the newest Java version
> - run only one instance of ImageJ
>
> Maybe this helps.
>
> cheers,
> Michael
>
>
> Lucas, Falk /BDF HAM schrieb:
>> Hi,
>>
>> we have encountered this issue too and found an solution, but only  
>> for
>> some of our machines...
>>
>> We had an early version (1.31) on hte machines and I set up an script
>> for just overwriting hte old version with a new one, which results  
>> in the same error message you get.
>> Solution: Delete the ImagJ Folder completly and install/copy the  
>> current version again.
>> However, if your account (on a PC) is  just associated with the  
>> user group (minimum rights), this message can still be there. We  
>> never encountered the message  if the user is in the main user or  
>> admin group.
>>
>> Falk
>>
>> -----Ursprüngliche Nachricht-----
>> Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag  
>> von
>> Jonathan Thomas
>> Gesendet: Mittwoch, 1. November 2006 23:23
>> An: [hidden email]
>> Betreff: Out of available memory? Help!
>>
>> (cliffs at bottom)
>>
>> I am currently trying to use ImageJ to do image segmentation on some
>> ~11MB RGB images.  The images load fine into ImageJ, but if I attempt
>> to do any filtering on them ImageJ throws this error:
>>
>> <Out of memory>
>> <All available memory (63MB) has been>
>> <used. Instructions for making more>
>> <available can be found in the "Memory" > <sections of the
>> installation notes at> <http://rsb.info.nih.gov/ij/docs/install/>
>>
>> I then poked through the options and raised the memory alotted to
>> 500MB, closed ImageJ and reopened it attempted the same operation and
>> got an identical error.  Even mentioning 63MB.  Note that the default
>> was not 63 MB nor was the max memory set anywhere near 63MB after I
>> changed it.
>>
>>
>> So I came here, and I see people recommending changing the command
>> given to the executable, so I checked my ImageJ.cfg and it reads:
>>
>> .
>> C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
>> -Xmx500m -cp ij.jar ij.ImageJ
>>
>> In a previous thread someone mentioned a similar problem and  
>> modifying
>> this line fixed the problem but I believe that java should have  
>> plenty
>> of memory the way I have it configured.
>>
>> So that's my problem, I'd appreciate any help you guys can give me.
>>
>> If you have read this far here is some more information that may be
>> helpful:
>>
>> 2.99Ghz Pentium D
>> 2GB Ram
>>
>> ImageJ 1.36b
>> Java 1.5.0_06
>> About ImageJ displays 55MB of 500MB (11%) while the error message is
>> still in the log.
>>
>> The java is on this machine, while the ImageJ is being run from a
>> network drive.  The same error arrizes when I run ImageJ as an applet
>> from the NIH page.
>>
>> I have contacted the sys admin and he assures me that there is no
>> constraint put on memory used by a user, with the exception of the
>> physical memory on the machine and what is being used by other
>> software.
>>
>> Software running in the background or not has no effect on the error
>> message.
>>
>> I have replicated this error on 2 machines, each using their own  
>> local
>> java but the same ImageJ off the same network drive.  I have also
>> replicated it running ImageJ as an applet on both machines.
>>
>> Curiously when I look at the size of the image in windows it is  
>> listed
>> as 11MB, but ImageJ claims it's 27MB.  (perhaps this is extra  
>> space for a
>> buffer?)  One image is 2915x2456 pixel tiff.  The others are  
>> similar.  All tiffs, all RGB, all produce the same error.
>>
>> If you have made it this far I truly commend you.  Thank you for the
>> attention and here's a quote for your efforts.
>>
>> "'That is indisputable,' was the answer, 'but in this country it is a
>> good thing to kill an admiral from time to time to encourage the
>> others.'" -Voltaire (François-Marie Arouet), Candide
>>
>> Thank you for any help you can give me.
>> -Stumped in StonyBrook
>>
>>
>>
>>
>>
>> finally cliffnotes:
>> 1. ImageJ throws an out of memory error when I try to analyze some
>> large tiff images 2. The machine has plenty of memory and so does
>> java. 3. Solutions to similar problems from this listserv do not  
>> help.
>> 4. Recent software, reproducible. 5. HELP! 6. quote for your efforts,
>> thanks!
>>
>> _____________________  Confidentiality  _____________________
>>
>> This electronic transmission is strictly confidential and intended
>> solely for the addressee.  It may contain information which is  
>> covered
>> by legal, professional or other privilege.  If you are not the  
>> intended
>> addressee, you must not disclose, copy or take any action in reliance
>> of this transmission.  If you have received this transmission in  
>> error,
>> please notify us and delete the received data as soon as possible.
>>
>> This footnote also confirms that this email message has been swept
>> for the presence of computer viruses.
>> _______________________________________________________
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 16:39:56 +0100
> From:    Johannes Schindelin <[hidden email]>
> Subject: Re: Image J - overlay
>
> Hi,
>
> On Thu, 2 Nov 2006, O'Brien.Joseph wrote:
>
>> It's a cold afternoon here in the UK [...]
>
> Funny, I was in Scotland until Tuesday, and it was warmer than here in
> Germany!
>
>> The question is.......Can imageJ perform an 'overlay' function?
>
> You might want to copy the image to be overlayed, and play with
> "Edit/Paste Control..." I got what I wanted with "Max".
>
> Hth,
> Dscho
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 08:28:09 -0800
> From:    "Batishko, Charles R" <[hidden email]>
> Subject: Re: Test of radialness
>
> I had a problem like this a number of years ago. I don't have a  
> standard metric, but the way I did it was as follows.
>
> I segmented the objects and measured the angle of the major axis  
> for each. I defined straight lines at those angles and found the  
> set of intersections between each pair of lines. I measured the  
> tightness (density) of the cluster of intersection points. The  
> tighter the cluster, the more radial. The more diffuse the cluster,  
> the less radial. One would need to have some kind of distrubuted  
> population of samples so as to define a distribution, and a  
> threshold that might then discriminate between radial and non-
> radial. But that would need to be associated with the physical  
> reality. For example, my work involved whether to not the segmented  
> features emanated from a point source or an extended source. Based  
> on reality, one would need to define a finite threshold  
> differentiating between "point" and "extended" sources - probably  
> based on measurement uncertainty that leads to there being no such  
> thing as a point source where physical measurements are concerned.
>
> Probably not the answer you wanted, but perhaps will trigger  
> thoughts from others, or help you think of it in terms that lead to  
> a solution.
>
> Chuck
>
>> -----Original Message-----
>> From: ImageJ Interest Group [mailto:[hidden email]] On
>> Behalf Of Bulent Celasun
>> Sent: Wednesday, November 01, 2006 10:55 AM
>> To: [hidden email]
>> Subject: Test of radialness
>>
>> Dear All,
>>
>> Think of an image of an orange's cut surface (the one
>> resembling a wheel).
>> Then, imagine thresholding the juicy lobes that are separated
>> from each other.
>> You now have objects distributed radially around a central point.
>> (Petals of a flower seen from above can also serve the same purpose).
>>
>> Question:
>> Is there a measure of "radialness" of the thresholded objects
>> similar to the one called as "circularity factor" or "roundness".
>> To be useful, such a measure should be tolerant to changing
>> the number and the distance of the objects to the center
>> (i.e. adding "radial" objects of differing sizes and shapes
>> here and there should not alter it much), but responsive to
>> changes in their axes.
>>
>> In other words; can I define and measure "radialness" as a
>> variable in ImageJ?
>> If yes, how?
>>
>> Thanks,
>>
>> Bülent Celasun, MD
>>
>>
>> Department of Pathology
>> Baskent Uni. School of Medicine,
>> Ankara, Turkey
>>
>
> ------------------------------
>
> Date:    Wed, 1 Nov 2006 21:47:22 -0800
> From:    Harry Parker <[hidden email]>
> Subject: Re: Create an image composed of the profile plot???
>
> I suggest looking at the source for the plugin, "Random Ovals"  
> under the Graphics heading on the Plugin page. It shows how to draw  
> circles ( = ovals with the same width and height).
>
> --  
> Harry Parker
> Senior Systems Engineer
> Dialog Imaging Systems, Inc.
>
> ----- Original Message ----
> From: Liisa Palomaa <[hidden email]>
> To: [hidden email]
> Sent: Monday, October 30, 2006 8:57:22 PM
> Subject: Create an image composed of the profile plot???
>
> Hi again...
>
> I got the help I neede to create a new image and set the  
> pixelvalues :) Thanks
>
> Now I have a new question- when creating a new image.
> Is it possible to generate an image composed of the pixelvalues of a
> profile plot( plot values)? So that in the new image all the points
> (radius) that are at say distance 10 from the center has a pixelvalue
> 200.
>
> Thanks in advance
> //Liisa
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 12:19:54 -0500
> From:    Wayne Rasband <[hidden email]>
> Subject: Re: Out of available memory? Help!
>
> How do you run ImageJ? Double-clicking on ij.jar instead of on
> ImageJ.exe would cause this problem. Java programs are limited to 64MB
> when you run them by double clicking on their JAR file.
>
> A 2915x2456 color image does require 27MB of memory. To do the
> calculations, open a text window (shift-n), paste in the following  
> line
>
>      round(2915*2456*4/(1024*1024)) + " MB"
>
> and press ctrl-r (Run Macro).
>
> -wayne
>
>> (cliffs at bottom)
>>
>> I am currently trying to use ImageJ to do image segmentation on some
>> ~11MB
>> RGB images.  The images load fine into ImageJ, but if I attempt to do
>> any
>> filtering on them ImageJ throws this error:
>>
>> <Out of memory>
>> <All available memory (63MB) has been>
>> <used. Instructions for making more>
>> <available can be found in the "Memory" >
>> <sections of the installation notes at>
>> <http://rsb.info.nih.gov/ij/docs/install/>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>
>> I then poked through the options and raised the memory alotted to
>> 500MB,
>> closed ImageJ and reopened it attempted the same operation and got an
>> identical error.  Even mentioning 63MB.  Note that the default was  
>> not
>> 63
>> MB nor was the max memory set anywhere near 63MB after I changed it.
>>
>>
>> So I came here, and I see people recommending changing the command
>> given
>> to the executable, so I checked my ImageJ.cfg and it reads:
>>
>> .
>> C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
>> -Xmx500m -cp ij.jar ij.ImageJ
>>
>> In a previous thread someone mentioned a similar problem and  
>> modifying
>> this line fixed the problem but I believe that java should have  
>> plenty
>> of
>> memory the way I have it configured.
>>
>> So that's my problem, I'd appreciate any help you guys can give me.
>>
>> If you have read this far here is some more information that may be
>> helpful:
>>
>> 2.99Ghz Pentium D
>> 2GB Ram
>>
>> ImageJ 1.36b
>> Java 1.5.0_06
>> About ImageJ displays 55MB of 500MB (11%) while the error message is
>> still
>> in the log.
>>
>> The java is on this machine, while the ImageJ is being run from a
>> network
>> drive.  The same error arrizes when I run ImageJ as an applet from  
>> the
>> NIH
>> page.
>>
>> I have contacted the sys admin and he assures me that there is no
>> constraint put on memory used by a user, with the exception of the
>> physical memory on the machine and what is being used by other
>> software.
>>
>> Software running in the background or not has no effect on the error
>> message.
>>
>> I have replicated this error on 2 machines, each using their own  
>> local
>> java but the same ImageJ off the same network drive.  I have also
>> replicated it running ImageJ as an applet on both machines.
>>
>> Curiously when I look at the size of the image in windows it is  
>> listed
>> as
>> 11MB, but ImageJ claims it's 27MB.  (perhaps this is extra space  
>> for a
>> buffer?)  One image is 2915x2456 pixel tiff.  The others are similar.
>> All
>> tiffs, all RGB, all produce the same error.
>>
>> If you have made it this far I truly commend you.  Thank you for the
>> attention and here's a quote for your efforts.
>>
>> "'That is indisputable,' was the answer, 'but in this country it is a
>> good
>> thing to kill an admiral from time to time to encourage the others.'"
>> -Voltaire (François-Marie Arouet), Candide
>>
>> Thank you for any help you can give me.
>> -Stumped in StonyBrook
>>
>>
>>
>>
>>
>> finally cliffnotes:
>> 1. ImageJ throws an out of memory error when I try to analyze some
>> large
>> tiff images
>> 2. The machine has plenty of memory and so does java.
>> 3. Solutions to similar problems from this listserv do not help.
>> 4. Recent software, reproducible.
>> 5. HELP!
>> 6. quote for your efforts, thanks!
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 12:35:57 -0500
> From:    "DeBarr, Gabriel" <[hidden email]>
> Subject: Re: Image J - overlay
>
> You could use a "CustomCanvas" and override the "public void
> paint(Graphics g)" to fill in your overlay.  This would allow you to
> non-destructively layer one set of data on top of another.  e.g.:
> <code>
> //a custom canvas to apply a non-destructive graphic overlay to image
> display
> CustomCanvas(ImagePlus imp) {
> super(imp);
> }//~ctor
>
> public void paint(Graphics g) {
> super.paint(g);
> drawOverlay(g);
> }//~cc paint
>
> void drawOverlay(Graphics g) {
> //draw the graphic overlay (non-destructively) showing user's selected
> points.
> g.setColor(Color.blue);
> if(pending) {//draw crosshair for current
> location
> g.drawLine(screenX((int)cl_x-2),
> screenY((int)cl_y), screenX((int)cl_x+2), screenY((int)cl_y));
> g.drawLine(screenX((int)cl_x),
> screenY((int)cl_y-2), screenX((int)cl_x), screenY((int)cl_y+2));
> }
> if(n_pts>0) {//draw crosshair cursors over
> previously selected locations
> int i,lx,ly;
> for(i=0;i<n_pts;i++) {
> if(i<3)
>
> g.setColor(Color.green);//our transform defining points
> else
>
> g.setColor(Color.yellow);//the rest of them
>
> lx=(int)((mPointDouble)mPoints.elementAt(i)).getX();
>
> ly=(int)((mPointDouble)mPoints.elementAt(i)).getY();
> g.drawLine(screenX(lx-2),
> screenY(ly), screenX(lx+2), screenY(ly));
> g.drawLine(screenX(lx),
> screenY(ly-2), screenX(lx), screenY(ly+2));
> }
> }
> }//~cc drawOverlay
>
> }//~ custom canvas class
> </code>
>
> Another option would be to just create a new image, as a composite of
> your data sets.
>
> -Gabriel
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of
> Johannes Schindelin
> Sent: Thursday, November 02, 2006 10:40 AM
> To: [hidden email]
> Subject: Re: Image J - overlay
>
>
> Hi,
>
> On Thu, 2 Nov 2006, O'Brien.Joseph wrote:
>
>> It's a cold afternoon here in the UK [...]
>
> Funny, I was in Scotland until Tuesday, and it was warmer than here in
> Germany!
>
>> The question is.......Can imageJ perform an 'overlay' function?
>
> You might want to copy the image to be overlayed, and play with
> "Edit/Paste Control..." I got what I wanted with "Max".
>
> Hth,
> Dscho
>
> **********************************************************************
> ******************
>
> Note:  If the reader of this message is not the intended recipient,  
> or an employee or agent responsible for delivering this message to  
> the intended recipient, you are hereby notified that any  
> dissemination, distribution or copying of this communication is  
> strictly prohibited. If you have received this communication in  
> error, please notify us immediately by replying to the message and  
> deleting it from your computer. Thank you.
>
> **********************************************************************
> ******************
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 10:15:20 -0800
> From:    "DeBarr, Gabriel" <[hidden email]>
> Subject: Re: Image J - overlay
>
> You could use a "CustomCanvas" and override the "public void
> paint(Graphics g)" to fill in your overlay.  This would allow you to
> non-destructively layer one set of data on top of another.  e.g.:
> <code>
> //a custom canvas to apply a non-destructive graphic overlay to image
> display
> CustomCanvas(ImagePlus imp) {
> super(imp);
> }//~ctor
>
> public void paint(Graphics g) {
> super.paint(g);
> drawOverlay(g);
> }//~cc paint
>
> void drawOverlay(Graphics g) {
> //draw the graphic overlay (non-destructively) showing user's selected
> points.
> g.setColor(Color.blue);
> if(pending) {//draw crosshair for current
> location
> g.drawLine(screenX((int)cl_x-2),
> screenY((int)cl_y), screenX((int)cl_x+2), screenY((int)cl_y));
> g.drawLine(screenX((int)cl_x),
> screenY((int)cl_y-2), screenX((int)cl_x), screenY((int)cl_y+2));
> }
> if(n_pts>0) {//draw crosshair cursors over
> previously selected locations
> int i,lx,ly;
> for(i=0;i<n_pts;i++) {
> if(i<3)
>
> g.setColor(Color.green);//our transform defining points
> else
>
> g.setColor(Color.yellow);//the rest of them
>
> lx=(int)((mPointDouble)mPoints.elementAt(i)).getX();
>
> ly=(int)((mPointDouble)mPoints.elementAt(i)).getY();
> g.drawLine(screenX(lx-2),
> screenY(ly), screenX(lx+2), screenY(ly));
> g.drawLine(screenX(lx),
> screenY(ly-2), screenX(lx), screenY(ly+2));
> }
> }
> }//~cc drawOverlay
>
> }//~ custom canvas class
> </code>
>
> Another option would be to just create a new image, as a composite of
> your data sets.
>
> -Gabriel
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of
> Johannes Schindelin
> Sent: Thursday, November 02, 2006 10:40 AM
> To: [hidden email]
> Subject: Re: Image J - overlay
>
>
> Hi,
>
> On Thu, 2 Nov 2006, O'Brien.Joseph wrote:
>
>> It's a cold afternoon here in the UK [...]
>
> Funny, I was in Scotland until Tuesday, and it was warmer than here in
> Germany!
>
>> The question is.......Can imageJ perform an 'overlay' function?
>
> You might want to copy the image to be overlayed, and play with
> "Edit/Paste Control..." I got what I wanted with "Max".
>
> Hth,
> Dscho
>
> **********************************************************************
> ******************
>
> Note:  If the reader of this message is not the intended recipient,  
> or an employee or agent responsible for delivering this message to  
> the intended recipient, you are hereby notified that any  
> dissemination, distribution or copying of this communication is  
> strictly prohibited. If you have received this communication in  
> error, please notify us immediately by replying to the message and  
> deleting it from your computer. Thank you.
>
> **********************************************************************
> ******************
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 15:17:30 -0500
> From:    Jon Thomas <[hidden email]>
> Subject: Re: Out of available memory? Help!
>
> Thanks!  That solved the problem.  I was running it from the .jar.  
> As far
> as the memory usage the 27MB must be correct.  Windows must be  
> doing some
> compression or some such.  Either way, thank you very much for the  
> help.
>
> -Jon
>
>
> On 11/2/06, Wayne Rasband <[hidden email]> wrote:
>>
>> How do you run ImageJ? Double-clicking on ij.jar instead of on
>> ImageJ.exe would cause this problem. Java programs are limited to  
>> 64MB
>> when you run them by double clicking on their JAR file.
>>
>> A 2915x2456 color image does require 27MB of memory. To do the
>> calculations, open a text window (shift-n), paste in the following  
>> line
>>
>>     round(2915*2456*4/(1024*1024)) + " MB"
>>
>> and press ctrl-r (Run Macro).
>>
>> -wayne
>>
>>> (cliffs at bottom)
>>>
>>> I am currently trying to use ImageJ to do image segmentation on some
>>> ~11MB
>>> RGB images.  The images load fine into ImageJ, but if I attempt  
>>> to do
>>> any
>>> filtering on them ImageJ throws this error:
>>>
>>> <Out of memory>
>>> <All available memory (63MB) has been>
>>> <used. Instructions for making more>
>>> <available can be found in the "Memory" >
>>> <sections of the installation notes at>
>>> <http://rsb.info.nih.gov/ij/docs/install/>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>
>>> I then poked through the options and raised the memory alotted to
>>> 500MB,
>>> closed ImageJ and reopened it attempted the same operation and  
>>> got an
>>> identical error.  Even mentioning 63MB.  Note that the default  
>>> was not
>>> 63
>>> MB nor was the max memory set anywhere near 63MB after I changed it.
>>>
>>>
>>> So I came here, and I see people recommending changing the command
>>> given
>>> to the executable, so I checked my ImageJ.cfg and it reads:
>>>
>>> .
>>> C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
>>> -Xmx500m -cp ij.jar ij.ImageJ
>>>
>>> In a previous thread someone mentioned a similar problem and  
>>> modifying
>>> this line fixed the problem but I believe that java should have  
>>> plenty
>>> of
>>> memory the way I have it configured.
>>>
>>> So that's my problem, I'd appreciate any help you guys can give me.
>>>
>>> If you have read this far here is some more information that may be
>>> helpful:
>>>
>>> 2.99Ghz Pentium D
>>> 2GB Ram
>>>
>>> ImageJ 1.36b
>>> Java 1.5.0_06
>>> About ImageJ displays 55MB of 500MB (11%) while the error message is
>>> still
>>> in the log.
>>>
>>> The java is on this machine, while the ImageJ is being run from a
>>> network
>>> drive.  The same error arrizes when I run ImageJ as an applet  
>>> from the
>>> NIH
>>> page.
>>>
>>> I have contacted the sys admin and he assures me that there is no
>>> constraint put on memory used by a user, with the exception of the
>>> physical memory on the machine and what is being used by other
>>> software.
>>>
>>> Software running in the background or not has no effect on the error
>>> message.
>>>
>>> I have replicated this error on 2 machines, each using their own  
>>> local
>>> java but the same ImageJ off the same network drive.  I have also
>>> replicated it running ImageJ as an applet on both machines.
>>>
>>> Curiously when I look at the size of the image in windows it is  
>>> listed
>>> as
>>> 11MB, but ImageJ claims it's 27MB.  (perhaps this is extra space  
>>> for a
>>> buffer?)  One image is 2915x2456 pixel tiff.  The others are  
>>> similar.
>>> All
>>> tiffs, all RGB, all produce the same error.
>>>
>>> If you have made it this far I truly commend you.  Thank you for the
>>> attention and here's a quote for your efforts.
>>>
>>> "'That is indisputable,' was the answer, 'but in this country it  
>>> is a
>>> good
>>> thing to kill an admiral from time to time to encourage the  
>>> others.'"
>>> -Voltaire (Fran=E7ois-Marie Arouet), Candide
>>>
>>> Thank you for any help you can give me.
>>> -Stumped in StonyBrook
>>>
>>>
>>>
>>>
>>>
>>> finally cliffnotes:
>>> 1. ImageJ throws an out of memory error when I try to analyze some
>>> large
>>> tiff images
>>> 2. The machine has plenty of memory and so does java.
>>> 3. Solutions to similar problems from this listserv do not help.
>>> 4. Recent software, reproducible.
>>> 5. HELP!
>>> 6. quote for your efforts, thanks!
>>
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 13:50:41 -0600
> From:    Justin McGrath <[hidden email]>
> Subject: Re: Image J - overlay
>
> I create overlays by adding the values of the pixels together with
> image calculator.
> i.e.
> imageCalculator("Add create", "Red","Result of Masked");
>
> I mulitpy the overlay by a fraction so it looks transparent and
> reduces the chance of values over 255.
>
> Justin
>
>
> On 11/2/06, DeBarr, Gabriel <[hidden email]> wrote:
>> You could use a "CustomCanvas" and override the "public void
>> paint(Graphics g)" to fill in your overlay.  This would allow you to
>> non-destructively layer one set of data on top of another.  e.g.:
>> <code>
>> //a custom canvas to apply a non-destructive graphic overlay to image
>> display
>>                 CustomCanvas(ImagePlus imp) {
>>                         super(imp);
>>                 }//~ctor
>>
>>                 public void paint(Graphics g) {
>>                         super.paint(g);
>>                         drawOverlay(g);
>>                 }//~cc paint
>>
>>                 void drawOverlay(Graphics g) {
>> //draw the graphic overlay (non-destructively) showing user's  
>> selected
>> points.
>>                         g.setColor(Color.blue);
>>                         if(pending) {//draw crosshair for current
>> location
>>                                 g.drawLine(screenX((int)cl_x-2),
>> screenY((int)cl_y), screenX((int)cl_x+2), screenY((int)cl_y));
>>                                 g.drawLine(screenX((int)cl_x),
>> screenY((int)cl_y-2), screenX((int)cl_x), screenY((int)cl_y+2));
>>                         }
>>                         if(n_pts>0) {//draw crosshair cursors over
>> previously selected locations
>>                                 int i,lx,ly;
>>                                 for(i=0;i<n_pts;i++) {
>>                                         if(i<3)
>>
>> g.setColor(Color.green);//our transform defining points
>>                                         else
>>
>> g.setColor(Color.yellow);//the rest of them
>>
>> lx=(int)((mPointDouble)mPoints.elementAt(i)).getX();
>>
>> ly=(int)((mPointDouble)mPoints.elementAt(i)).getY();
>>                                         g.drawLine(screenX(lx-2),
>> screenY(ly), screenX(lx+2), screenY(ly));
>>                                         g.drawLine(screenX(lx),
>> screenY(ly-2), screenX(lx), screenY(ly+2));
>>                                 }
>>                         }
>>                 }//~cc drawOverlay
>>
>>         }//~ custom canvas class
>> </code>
>>
>> Another option would be to just create a new image, as a composite of
>> your data sets.
>>
>>         -Gabriel
>>
>> -----Original Message-----
>> From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of
>> Johannes Schindelin
>> Sent: Thursday, November 02, 2006 10:40 AM
>> To: [hidden email]
>> Subject: Re: Image J - overlay
>>
>>
>> Hi,
>>
>> On Thu, 2 Nov 2006, O'Brien.Joseph wrote:
>>
>>> It's a cold afternoon here in the UK [...]
>>
>> Funny, I was in Scotland until Tuesday, and it was warmer than  
>> here in
>> Germany!
>>
>>> The question is.......Can imageJ perform an 'overlay' function?
>>
>> You might want to copy the image to be overlayed, and play with
>> "Edit/Paste Control..." I got what I wanted with "Max".
>>
>> Hth,
>> Dscho
>>
>> *********************************************************************
>> *******************
>>
>> Note:  If the reader of this message is not the intended  
>> recipient, or an employee or agent responsible for delivering this  
>> message to the intended recipient, you are hereby notified that  
>> any dissemination, distribution or copying of this communication  
>> is strictly prohibited. If you have received this communication in  
>> error, please notify us immediately by replying to the message and  
>> deleting it from your computer. Thank you.
>>
>> *********************************************************************
>> *******************
>>
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 14:43:09 -0800
> From:    "David W. Robinson" <[hidden email]>
> Subject: Nearest Neighbour Analysis
>
> Hi there,
>
> We have 2D images of neurons and we would like to conduct a nearest
> neighbor analysis. We can use point picker to get the XY  
> coordinates of
> the cell bodies we wish to analyze but have not yet found a plugin or
> method for using ImageJ to compute the nearest neighbor value. Does
> anyone know how we can achieve this in either ImageJ or with some  
> other
> program?
>
> Thank you
>
> David
>
> --
> David W. Robinson, Ph.D.
> Vice Provost for Academic Technology
> Assistant Professor and Director, Educational Communications
> Center for Research on Occupational and Environmental Toxicology, L606
> Oregon Health & Science University
> 3181 Sam Jackson Park Road
> Portland OR 97239
>
> Tel 503-494-7361
> Fax 503-494-4352
>
> [hidden email]
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 09:04:14 -0800
> From:    Harry Parker <[hidden email]>
> Subject: Re: Out of available memory? Help!
>
> I had a similar problem when running ImageJ locally on my Windows  
> PC. =0A=
> =0AI had renamed ImageJ to something like "ImageJv1.3" to allow  
> myself muti=
> ple versions for testing.=0AIt appeared to work well in every  
> respect, EXCE=
> PT it did not read the config file memory allocation option!
> =0A=0AChanging =
> the name back to "ImageJ" fixed the problem.=0A=0AI found that I  
> could do w=
> hat I wanted to do by renaming links to the ImageJ versions in  
> different di=
> rectories.=0A=0ADid you rename ImageJ?=0A =0A--  =0AHarry Parker  
> =0ASenior=
>  Systems Engineer  =0ADialog Imaging Systems, Inc.=0A=0A-----  
> Original Mess=
> age ----=0AFrom: Jonathan Thomas <[hidden email]>=0ATo:  
> IMAGEJ@LIST=
> .NIH.GOV=0ASent: Wednesday, November 1, 2006 5:23:24 PM=0ASubject:  
> Out of a=
> vailable memory? Help!=0A=0A(cliffs at bottom)=0A=0AI am currently  
> trying t=
> o use ImageJ to do image segmentation on some ~11MB =0ARGB images.  
> The ima=
> ges load fine into ImageJ, but if I attempt to do any =0Afiltering  
> on them =
> ImageJ throws this error:=0A=0A<Out of memory>=0A<All available  
> memory (63M=
> B) has been>=0A<used. Instructions for making more>=0A<available  
> can be fou=
> nd in the "Memory" >=0A<sections of the installation notes  
> at>=0A<http://rs=
> b.info.nih.gov/ij/docs/install/
> >=0A>>>>>>>>>>>>>>>>>>>>>>>>>>>=0A=0AI then =
> poked through the options and raised the memory alotted to 500MB,  
> =0Aclosed=
>  ImageJ and reopened it attempted the same operation and got an  
> =0Aidentica=
> l error.  Even mentioning 63MB.  Note that the default was not 63  
> =0AMB nor=
>  was the max memory set anywhere near 63MB after I changed  
> it.=0A=0A=0ASo I=
>  came here, and I see people recommending changing the command  
> given =0Ato =
> the executable, so I checked my ImageJ.cfg and it reads:=0A=0A.=0AC:
> \Progra=
> m Files\Java\j2re1.4.2_03\bin\javaw.exe=0A-Xmx500m -cp ij.jar  
> ij.ImageJ=0A=
> =0AIn a previous thread someone mentioned a similar problem and  
> modifying =
> =0Athis line fixed the problem but I believe that java should have  
> plenty o=
> f =0Amemory the way I have it configured.=0A=0ASo that's my  
> problem, I'd ap=
> preciate any help you guys can give me.=0A=0AIf you have read this  
> far here=
>  is some more information that may be =0Ahelpful:=0A=0A2.99Ghz  
> Pentium D=0A=
> 2GB Ram=0A=0AImageJ 1.36b=0AJava 1.5.0_06=0AAbout ImageJ displays  
> 55MB of 5=
> 00MB (11%) while the error message is still =0Ain the log.=0A=0AThe  
> java is=
>  on this machine, while the ImageJ is being run from a network  
> =0Adrive.  T=
> he same error arrizes when I run ImageJ as an applet from the NIH  
> =0Apage.=
> =0A=0AI have contacted the sys admin and he assures me that there  
> is no =0A=
> constraint put on memory used by a user, with the exception of the  
> =0Aphysi=
> cal memory on the machine and what is being used by other  
> software.=0A=0ASo=
> ftware running in the background or not has no effect on the error  
> =0Amessa=
> ge.=0A=0AI have replicated this error on 2 machines, each using  
> their own l=
> ocal =0Ajava but the same ImageJ off the same network drive.  I  
> have also =
> =0Areplicated it running ImageJ as an applet on both  
> machines.=0A=0ACurious=
> ly when I look at the size of the image in windows it is listed as  
> =0A11MB,=
>  but ImageJ claims it's 27MB.  (perhaps this is extra space for a  
> =0Abuffer=
> ?)  One image is 2915x2456 pixel tiff.  The others are similar.  
> All =0Atif=
> fs, all RGB, all produce the same error.=0A=0AIf you have made it  
> this far =
> I truly commend you.  Thank you for the =0Aattention and here's a  
> quote for=
>  your efforts.=0A=0A"'That is indisputable,' was the answer, 'but  
> in this c=
> ountry it is a good =0Athing to kill an admiral from time to time  
> to encour=
> age the others.'"=0A-Voltaire (Fran=E7ois-Marie Arouet), Candide  
> =0A=0AThan=
> k you for any help you can give me.=0A-Stumped in  
> StonyBrook=0A=0A=0A=0A=0A=
> =0Afinally cliffnotes:=0A1. ImageJ throws an out of memory error  
> when I try=
>  to analyze some large =0Atiff images=0A2. The machine has plenty  
> of memory=
>  and so does java.=0A3. Solutions to similar problems from this  
> listserv do=
>  not help.=0A4. Recent software, reproducible.=0A5. HELP!=0A6.  
> quote for yo=
> ur efforts, thanks!=0A=0A=0A=0A=0A=0A=0A
>
> ------------------------------
>
> Date:    Thu, 2 Nov 2006 19:33:55 -0600
> From:    Michael Miller <[hidden email]>
> Subject: Re: Nearest Neighbour Analysis
>
> Hello,
>
> I've written a number of plugins for ImageJ in Java that: trace pixel
> neighborhoods on a greyscale image to try to find the nearest local  
> maxima,
> search skeletal branchings for the nearest "node", as well as  
> looked at
> mesh/particle components. So I strongly suspect what you are trying  
> to do
> can be done within ImageJ.
>
> I think generally the best advice at this stage would be for you to  
> post a
> few links to some of your images that represent a good sample of  
> what you
> have. Then I can at least respond more completely. If you're  
> tracing along
> neuron network connections, then I can almost definately help you. :-)
>
> If your pictured neurons are isolated, my first guess would be to  
> use the
> Particle Analyzer to identify the exact single-coordinate centers  
> of each
> neuron, construct a list of those centers, and then at that point a  
> first
> year Informatics student could pair up all the closest neurons :-)
>
> Cheers,
> -Mike Miller
> [hidden email]
>
> ----- Original Message -----
> From: "David W. Robinson" <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, November 02, 2006 4:43 PM
> Subject: Nearest Neighbour Analysis
>
>
>> Hi there,
>>
>> We have 2D images of neurons and we would like to conduct a nearest
>> neighbor analysis. We can use point picker to get the XY  
>> coordinates of
>> the cell bodies we wish to analyze but have not yet found a plugin or
>> method for using ImageJ to compute the nearest neighbor value.  
>> Does anyone
>> know how we can achieve this in either ImageJ or with some other  
>> program?
>>
>> Thank you
>>
>> David
>>
>> --
>> David W. Robinson, Ph.D.
>> Vice Provost for Academic Technology
>> Assistant Professor and Director, Educational Communications
>> Center for Research on Occupational and Environmental Toxicology,  
>> L606
>> Oregon Health & Science University
>> 3181 Sam Jackson Park Road
>> Portland OR 97239
>>
>> Tel 503-494-7361
>> Fax 503-494-4352
>>
>> [hidden email]
>
> ------------------------------
>
> End of IMAGEJ Digest - 1 Nov 2006 to 2 Nov 2006 (#2006-295)
> ***********************************************************