net.aerith.misao.pixy.image_loading
Class XmlImageLoader

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
        |
        +--net.aerith.misao.util.Operation
              |
              +--net.aerith.misao.pixy.image_loading.XmlImageLoader

public class XmlImageLoader
extends Operation

The XmlImageLoader is a class to load an image file recorded in the specified XML document.

It transforms the image properly as described int the XML document. It puts the FITS image data in proper order, reverses the image upside down, and rescales the SBIG ST-4/6 image.

Filters to be applied before transformation can be set.


Field Summary
protected  java.io.File file
          The image file to load.
protected  FileManager file_manager
          The file manager.
protected  java.util.Vector filter_list
          The list of filters to be applied before transformation.
protected  Format format
          The format of the image file.
protected  MonoImage image
          The loaded image.
protected  XmlInformation information
          The XML information document.
protected  XmlInstruction instruction
          The XML instruction document.
protected  boolean reversed_image
           
protected  boolean sbig_image
          True in the case of the ST-4/6 image.
protected  XmlImage xml_image
          The image file to load.
 
Fields inherited from class net.aerith.misao.util.Operation
monitor_set, stopped
 
Fields inherited from class net.aerith.misao.util.OperationObservable
observer_list
 
Constructor Summary
XmlImageLoader(XmlInformation info, FileManager file_manager)
          Constructs an XmlImageLoader with an XmlInformation.
XmlImageLoader(XmlInstruction instruction, FileManager file_manager)
          Constructs an XmlImageLoader with an XmlInstruction.
 
Method Summary
 void addFilter(Filter filter)
          Adds a filter to be applied before transformation.
 MonoImage getMonoImage()
          Gets the loaded image.
 void operate()
          Operates.
 boolean ready()
          Returns true if the operation is ready to start.
 void setFile(java.io.File file, Format format)
          Sets the file and format to read.
 
Methods inherited from class net.aerith.misao.util.Operation
addMonitor, isStopped, perform, run, stop
 
Methods inherited from class net.aerith.misao.util.OperationObservable
addObserver, deleteObserver, notifyEnd, notifyFailed, notifyStart, notifySucceeded, notifyWarned
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

xml_image

protected XmlImage xml_image
The image file to load.

reversed_image

protected boolean reversed_image

sbig_image

protected boolean sbig_image
True in the case of the ST-4/6 image.

file

protected java.io.File file
The image file to load.

format

protected Format format
The format of the image file.

instruction

protected XmlInstruction instruction
The XML instruction document.

information

protected XmlInformation information
The XML information document.

filter_list

protected java.util.Vector filter_list
The list of filters to be applied before transformation.

file_manager

protected FileManager file_manager
The file manager.

image

protected MonoImage image
The loaded image.
Constructor Detail

XmlImageLoader

public XmlImageLoader(XmlInstruction instruction,
                      FileManager file_manager)
Constructs an XmlImageLoader with an XmlInstruction.
Parameters:
instruction - the XML instruction document.
file_manager - the file manager.

XmlImageLoader

public XmlImageLoader(XmlInformation info,
                      FileManager file_manager)
Constructs an XmlImageLoader with an XmlInformation.
Parameters:
info - the XML information document.
file_manager - the file manager.
Method Detail

setFile

public void setFile(java.io.File file,
                    Format format)
Sets the file and format to read. This is for the case the image file recorded in the XML document cannot be read properly.
Parameters:
file - the image file.
format - the image format.

addFilter

public void addFilter(Filter filter)
Adds a filter to be applied before transformation.
Parameters:
filter - the filter to be applied before transformation.

getMonoImage

public MonoImage getMonoImage()
Gets the loaded image.
Returns:
the loaded image.

ready

public boolean ready()
Returns true if the operation is ready to start.
Overrides:
ready in class Operation
Returns:
true if the operation is ready to start.

operate

public void operate()
             throws java.lang.Exception
Operates.
Overrides:
operate in class Operation
Throws:
java.lang.Exception - if an error occurs.