Augmenting an ImagePlus with Additional Information

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

Augmenting an ImagePlus with Additional Information

Michael Ellis
Augmenting an ImagePlus with Additional Information

I am writing an ImageJ plugin to read our proprietary file format. Our  
files are karyotyping files that contain zipped up TIFF files, polygon  
data describing the chromosome boundaries and various other metrics.

So far I can load the image files and I'm adding the list of polygon  
boundaries as PolygonRoi's to the ROIManager. However, if I use our  
plugin to load a s second karyotype file, then I have either to append  
to, or replace the contents of the ROIManager. I'd prefer to associate  
the list of PolygonRoi's with the image.

So how best to do this?

Subclassing the ImagePlus might work, but I'm not a fan of type  
casting; I suspect that it would have gotchas like having ImageJ's  
"Duplicate" command lose the additional information.

Is there any other robust means of augmenting an image with additional  
information?

Michael Ellis
Managing Director
Digital Scientific UK Ltd.
http://www.digitalscientific.co.uk
[hidden email]
tel: +44(0)1223 329993
fax: +44(0)1223 370040

Sheraton House
Castle Park
Cambridge
CB3 0AX


The contents of this e-mail may be privileged and are confidential.  
It may not be disclosed to or used by anyone other than the  
addressee(s), nor copied in any way.  If received in error, please  
advise the sender and delete it from your system.
Reply | Threaded
Open this post in threaded view
|

Antwort: Augmenting an ImagePlus with Additional Information

Joachim Wesner
Hi,

I have/had the same problem to read some proprietary Tiff files with extra
tags whose info should be available later in ImageJ.

You can use ImagePlus´ getProperty/setProperty to do this, but I am not
sure if these properties will survive duplication
(actually I fear they will not), it was not yet important for me! (I also
wrote a macro helper function to read these properties)

Cheers.

Mit freundlichen Grüßen / Best regards

Joachim Wesner
www.leica-microsystems.com



                                                                           
             Michael Ellis                                                
             <michael.ellis@DI                                            
             GITALSCIENTIFIC.C                                          An
             O.UK>                      [hidden email]                
             Gesendet von:                                           Kopie
             ImageJ Interest                                              
             Group                                                   Thema
             <[hidden email].          Augmenting an ImagePlus with      
             GOV>                       Additional Information            
                                                                           
                                                                           
             22.02.2010 18:21                                              
                                                                           
                                                                           
              Bitte antworten                                              
                    an                                                    
              ImageJ Interest                                              
                   Group                                                  
             <[hidden email].                                            
                   GOV>                                                    
                                                                           
                                                                           




Augmenting an ImagePlus with Additional Information

I am writing an ImageJ plugin to read our proprietary file format. Our
files are karyotyping files that contain zipped up TIFF files, polygon
data describing the chromosome boundaries and various other metrics.

So far I can load the image files and I'm adding the list of polygon
boundaries as PolygonRoi's to the ROIManager. However, if I use our
plugin to load a s second karyotype file, then I have either to append
to, or replace the contents of the ROIManager. I'd prefer to associate
the list of PolygonRoi's with the image.

So how best to do this?

Subclassing the ImagePlus might work, but I'm not a fan of type
casting; I suspect that it would have gotchas like having ImageJ's
"Duplicate" command lose the additional information.

Is there any other robust means of augmenting an image with additional
information?

Michael Ellis
Managing Director
Digital Scientific UK Ltd.
http://www.digitalscientific.co.uk
[hidden email]
tel: +44(0)1223 329993
fax: +44(0)1223 370040

Sheraton House
Castle Park
Cambridge
CB3 0AX


The contents of this e-mail may be privileged and are confidential.
It may not be disclosed to or used by anyone other than the
addressee(s), nor copied in any way.  If received in error, please
advise the sender and delete it from your system.



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Augmenting an ImagePlus with Additional Information

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Michael Ellis
On Feb 22, 2010, at 12:21 PM, Michael Ellis <[hidden email]
 > wrote:

