NIH LISTSERV
NIH LISTSERV
IMAGEJ archives -- September 2000 (#13)

Go to: Previous Message | Next Message
Previous in Topic | Next in Topic
Previous by Same Author | Next by Same Author
Previous Page (September 2000) | 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)
*

Content-Type: text/plain; charset="us-ascii"
Message-ID:  <v04011700b5e2ebf876bd@[137.187.230.154]>
Date:         Mon, 11 Sep 2000 13:10:43 -0700
Reply-To:     ImageJ Interest Group <[log in to unmask]>
Sender:       ImageJ Interest Group <[log in to unmask]>
From:         Wayne Rasband <[log in to unmask]>
Subject:      Re: Clear outside w/stacks
In-Reply-To:  <[log in to unmask]>

>I want to set the pixels outside of an ROI to 0 for all images in a stack. > >The Edit-> Clear outside command only changes the current image. > >Is this a bug? > >Does anyone have any suggestions on how to implement this. > >Should I change the ImageJ source and add a property DOES_STACKS. >Or create a plugin. I tried starting with the inverter pugin, but could not >get the clearOutside() function to work. Here is a plugin version of "Clear Outside" that works for all images in a stack. -wayne /*************** Clear_Outside.java ************************/ import ij.*; import ij.plugin.PlugIn; /** This is a version of "Clear Outside" that works with stacks. */ public class Clear_Outside implements PlugIn { public void run(String arg) { ImagePlus img = WindowManager.getCurrentImage(); if (img==null ||img.getRoi()==null) { IJ.error("Image with selection required"); return; } else { int current = img.getCurrentSlice(); for (int i=1; i<=img.getStackSize(); i++) { img.setSlice(i); IJ.run("Clear Outside"); } img.setSlice(current); } } }




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