Login  Register

Re: how integrate bioFormat with imagej

Posted by Prashant-2-3 on Oct 01, 2008; 5:40am
URL: http://imagej.273.s1.nabble.com/how-integrate-bioFormat-with-imagej-tp3694911p3694917.html

Thanks for reply,

   I tried the following code and its working for me.
As in your example you are creating ImageStack object then passes its object
to Image plus

ImageStack  stack = new ImageStack(width,height);
ImagePlus imp = new ImagePlus(name,stack);

What i did is

After opening image from following code i pass the BufferedImage to
ImagePlus object
and thats it

ImagePlus imp = new ImagePlus("",imgObject);

are It affects something?

public ImagePlus openImage(String directory, String name)

{

try

{

String id = directory + name;

ImageReader red = new ImageReader();

red.setId(id);

////for reading the metadata of image

mdr = new MetaDataReader(red);

width = red.getSizeX();

height = red.getSizeY();

int num = red.getImageCount();

bimg = new BufferedImage[num];

for (int i = 0; i < num; i++)

{

bimg[i] = red.openImage(i);

if (i == 0)

{

img = bimg[i];

}

}

red.close(true);

}

catch (Exception e)

{

System.out.println(e);

return null;

}

return new ImagePlus("",img);

}


thanks









----- Original Message -----
From: "Curtis Rueden" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 30, 2008 7:44 PM
Subject: Re: how integrate bioFormat with imagej


> Hi Prashant,
>
> For information on using Bio-Formats to read in pixels as ImagePlus
> objects
> (ImageJ's image construct), you should read the Bio-Formats ImageJ page:
> http://www.loci.wisc.edu/ome/formats-imagej.html
>
> And specifically, the linked ImageJ plugin code examples:
> https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/Read_Image.java
> https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/utils/Mass_Importer.java
>
> Once you are opening everything as ImagePlus objects, you can use the same
> ImageJ-based processing techniques on both the compressed and uncompressed
> data.
>
> -Curtis
>
> P. S. Your code looks fine except for the "MetaDataReader" object -- to my
> knowledge that class is not part of ImageJ or Bio-Formats.
>
> On Tue, Sep 30, 2008 at 12:28 AM, prashant <
> [hidden email]> wrote:
>
>> Thanks for your reply,
>>
>> It will be very grateful if you can give me some code example.
>> I am using the following code for opening the compressed image from
>> bioFormat.jar.
>>
>> String id = directory + name;
>>
>> ImageReader red = new ImageReader();
>>
>> red.setId(id);
>>
>> width = red.getSizeX();
>>
>> height = red.getSizeY();
>>
>> int num = noOfFrames = red.getImageCount();
>>
>> //for reading the metadata of image
>>
>> mdr = new MetaDataReader(red);
>>
>> bimg = new BufferedImage[num];
>>
>> for (int i = 0; i < num; i++)
>>
>> {
>>
>> bimg[i] = red.openImage(i);
>>
>> }
>>
>> red.close(true);
>>
>> It is giving me image in BufferedImage object form.
>> thanks
>>
>>
>>
>>
>>
>>
>> ----- Original Message ----- From: "Curtis Rueden" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, September 29, 2008 9:35 PM
>> Subject: Re: how integrate bioFormat with imagej
>>
>>
>>
>>  Hi Prashant,
>>>
>>> Images opened using the Bio-Formats plugin should function the same as
>>> any
>>> other images. You can process them with plugins and macros the same way.
>>> The
>>> only thing to watch out for is to avoid opening images as virtual
>>> stacks,
>>> because while that option will save you a large amount of memory and is
>>> good
>>> for browsing, you will not be able to perform image manipulation
>>> operations
>>> unless you first convert to a normal stack using Image>Duplicate, as
>>> described in this thread from the archive: <
>>> https://list.nih.gov/cgi-bin/wa?A2=ind0809&L=imagej&H=1&P=15187>.
>>>
>>> -Curtis
>>>
>>> On Sun, Sep 28, 2008 at 11:46 PM, prashant <
>>> [hidden email]> wrote:
>>>
>>>  Hi everyOne,
>>>>
>>>>         I am opening my multiframe compressed dicom image through
>>>> bio-format.jar
>>>>      and Uncompressed images through Imagej.jar.
>>>>
>>>>      I want to apply rotate,flip,invert option with images those are
>>>> open
>>>> with bio-Format.jar.
>>>>      How can i integrate i.e. how can i perform such operation with
>>>> images
>>>> those are opened with bio-Format.jar.
>>>>
>>>>    It is same as when you open images in
>>>> imagej--->plugIns---->LOCI---->bioFormat importer
>>>>   Option.And you perform all operation with those image in Imagej.
>>>>
>>>> Thanks
>>>>
>>>> With Warm Regards
>>>> --------------------------------------------------------------------
>>>>
>>>> Prashant Chandrakar
>>>> Software Developer
>>>> MedSynaptic Pvt Ltd
>>>> 9270710943
>>>> [hidden email]
>>>>
>>>> "If the facts don't fit the theory, change the facts."
>>>>
>>>>
>>>
>