> Augmenting an ImagePlus with Additional Information
>
> I am writing an ImageJ plugin to read our proprietary file format. Our
> files are karyotyping files that contain zipped up TIFF files, polygon
> data describing the chromosome boundaries and various other metrics.
>
> So far I can load the image files and I'm adding the list of polygon
> boundaries as PolygonRoi's to the ROIManager. However, if I use our
> plugin to load a s second karyotype file, then I have either to append
> to, or replace the contents of the ROIManager. I'd prefer to associate
> the list of PolygonRoi's with the image.
>
> So how best to do this?
>
> Subclassing the ImagePlus might work, but I'm not a fan of type
> casting; I suspect that it would have gotchas like having ImageJ's
> "Duplicate" command lose the additional information.
>
> Is there any other robust means of augmenting an image with additional
> information?

Add the polygon boundaries to the image as an overlay (requires  
v1.43). Overlays can be transferred to the ROI Manager, easily  
retrieved using ImagePlus.getOverlay(), and they are saved with the  
image when saving in TIFF format. The Duplicate command will preserve  
overlays in the next daily build.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Augmenting an ImagePlus with Additional Information

Michael Ellis
In reply to this post by Joachim Wesner
Joachim, hi

On 22 Feb 2010, at 18:43, Joachim Wesner wrote:

> Hi,
>
> I have/had the same problem to read some proprietary Tiff files with  
> extra
> tags whose info should be available later in ImageJ.
>
> You can use ImagePlus´ getProperty/setProperty to do this, but I am  
> not
> sure if these properties will survive duplication

I just stumbled upon the getProperty/setProperty and wrote a plugin to  
test this. I can verify that any properties you do NOT survive image  
duplication. Shame that image duplication does not clone the  
properties, perhaps there is some good reason for this though?


> (actually I fear they will not), it was not yet important for me! (I  
> also
> wrote a macro helper function to read these properties)

>
> Cheers.
>
> Mit freundlichen Grüßen / Best regards
>
> Joachim Wesner
> www.leica-microsystems.com

Best regards -- Michael Ellis
Reply | Threaded
Open this post in threaded view
|

Re: Augmenting an ImagePlus with Additional Information

Michael Ellis
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
Wayne, thanks, I look into that (possibly tonight).

A couple of questions:

- All the individual polygons (one for each chromosome) need to be  
individually accessible, does the overlay allow for multiple  
individually accessible polygons?

- I also have other metrics that needs to be "taken care of"; the  
chromosome angle of rotation, centromere position and other such bits  
and bytes, any ideas?

P.S. I greatly appreciate the amazing work and your impressively  
timely replies queries on this forum.

Regards -- Michael Ellis


On 22 Feb 2010, at 18:50, Rasband Wayne wrote:

> On Feb 22, 2010, at 12:21 PM, Michael Ellis <[hidden email]
> > wrote:
>
>> Augmenting an ImagePlus with Additional Information
>>
>> I am writing an ImageJ plugin to read our proprietary file format.  
>> Our
>> files are karyotyping files that contain zipped up TIFF files,  
>> polygon
>> data describing the chromosome boundaries and various other metrics.
>>
>> So far I can load the image files and I'm adding the list of polygon
>> boundaries as PolygonRoi's to the ROIManager. However, if I use our
>> plugin to load a s second karyotype file, then I have either to  
>> append
>> to, or replace the contents of the ROIManager. I'd prefer to  
>> associate
>> the list of PolygonRoi's with the image.
>>
>> So how best to do this?
>>
>> Subclassing the ImagePlus might work, but I'm not a fan of type
>> casting; I suspect that it would have gotchas like having ImageJ's
>> "Duplicate" command lose the additional information.
>>
>> Is there any other robust means of augmenting an image with  
>> additional
>> information?
>
> Add the polygon boundaries to the image as an overlay (requires  
> v1.43). Overlays can be transferred to the ROI Manager, easily  
> retrieved using ImagePlus.getOverlay(), and they are saved with the  
> image when saving in TIFF format. The Duplicate command will  
> preserve overlays in the next daily build.
>
> -wayne

Michael Ellis
Managing Director
Digital Scientific UK Ltd.
http://www.digitalscientific.co.uk
[hidden email]
tel: +44(0)1223 329993
fax: +44(0)1223 370040

Sheraton House
Castle Park
Cambridge
CB3 0AX


The contents of this e-mail may be privileged and are confidential.  
It may not be disclosed to or used by anyone other than the  
addressee(s), nor copied in any way.  If received in error, please  
advise the sender and delete it from your system.
Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Augmenting an ImagePlus with Additional Information

Joachim Wesner
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
Hi Wayne,

