Every time an image is opened
Posted by SHW on May 19, 2010; 3:06pm
URL: http://imagej.273.s1.nabble.com/Every-time-an-image-is-opened-tp3688256.html
General:
Is there way to do an action/Macro/etc. every time an image is opened, automatically?
I would please like to know the actual answer to my question, as it applies to many other situations also. Other workarounds for this specific situation may be helpful, and would be appreciated, but would not address the issue in general. Therefore, my specific problem is listed below.
I appreciate any and all help.
- Scott Williams, PhD -
Specific:
I have 2048x2048 16-bit grayscale scale images. ImageJ automatically sets Min and Max display values to the smallest and largest value in the file, respectively, which are often NOT 0 and 65535. I can manually set these values through Balance and Contrast (B&C)>[Set], or use setMinAndMax() in a macro to do the same. But any time I go to B&C, the [Reset] button goes back to these values. I do not want this "option".
Additionally, this default value range actually PROHIBITS the manual drawing of any value higher than the largest in the file. Even if I set the Pencil to 255,255,255, it does not draw an actual white of 65565.
My current workaround is to draw a single Black pixel in the upper left, and a single White pixel in the lower right, through a macro with:
setPixel (0,0,0)
setPixel (2047,2047,65535)
This will ensure that B&C [Reset] never shows lower than the full 16-bit range. Also, it will ensure that that I can manually draw true White.
I would like a way for this simple macro to apply, automatically, each and every time I open an image.
Long-term, I might suggest:
- adding a [Full] button to the B&C pop-up menu
- relabeling the [Reset] button as something more appropriate, perhaps [Range], and
- making the "auto-[Range]-on-Open" a Option somewhere which could be enabled/disabled.