NIH LISTSERV
NIH LISTSERV
IMAGEJ archives -- May 2002 (#153)

Go to: Previous Message | Next Message
Previous in Topic | Next in Topic
Previous by Same Author | Next by Same Author
Previous Page (May 2002) | Back to Main IMAGEJ Page


Options: Reply | Post a New Message | Join or Leave IMAGEJ, or Change Options | Search
View: Chronologically | Most Recent First | Wrap Text (Proportional Font) | Don't Wrap Text (Non-proportional Font)
*

References: <6EDD9DC298BF9C48AC3EF66EA92596BC03E65A48@frbucmsx03medge>
Content-Type: multipart/mixed;
Message-ID:  <[log in to unmask]>
Date:         Thu, 23 May 2002 17:58:07 -0700
Reply-To:     [log in to unmask]
Sender:       ImageJ Interest Group <[log in to unmask]>
From:         Bob Dougherty <[log in to unmask]>
Organization: OptiNav, Inc.
Subject:      Re: adding two plugins

Liron, Here is an attempt. You should save this file in the plugins folder with the name Raw_8.java It is necessary to edit the OPTIONS string inside the plugin according to the instructions there. After that, close all images and choose "Compile and Run...." from the plugins menu. After it is working, you should be able to just choose Raw_8 from the menu (after restarting ImageJ). Instructions are also given for making a 16 bit version. Please let me know if it works. Someone may be able to think of a more elegant way to adjust the parameters. Bob "Hirsch, Liron (MED)" wrote: > Hi all , > I'm just want to make a new plugin which add the raw_file_opener (open a set > of raw files in a folder) and the stack builder (which convert the images to > a stack) and then i want to close all the opened images windows except the > new stack window. > I also need to make the stack in a 16-bit format and not 8-bit format. > > can someone help me with it ? > > Liron Hirsch -- Robert Dougherty President, OptiNav, Inc. (425) 467-1118 [log in to unmask] http://www.optinav.com


import ij.*; import ij.process.*; import ij.gui.*; import ij.io.*;//FileInfo import java.io.*;//File import java.awt.*; import ij.plugin.*; import ij.plugin.filter.*; public class Raw_8 implements PlugIn { /* Please edit the OPTIONS string, below, by turning on "Record..." in ImageJ and importing a raw image with the desired parameters. Then push the "Create Plugin" button. Copy the portion of the resulting string that starts with "image=" into the line below, replacing what is there. The " marks and the ; must be analogous to the ones in this prototype. Finally, close all images and Compile and Run the plugin. To make a 16 bit version, proceed as instructed and change the name of the plugin in the line above this paragraph to Raw_16. The new plugin must be saved in a file named Raw_16.java. Note: all files in the directory will be processed, whether or not they are really images. */ String OPTIONS = " image=8-bit width=512 height=512 offset=0 number=1 gap=0"; public void run(String arg) { OpenDialog od = new OpenDialog("Select a file in folder...",""); if (od.getFileName()==null) return; String directory = od.getDirectory(); String[]list = new File(directory).list(); if (list==null) return; for (int i=0;i<list.length;i++) { IJ.showStatus(i+"/"+list.length); File f = new File(directory+list[i]); if (f.isDirectory()) continue; if(!IJ.versionLessThan("1.27o"))IJ.log((i+1)+": "+list[i]); IJ.run("Raw...", "path='"+directory+list[i]+"'"+ OPTIONS); IJ.showProgress(1.0); IJ.showStatus(""); } IJ.run("Convert Images to Stack"); } }



Back to: Top of message | Previous page | Main IMAGEJ page

NIH LISTSERV Home Page

CIT
Center for Information Technology
National Institutes of Health
Bethesda, Maryland 20892
301 594 6248 (v) 301 496 8294 (TDD)
Comments and Assistance
Accessibility wheelchair icon