>Add the polygon boundaries to the image as an overlay (requires
>v1.43). Overlays can be transferred to the ROI Manager, easily
>retrieved using ImagePlus.getOverlay(), and they are saved with the
>image when saving in TIFF format. The Duplicate command will preserve
>overlays in the next daily build.

This is good news (I must have missed this :-( ), so there is finally a
standardized way to save the
ROI with the Tiff data! I was looking for this already for some time!

Joachim Wesner
Projektleiter Optik Technologiesysteme

www.leica-microsystems.com


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Antwort: Augmenting an ImagePlus with Additional Information

Joachim Wesner
In reply to this post by Michael Ellis
>I just stumbled upon the getProperty/setProperty and wrote a plugin to
>test this. I can verify that any properties you do NOT survive image
>duplication. Shame that image duplication does not clone the
>properties, perhaps there is some good reason for this though?

I think one should not blame ImageJ developers for this, AFAIK the usual
approach is to only
do what is "save", it is generally nontrivial to duplicate an arbitrary
composed object, there is
no "correct" way to do this (Shallow copy vs. Deep copy etc.), without
knowing how the copy
will be used later, see the discussions about cloning in Java.

Mit freundlichen Grüßen / Best regards

www.leica-microsystems.com


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Re: Antwort: Augmenting an ImagePlus with Additional Information

Michael Ellis
Joachim,

Oh no blame! Imagej is the best thing since sliced bread for a million  
reasons.

And yes, duplication (and persistence) of composite object data is a  
non trivial. We've used a variety of approached in our own products  
over the years.

Anyway, cannot complain (as you say), within a day I've been able to  
write the bare bones of a plugin that can read our kartotype files  
that contain arbitrary multiplane and multi(overlapping)frame images  
and load up the chromosome boundaries into the ROI manager. Imagine  
doing all that from scratch without ImageJ -- no siree no blame or  
complaints from over here!

Regards -- Michael



On 22 Feb 2010, at 19:22, Joachim Wesner wrote:

>> I just stumbled upon the getProperty/setProperty and wrote a plugin  
>> to
>> test this. I can verify that any properties you do NOT survive image
>> duplication. Shame that image duplication does not clone the
>> properties, perhaps there is some good reason for this though?
>
> I think one should not blame ImageJ developers for this, AFAIK the  
> usual
> approach is to only
> do what is "save", it is generally nontrivial to duplicate an  
> arbitrary
> composed object, there is
> no "correct" way to do this (Shallow copy vs. Deep copy etc.), without
> knowing how the copy
> will be used later, see the discussions about cloning in Java.
>
> Mit freundlichen Grüßen / Best regards
>
> www.leica-microsystems.com
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________

Michael Ellis
Managing Director
Digital Scientific UK Ltd.
http://www.digitalscientific.co.uk
[hidden email]
tel: +44(0)1223 329993
fax: +44(0)1223 370040

Sheraton House
Castle Park
Cambridge
CB3 0AX


The contents of this e-mail may be privileged and are confidential.  
It may not be disclosed to or used by anyone other than the  
addressee(s), nor copied in any way.  If received in error, please  
advise the sender and delete it from your system.
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Augmenting an ImagePlus with Additional Information

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Michael Ellis
On Feb 22, 2010, at 1:56 PM, Michael Ellis wrote:

> Joachim, hi
>
> On 22 Feb 2010, at 18:43, Joachim Wesner wrote:
>
>> Hi,
>>
>> I have/had the same problem to read some proprietary Tiff files with  
>> extra
>> tags whose info should be available later in ImageJ.
>>
>> You can use ImagePlus´ getProperty/setProperty to do this, but I am  
>> not
>> sure if these properties will survive duplication
>
> I just stumbled upon the getProperty/setProperty and wrote a plugin to  
> test this. I can verify that any properties you do NOT survive image  
> duplication. Shame that image duplication does not clone the  
> properties, perhaps there is some good reason for this though?

The "Info" image property (a String) does survive image duplication. It is also preserved when the image is saved in TIFF format.

-wayne


> (actually I fear they will not), it was not yet important for me! (I  
>> also
>> wrote a macro helper function to read these properties)
>
>>
>> Cheers.
>>
>> Mit freundlichen Grüßen / Best regards
>>
>> Joachim Wesner
>> www.leica-microsystems.com
>
> Best regards -- Michael Ellis