edu.stanford.rsl.konrad.reconstruction.voi
Class PolygonBasedVolumeOfInterest

java.lang.Object
  extended by edu.stanford.rsl.konrad.reconstruction.voi.VolumeOfInterest
      extended by edu.stanford.rsl.konrad.reconstruction.voi.PolygonBasedVolumeOfInterest
All Implemented Interfaces:
ConfigFileParser, SafeSerializable, java.io.Serializable

public class PolygonBasedVolumeOfInterest
extends VolumeOfInterest
implements ConfigFileParser, SafeSerializable

VOI based on a polygon definition which is identical for each slice. The VOI is than formed as a stack of identical polygons. Note that this method is sub-optimal for clipping as either the VOI has to be pre-computed for the whole volume or clipped against a polygon in each call of contains().

Author:
akmaier
See Also:
Serialized Form

Constructor Summary
PolygonBasedVolumeOfInterest()
           
PolygonBasedVolumeOfInterest(java.lang.String maxVOIFileName)
           
 
Method Summary
 boolean contains(double x, double y, double z)
          Tests whether a given coordinate in world coordinates is within the VOI.
 boolean getSuccess()
          is true if the reading was successful.
 void prepareForSerialization()
          Sets all data objects in the serialized object to null which do not implement the Serializable interface.
 void readConfigFile(java.lang.String filename)
          Reads the configuration from the file denoted by filename
 
Methods inherited from class edu.stanford.rsl.konrad.reconstruction.voi.VolumeOfInterest
getVolumes, openAsVolume
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonBasedVolumeOfInterest

public PolygonBasedVolumeOfInterest()

PolygonBasedVolumeOfInterest

public PolygonBasedVolumeOfInterest(java.lang.String maxVOIFileName)
                             throws java.io.IOException
Throws:
java.io.IOException
Method Detail

contains

public boolean contains(double x,
                        double y,
                        double z)
Description copied from class: VolumeOfInterest
Tests whether a given coordinate in world coordinates is within the VOI.

Specified by:
contains in class VolumeOfInterest
Parameters:
x - world coordinate x
y - world coordinate y
z - world coordinate z
Returns:
true, if the coordinate is insider the VOI.

readConfigFile

public void readConfigFile(java.lang.String filename)
                    throws java.io.IOException
Description copied from interface: ConfigFileParser
Reads the configuration from the file denoted by filename

Specified by:
readConfigFile in interface ConfigFileParser
Parameters:
filename - the file name
Throws:
java.io.IOException - may happen during reading

getSuccess

public boolean getSuccess()
Description copied from interface: ConfigFileParser
is true if the reading was successful.

Specified by:
getSuccess in interface ConfigFileParser
Returns:
reading success?

prepareForSerialization

public void prepareForSerialization()
Description copied from interface: SafeSerializable
Sets all data objects in the serialized object to null which do not implement the Serializable interface. It can also be used to save space in the serialized form. Configuration parameters are preserved. Processing data is discarded.

Specified by:
prepareForSerialization in interface SafeSerializable