Enum Class MostLikePlane
- All Implemented Interfaces:
Serializable, Comparable<MostLikePlane>, Constable
The radiological names that can be used to describe the approximate orientation of
a scan plane.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTheMostLikePlanecorresponding to an axial orientation.TheMostLikePlanecorresponding to a coronal orientation.TheMostLikePlanecorresponding to a sagittal orientation.TheMostLikePlanefor an unknown orientation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.cli.OptionAn Option to specify the (approximate) orientation of an input image. -
Method Summary
Modifier and TypeMethodDescriptionorg.jogamp.vecmath.Vector3f[]Returns the image orientation in patient coordinates for an image plane which is exactly in thisMostLikePlane.static MostLikePlanegetInstance(float[][] imageOrientationPatient) Returns theMostLikePlanecorresponding to the image orientation in patient coordinates.static MostLikePlanegetInstance(ReadableImage image) Returns theMostLikePlaneof an image.static MostLikePlaneReturns aMostLikePlanecorresponding to a string.static MostLikePlanegetInstance(org.jogamp.vecmath.Vector3f[] imageOrientationPatient) Returns theMostLikePlanecorresponding to the image orientation in patient coordinates.static MostLikePlaneGuesses the image orientation using just the image pixel values.static AffineTransform3DgetTransform(MostLikePlane toPlane, MostLikePlane fromPlane) Returns aAffineTransform3Dthat will transform locations in one plane to locations in another plane.static AffineTransform3DgetTransformTo(MostLikePlane toPlane, MostLikePlane fromPlane) Returns an AffineTransform3D that will approximately transform the row/column/slice direction cosines of an image plane (in patient coordinates) to the supplied orientation.static AffineTransform3DgetTransformTo(ReadableImage image, MostLikePlane fromPlane) Returns an AffineTransform3D that will approximately transform the row/column/slice direction cosines of an image plane (in patient coordinates) to the orientation of the supplied image.static voidRuns the unit test on this class.static MostLikePlaneselectPlane(Component parentComponent) Shows a dialog prompting the user to select a scan plane.toString()Returns aStringdescribing thisMostLikePlane.static MostLikePlaneReturns the enum constant of this class with the specified name.static MostLikePlane[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
UNKNOWN
TheMostLikePlanefor an unknown orientation. -
AXIAL
TheMostLikePlanecorresponding to an axial orientation. -
SAGITTAL
TheMostLikePlanecorresponding to a sagittal orientation. -
CORONAL
TheMostLikePlanecorresponding to a coronal orientation.
-
-
Field Details
-
OPTION
public static final org.apache.commons.cli.Option OPTIONAn Option to specify the (approximate) orientation of an input image.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
Returns aMostLikePlanecorresponding to a string.- Parameters:
s- aStringfrom which the most-like plane will be interpreted. Can be:- "unknown",
- "axial",
- "sagittal", or
- "coronal".
- Returns:
- a
MostLikePlanecorresponding to aString, orUNKNOWNif theStringis invalid. - Throws:
InvalidArgumentException- if theStringis invalid.
-
getInstance
Returns theMostLikePlaneof an image.- Parameters:
image- the image for which to find the most-like plane.- Returns:
- the
MostLikePlaneof the image.UNKNOWNis returned if the image plane can't be found.
-
getInstance
Returns theMostLikePlanecorresponding to the image orientation in patient coordinates.- Parameters:
imageOrientationPatient- a 2x3 or 3x3 float[][] containing the direction cosines of the image row, column and (possibly) slice directions of the image matrix.- Returns:
- the
MostLikePlanecorresponding to the image orientation direction cosines.
-
getInstance
Returns theMostLikePlanecorresponding to the image orientation in patient coordinates.- Parameters:
imageOrientationPatient- aVector3f[] of length at least 3 containing the direction cosines of the image row, column and (possibly) slice directions of the image matrix.- Returns:
- the
MostLikePlanecorresponding to the image orientation direction cosines.
-
getImageOrientationPatient
public org.jogamp.vecmath.Vector3f[] getImageOrientationPatient()Returns the image orientation in patient coordinates for an image plane which is exactly in thisMostLikePlane.- Returns:
- the image orientation in patient coordinates, or
nullif this isUNKNOWN.
-
getTransformTo
Returns an AffineTransform3D that will approximately transform the row/column/slice direction cosines of an image plane (in patient coordinates) to the orientation of the supplied image. If no orientation information is present in the image header, then the pixel data will be examined to try to guess the orientation. However, this will only work for head images, and will give unpredictable results for the other body parts.- Parameters:
image- the image to transform to.fromPlane- the scan plane orientation to transform from.- Returns:
- the transform that will transform from the fromPlane to that of the image. Returns the identity transform if the true transform cannot be found.
-
getTransformTo
Returns an AffineTransform3D that will approximately transform the row/column/slice direction cosines of an image plane (in patient coordinates) to the supplied orientation.- Parameters:
toPlane- the scan plane orientation to transform to.fromPlane- the scan plane orientation to transform from.- Returns:
- an
AffineTransform3Dthat will transform locations in row/col/slice coordinates from row/col/slice coordinates in the fromPlane.
-
getTransform
Returns aAffineTransform3Dthat will transform locations in one plane to locations in another plane.- Parameters:
toPlane- to image plane to transform positions to.fromPlane- to image plane to transform positions from.- Returns:
- the tranform that transform locations in the fromPlane to locations in the toPlane.
-
selectPlane
Shows a dialog prompting the user to select a scan plane.- Parameters:
parentComponent- the parentComponentof the dialog.- Returns:
- the
MostLikePlaneselected by the user. - Throws:
CancelledException- if selection is cancelled by the user.
-
getMostLikePlaneFromPixelValues
Guesses the image orientation using just the image pixel values.- Parameters:
image- the image for which to guess theMostLikePlane.- Returns:
- the
MostLikePlaneguessed from the pixel values. ReturnsUNKNOWNif the orientation can't be guessed.
-
toString
Returns aStringdescribing thisMostLikePlane.- Overrides:
toStringin classEnum<MostLikePlane>- Returns:
- a
Stringdescribing thisMostLikePlane.
-
main
Runs the unit test on this class.- Parameters:
args- the program arguments ignored).
-