loci.formats
Class AxisGuesser

java.lang.Object
  extended by loci.formats.AxisGuesser

public class AxisGuesser
extends Object

AxisGuesser guesses which blocks in a file pattern correspond to which dimensional axes (Z, T or C), potentially recommending an adjustment in dimension order within the files, depending on the confidence of each guess.

Source code:
Trac, SVN

Author:
Curtis Rueden ctrueden at wisc.edu

Field Summary
protected  int[] axisTypes
          Guessed axis types.
protected static String[] C
          Prefix endings indicating channel dimension.
static int C_AXIS
          Axis type for channels.
protected  boolean certain
          Whether the guesser is confident that all axis types are correct.
protected  String dimOrder
          Original ordering of internal dimensional axes.
protected  FilePattern fp
          File pattern identifying dimensional axis blocks.
protected  String newOrder
          Adjusted ordering of internal dimensional axes.
protected static String[] T
          Prefix endings indicating time dimension.
static int T_AXIS
          Axis type for time points.
protected static BigInteger THREE
           
protected static BigInteger TWO
           
static int UNKNOWN_AXIS
          Axis type for unclassified axes.
protected static String[] Z
          Prefix endings indicating space dimension.
static int Z_AXIS
          Axis type for focal planes.
 
Constructor Summary
AxisGuesser(FilePattern fp, String dimOrder, int sizeZ, int sizeT, int sizeC, boolean isCertain)
          Guesses dimensional axis assignments corresponding to the given file pattern, using the specified dimensional information from within each file as a guide.
 
Method Summary
 String getAdjustedOrder()
          Gets the adjusted dimension order.
 int getAxisCount(int axisType)
          Gets the number of axes in the pattern of the given type.
 int getAxisCountC()
          Gets the number of C axes in the pattern.
 int getAxisCountT()
          Gets the number of T axes in the pattern.
 int getAxisCountZ()
          Gets the number of Z axes in the pattern.
 int[] getAxisTypes()
          Gets the guessed axis type for each dimensional block.
 FilePattern getFilePattern()
          Gets the file pattern.
 String getOriginalOrder()
          Gets the original dimension order.
 boolean isCertain()
          Gets whether the guesser is confident that all axes are correct.
static void main(String[] args)
          Method for testing pattern guessing logic.
 void setAxisTypes(int[] axes)
          Sets the axis type for each dimensional block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_AXIS

public static final int UNKNOWN_AXIS
Axis type for unclassified axes.

See Also:
Constant Field Values

Z_AXIS

public static final int Z_AXIS
Axis type for focal planes.

See Also:
Constant Field Values

T_AXIS

public static final int T_AXIS
Axis type for time points.

See Also:
Constant Field Values

C_AXIS

public static final int C_AXIS
Axis type for channels.

See Also:
Constant Field Values

Z

protected static final String[] Z
Prefix endings indicating space dimension.


T

protected static final String[] T
Prefix endings indicating time dimension.


C

protected static final String[] C
Prefix endings indicating channel dimension.


TWO

protected static final BigInteger TWO

THREE

protected static final BigInteger THREE

fp

protected FilePattern fp
File pattern identifying dimensional axis blocks.


dimOrder

protected String dimOrder
Original ordering of internal dimensional axes.


newOrder

protected String newOrder
Adjusted ordering of internal dimensional axes.


axisTypes

protected int[] axisTypes
Guessed axis types.


certain

protected boolean certain
Whether the guesser is confident that all axis types are correct.

Constructor Detail

AxisGuesser

public AxisGuesser(FilePattern fp,
                   String dimOrder,
                   int sizeZ,
                   int sizeT,
                   int sizeC,
                   boolean isCertain)
Guesses dimensional axis assignments corresponding to the given file pattern, using the specified dimensional information from within each file as a guide.

Parameters:
fp - The file pattern of the files
dimOrder - The dimension order (e.g., XYZTC) within each file
sizeZ - The number of Z positions within each file
sizeT - The number of T positions within each file
sizeC - The number of C positions within each file
isCertain - Whether the dimension order given is known to be good, or merely a guess
See Also:
FilePattern
Method Detail

getFilePattern

public FilePattern getFilePattern()
Gets the file pattern.


getOriginalOrder

public String getOriginalOrder()
Gets the original dimension order.


getAdjustedOrder

public String getAdjustedOrder()
Gets the adjusted dimension order.


isCertain

public boolean isCertain()
Gets whether the guesser is confident that all axes are correct.


getAxisTypes

public int[] getAxisTypes()
Gets the guessed axis type for each dimensional block.

Returns:
An array containing values from the enumeration:
  • Z_AXIS: focal planes
  • T_AXIS: time points
  • C_AXIS: channels

setAxisTypes

public void setAxisTypes(int[] axes)
Sets the axis type for each dimensional block.

Parameters:
axes - An array containing values from the enumeration:
  • Z_AXIS: focal planes
  • T_AXIS: time points
  • C_AXIS: channels

getAxisCountZ

public int getAxisCountZ()
Gets the number of Z axes in the pattern.


getAxisCountT

public int getAxisCountT()
Gets the number of T axes in the pattern.


getAxisCountC

public int getAxisCountC()
Gets the number of C axes in the pattern.


getAxisCount

public int getAxisCount(int axisType)
Gets the number of axes in the pattern of the given type.

Parameters:
axisType - One of:
  • Z_AXIS: focal planes
  • T_AXIS: time points
  • C_AXIS: channels

main

public static void main(String[] args)
                 throws FormatException,
                        IOException
Method for testing pattern guessing logic.

Throws:
FormatException
IOException