Previous Message |
Next Message Previous in Topic | Next in Topic Previous by Same Author | Next by Same Author Previous Page (November 2002) | Back to Main IMAGEJ Page | |
|
Reply
| Post a New Message |
Join or Leave IMAGEJ, or Change Options
|
Search |
|
Chronologically |
Most Recent First |
Wrap Text (Proportional Font) |
Don't Wrap Text (Non-proportional Font) |
| |
Content-Type: text/plain; charset="us-ascii" ; format="flowed" Message-ID: <a05111b00ba02dd9795cb@[169.254.243.120]> Date: Thu, 21 Nov 2002 11:26:57 -0800 Reply-To: ImageJ Interest Group <[log in to unmask]> Sender: ImageJ Interest Group <[log in to unmask]> From: Nicholas Tippery <[log in to unmask]> Subject: saving a recently updated TIFFHi, I was a happy NIHImage user, and when our lab upgraded to OS X (and for increased programmability) I dipped into ImageJ. I must confess to no prior knowledge of Java, and my programming style is a combination of trial-and-error and borrowing code from other people's programs. I am having trouble saving files, specifically stacks of 8-bit images that I create in the same program and alter just before saving. I believe I am not passing the fully updated version to the file saver, because right now the "Flip Horizontally" step applies to all but the last slice of the stack. I had the same problem before with the "Paste" step, and I got around that by inserting the "wait" step. Can someone tell me a more efficient way to save a TIFF stack, or address my problem with images not being updated before they are saved? I am embarrassed to send such choppy code, but I have been unable to find the solution on my own. Thanks for any help. Nic IJ.run("Copy"); windowManager.setTempCurrentImage(workingStack); workingStack.setSlice(k); IJ.makeRectangle(0,0,600,400); IJ.run("Paste"); } workingStack.updateImage(); IJ.wait(1800); IJ.selectWindow(nowtitle); IJ.run("Flip Horizontally", "stack"); IJ.wait(800); try { FileOutputStream fos = new FileOutputStream(directory+title); BufferedOutputStream bos = new BufferedOutputStream(fos); FileInfo fi = new FileInfo(); fi = workingStack.getFileInfo(); TiffEncoder te = new TiffEncoder(fi); DataOutputStream dos = fos; te.write(dos); } catch (IOException e) { IJ.showMessage("XYWriter", ""+e); return; } workingStack.hide(); } } workingImage.hide(); } } }
Center for Information Technology National Institutes of Health Bethesda, Maryland 20892 301 594 6248 (v) 301 496 8294 (TDD) Comments and Assistance Accessibility |