problem with command open

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with command open

Giuseppe Cancellara
hi I'm Giuseppe Cancellara,I use the imagej software for my thesis and have a problem with command open because I want to open a exisisting filebut if I use the java command open, the formal parameters should I use in a function is -name -height-length-number of copy-depth-background
finally the command creates an empty image and not what I want
now
what is the command used to open an existing image?
waiting for a response
Giuseppe Cancellara    
Reply | Threaded
Open this post in threaded view
|

command open

Giuseppe Cancellara
hello to all,I used the istruction [open ("patch");] for open an image in a java project, but does not display it on screenThere is an instruction compementary to be able to show?Thank you in advanceHappy New YearGiuseppe Cancellara
         
Reply | Threaded
Open this post in threaded view
|

FW: command open

Giuseppe Cancellara
Hi to everyone;I'm Giuseppe Cancellara and have a problemI have open an image with command :[ImagePlus imp = IJ.openImage("img.bmp");
 imp.show();]
now I want to resize that image;
what is the command for resize image?

thanks in advances
Giuseppe Cancellara            
Reply | Threaded
Open this post in threaded view
|

Re: command open

BenTupper
Hi,

On Dec 30, 2011, at 7:59 PM, Giuseppe Cancellara wrote:

> Hi to everyone;I'm Giuseppe Cancellara and have a problemI have open an image with command :[ImagePlus imp = IJ.openImage("img.bmp");
> imp.show();]
> now I want to resize that image;
> what is the command for resize image?
>

If you select the menu command "Plugins > Macros > Record..." you'll be presented with window - at upper left you can select "Plugin" from the dropdown list.  Then navigate to the "Image > Adjust > Size..." menu.  Make your size adjustment in the dialog that appears.  The Recorder will show you the command equivalent for a plugin.

If you want to skip the IJ.run() method, then you'll need to look at the ij.process.ImageProcessor.resize() method documented in the API docs.

http://imagej.nih.gov/ij/developer/api/index.html


Be sure to check out the other resources for ImageJ programming here: http://imagej.nih.gov/ij/developer/index.html 

Finally, this book - http://www.imagingbook.com/ - is a great investment if you plan on doing a lot of programming.

Cheers,
Ben
Reply | Threaded
Open this post in threaded view
|

command resize

Giuseppe Cancellara
In reply to this post by Giuseppe Cancellara
Hi to everyone;I'm Giuseppe Cancellara and have a problemI have open an image with istruction:[ImagePlus imp = IJ.openImage("img.bmp");
 imp.show();]
now I want to resize that image;
what is the istruction for resize image?

thanks in advances
Giuseppe Cancellara                
Reply | Threaded
Open this post in threaded view
|

image to stack

Giuseppe Cancellara
I want create a stack whit image called imp and imp1 (path: "c-003-01.bmp" and "c-003-08.bmp");I try whit this instruction:ImageStack st = new ImageStack();st.addSlice("c-003-01.bmp",0);st.addSlice("c-003-08.bmp",0);
but return a error
where is mistake?
thank in advance
Giuseppe Cancellara


                     
Reply | Threaded
Open this post in threaded view
|

Re: image to stack

Barry DeZonia
Hi Giuseppe,

That method is actually like this: addSlice(String label, Object
pixelArray).

Try something like this

Opener opener = new Opener();
ImagePlus imp1 = opener.openImage("c-003-01.bmp");
ImagePlus imp2 = opener.openImage("c-003-08.bmp");
ImageStack stack = new ImageStack(imp1.getWidth(), imp1.getHeight(), 2);
stack.addSlice("first slice",imp1.getProcessor().getPixels());
stack.addSlice("second slice",imp2.getProcessor().getPixels());

Note this only works if the two images have the exact same width/height and
are single slice images.


On Tue, Jan 3, 2012 at 7:53 AM, Giuseppe Cancellara <[hidden email]>wrote:

> I want create a stack whit image called imp and imp1 (path: "c-003-01.bmp"
> and "c-003-08.bmp");I try whit this instruction:ImageStack st = new
> ImageStack();st.addSlice("c-003-01.bmp",0);st.addSlice("c-003-08.bmp",0);
> but return a error
> where is mistake?
> thank in advance
> Giuseppe Cancellara
>
>
>
>
>