image IO by plugin

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

image IO by plugin

Lothar Leidner
Hello,

I've written  two plugin classes for Sensicam (PCO) image IO (image
format .b16).

When I try to save an image which has been loaded by the ReadB16 plugin
the corresponding FileInfo object "forgets" some of its settings. Image
dimensions are kept. Byte order and header size settings are lost and
had to be redefined ("corrections" in the sourec excerpt). The only
manipulation I've performed with the image was the application of a
Gauss Blur filter. As at least the header size may change when using a
different camera this is not a good solution. How can I make sure that
these data are kept?

Any hints appreciated,

Lothar Leidner


        ImagePlus imp = WindowManager.getCurrentImage();
        ...

        FileInfo fi = imp.getFileInfo();
        // Corrections
        fi.intelByteOrder = true;
        fi.offset = 384;

--
===============================================
Lothar Leidner
Institute of Theoretical and Physical Chemistry
University of Tuebingen
Auf der Morgenstelle 18
D-72076 Tübingen
E-Mail: [hidden email]
Phone: +49-7071-29-72651
Reply | Threaded
Open this post in threaded view
|

Antwort: image IO by plugin

Joachim Wesner
HI Lothar,

as I understand the "philosophy" behind ImageJ, there is no permanent
connection between a Fileinfo object and the image loaded via that object
(I would even think that would cause quite a number of problems in many
cases).  The FileInfo object is obsolete as soon as the image has been
loaded. Image dimensions are kept because these are properties of the image
(ImageProcessor etc.) itself.
You can later change the image properties via the usual ImageJ commands,
but these do not act back on any remembered FilInfo object.

However, what you could do is add special custom properties to the loaded
image and create the corresponding FileInfo object anew when saving, along
these lines....

Mit freundlichen Grüßen / Best regards

Joachim Wesner
Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht
Wetzlar  HRB 2432
Geschäftsführer:  Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy
Martyr | Colin Davis


                                                                           
             Lothar Leidner                                                
             <lothar.leidner@I                                            
             PC.UNI-TUEBINGEN.                                          An
             DE>                        [hidden email]                
             Gesendet von:                                           Kopie
             ImageJ Interest                                              
             Group                                                   Thema
             <[hidden email].          image IO by plugin                
             GOV>                                                          
                                                                           
                                                                           
             03.04.2009 15:01                                              
                                                                           
                                                                           
              Bitte antworten                                              
                    an                                                    
              ImageJ Interest                                              
                   Group                                                  
             <[hidden email].                                            
                   GOV>                                                    
                                                                           
                                                                           




Hello,

I've written  two plugin classes for Sensicam (PCO) image IO (image
format .b16).

When I try to save an image which has been loaded by the ReadB16 plugin
the corresponding FileInfo object "forgets" some of its settings. Image
dimensions are kept. Byte order and header size settings are lost and
had to be redefined ("corrections" in the sourec excerpt). The only
manipulation I've performed with the image was the application of a
Gauss Blur filter. As at least the header size may change when using a
different camera this is not a good solution. How can I make sure that
these data are kept?

Any hints appreciated,

Lothar Leidner


        ImagePlus imp = WindowManager.getCurrentImage();
        ...

        FileInfo fi = imp.getFileInfo();
        // Corrections
        fi.intelByteOrder = true;
        fi.offset = 384;

--
===============================================
Lothar Leidner
Institute of Theoretical and Physical Chemistry
University of Tuebingen
Auf der Morgenstelle 18
D-72076 Tübingen
E-Mail: [hidden email]
Phone: +49-7071-29-72651



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________