|
Bugzilla – Bug 1032 |
I'm trying to merge two images (1 gb each, tiff files) and Image J processess the top half of the image while the bottom is black. |
Last modified: 2015-04-06 15:54:57 CDT |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
| I'm trying to merge two images (1 gb each, tiff files) and Image J processess... | |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||
Created attachment 241 Screenshot of merge error Additional information: o ImageJ version - Fiji o OS version - Windows 7 o Java version (shown in Help/About ImageJ) - Latest o Memory assigned to ImageJ (Edit/Options/Memory) System memory. Assigned to ImageJ 15-20 GB o Any error messages - No error messages, just incorrect merging o Steps needed to reproduce the problem - This is reproducible on multiple machines. When the size of image drops to 450 MB, ImageJ is able to merge correctly. Please advise!Try using Java 8. I just did some testing and found it handles 1GB images much better than Java 6. I run ImageJ with Java 8 on my Mac by changing to the ImageJ directory and using this command: java -Xmx7g -jar ij.jar Or this FAQ describes how to run Fiji using a different version of Java: http://fiji.sc/Frequently_Asked_Questions#How_do_I_launch_ImageJ_with_a_different_version_of_Java.3FCreated attachment 242 Update on ImageJ merge errorComment on attachment 242 Update on ImageJ merge error This was run on a dektop with 18GB of 24 GB RAM allocated to ImageJ. Latest version of JAVA.Created attachment 243 Screenshot showing merge macro output on OS XDoes the following test macro work as expected on your system? I attached a screenshot that shows what the merged image created by the macro should look like. Before running the macro, you should upgrade to the latest ImageJ daily build (1.49q15). It fixes a bug that caused extremely large images (e.g., 30000x30000) to not be displayed correctly because the minimum magnification was 3.1%. Also, the "Merge Channels" command now deletes the source images only after displaying the composite image. To upgrade, use the Help>Update ImageJ command and select "daily build" from the drop down menu. MB = 850; w = sqrt(MB*1024*1024); doCommand("Monitor Memory..."); newImage("c1", "8-bit ramp", w, w, 1); newImage("c2", "8-bit ramp", w, w, 1); run("Rotate 90 Degrees Right"); run("Merge Channels...", "c1=c1 c2=c2 create");Created attachment 244 Update on ImageJ merge error-2 Thanks so much for your help on this. I have followed your instructions and run the macro; however, the same error persists (attached screenshot). Not sure if this is a windows error. Please advise.The following example macro creates two 850 megapixel images, merges them, scales the merged image to 2048x2048, saves it as JPEG and displays it. It does this without displaying any of the 850 megapixel images. The resulting JPEG file is 137K. MB = 850; setBatchMode(true); w = sqrt(MB*1024*1024); doCommand("Monitor Memory..."); newImage("c1", "8-bit ramp", w, w, 1); newImage("c2", "8-bit ramp", w, w, 1); run("Rotate 90 Degrees Right"); run("Merge Channels...", "c1=c1 c2=c2"); run("Size...", "width=2048 height=2048 constrain interpolation=Bilinear"); saveAs("Jpeg", ""); setBatchMode(false); This version of the macro saves the 850 megapixel merged image as a 15MB (29,854x29,854) JPEG without displaying anything. MB = 850; setBatchMode(true); w = sqrt(MB*1024*1024); doCommand("Monitor Memory..."); newImage("c1", "8-bit ramp", w, w, 1); newImage("c2", "8-bit ramp", w, w, 1); run("Rotate 90 Degrees Right"); run("Merge Channels...", "c1=c1 c2=c2"); saveAs("Jpeg", "");You can use the open() function to open images and you can run commands in the Image>Lookup Tables menu to assign colors to the channels. Here is an example: open(""); rename("c1"); open(""); rename("c2"); run("Merge Channels...", "c1=c1 c2=c2 create"); run("Blue"); setSlice(2); run("Yellow"); The command recorder (Plugins>Macros>Record) is helpful for creating macro code.