visad.data.tiff
Class LegacyTiffForm

java.lang.Object
  extended by visad.data.FormNode
      extended by visad.data.Form
          extended by visad.data.tiff.LegacyTiffForm
All Implemented Interfaces:
FormBlockReader, FormFileInformer, FormProgressInformer

Deprecated. Use TiffForm, or visad.data.bio.LociForm with loci.formats.in.TiffReader and loci.formats.out.TiffWriter

public class LegacyTiffForm
extends Form
implements FormFileInformer, FormBlockReader, FormProgressInformer

LegacyTiffForm is the old VisAD data form for the TIFF file format. It relies on either ImageJ or JAI being available in the class path, and is very inefficient when dealing with large multi-page TIFF files. The following table indicates features that the form supports:

  uncompressed compressed (LZW)
single image read and write read only (with JAI)
multi-page read and write read only (with JAI)

This form requires ImageJ, available from the ImageJ web site. Note that features marked with "(with JAI)" also require the Java Advanced Imaging (JAI) package, available at Sun's Java Advanced Imaging web site. Also, no support for reading TIFF data from URLs is provided. However, the visad.data.jai package provides limited support for importing single-image TIFF data from a URL.


Field Summary
 
Fields inherited from class visad.data.Form
mathType
 
Constructor Summary
LegacyTiffForm()
          Deprecated. Constructs a new TIFF file form.
 
Method Summary
 void add(String id, Data data, boolean replace)
          Deprecated. Adds data to an existing TIFF file.
 void close()
          Deprecated. Closes any open files.
 int getBlockCount(String id)
          Deprecated. Determines the number of blocks in the given file.
 String[] getDefaultSuffixes()
          Deprecated. Returns the default file SUFFIXES for the TIFF file format.
 FormNode getForms(Data data)
          Deprecated. Return the data forms that are compatible with a data object.
 double getPercentComplete()
          Deprecated. Get the percentage complete of the form's current operation.
 boolean isThisType(byte[] block)
          Deprecated. Checks if the given block is a valid header for a TIFF file.
 boolean isThisType(String name)
          Deprecated. Checks if the given string is a valid filename for a TIFF file.
static void main(String[] args)
          Deprecated. Run 'java visad.data.visad.LegacyTiffForm in_file out_file' to convert in_file to out_file in TIFF data format.
 DataImpl open(String id)
          Deprecated. Opens an existing TIFF file from the given filename.
 DataImpl open(String id, int block_number)
          Deprecated. Obtains the specified block from the given file.
 DataImpl open(URL url)
          Deprecated. Opens an existing TIFF file from the given URL.
 void save(String id, Data data, boolean replace)
          Deprecated. Saves a VisAD Data object to an uncompressed TIFF file.
 
Methods inherited from class visad.data.Form
getMathType
 
Methods inherited from class visad.data.FormNode
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyTiffForm

public LegacyTiffForm()
Deprecated. 
Constructs a new TIFF file form.

Method Detail

isThisType

public boolean isThisType(String name)
Deprecated. 
Checks if the given string is a valid filename for a TIFF file.

Specified by:
isThisType in interface FormFileInformer
Parameters:
name - name of the file
Returns:
true if the name is right for this type of form

isThisType

public boolean isThisType(byte[] block)
Deprecated. 
Checks if the given block is a valid header for a TIFF file.

Specified by:
isThisType in interface FormFileInformer
Parameters:
block - block of bytes from file
Returns:
true if the magic number is right

getDefaultSuffixes

public String[] getDefaultSuffixes()
Deprecated. 
Returns the default file SUFFIXES for the TIFF file format.

Specified by:
getDefaultSuffixes in interface FormFileInformer
Returns:
array of suffixes

save

public void save(String id,
                 Data data,
                 boolean replace)
          throws BadFormException,
                 IOException,
                 RemoteException,
                 VisADException
Deprecated. 
Saves a VisAD Data object to an uncompressed TIFF file.

Specified by:
save in class FormNode
Parameters:
id - Filename of TIFF file to save.
data - VisAD Data to convert to TIFF format.
replace - Whether to overwrite an existing file.
Throws:
BadFormException
IOException
RemoteException
VisADException

add

public void add(String id,
                Data data,
                boolean replace)
         throws BadFormException
Deprecated. 
Adds data to an existing TIFF file.

Specified by:
add in class FormNode
Throws:
BadFormException - Always thrown (method is not implemented).

open

public DataImpl open(String id)
              throws BadFormException,
                     IOException,
                     VisADException
Deprecated. 
Opens an existing TIFF file from the given filename.

Specified by:
open in class FormNode
Returns:
VisAD Data object containing TIFF data.
Throws:
BadFormException
IOException
VisADException

open

public DataImpl open(URL url)
              throws BadFormException,
                     IOException,
                     VisADException
Deprecated. 
Opens an existing TIFF file from the given URL.

Specified by:
open in class FormNode
Returns:
VisAD Data object containing TIFF data.
Throws:
BadFormException - Always thrown (method is not implemented).
IOException
VisADException

getForms

public FormNode getForms(Data data)
Deprecated. 
Description copied from class: FormNode
Return the data forms that are compatible with a data object.

Specified by:
getForms in class FormNode

open

public DataImpl open(String id,
                     int block_number)
              throws BadFormException,
                     IOException,
                     VisADException
Deprecated. 
Description copied from interface: FormBlockReader
Obtains the specified block from the given file.

Specified by:
open in interface FormBlockReader
Parameters:
id - The file from which to load data blocks.
block_number - The block number of the block to load.
Throws:
VisADException - If the block number is invalid.
BadFormException
IOException

getBlockCount

public int getBlockCount(String id)
                  throws BadFormException,
                         IOException,
                         VisADException
Deprecated. 
Description copied from interface: FormBlockReader
Determines the number of blocks in the given file.

Specified by:
getBlockCount in interface FormBlockReader
Parameters:
id - The file for which to get a block count.
Throws:
BadFormException
IOException
VisADException

close

public void close()
           throws BadFormException,
                  IOException,
                  VisADException
Deprecated. 
Description copied from interface: FormBlockReader
Closes any open files.

Specified by:
close in interface FormBlockReader
Throws:
BadFormException
IOException
VisADException

getPercentComplete

public double getPercentComplete()
Deprecated. 
Description copied from interface: FormProgressInformer
Get the percentage complete of the form's current operation.

Specified by:
getPercentComplete in interface FormProgressInformer
Returns:
The percentage complete (0.0 - 100.0), or Double.NaN if no operation is currently taking place.

main

public static void main(String[] args)
                 throws VisADException,
                        RemoteException,
                        IOException
Deprecated. 
Run 'java visad.data.visad.LegacyTiffForm in_file out_file' to convert in_file to out_file in TIFF data format.

Throws:
VisADException
RemoteException
IOException