edu.stanford.rsl.konrad.filtering
Class CosineWeightingTool

java.lang.Object
  extended by edu.stanford.rsl.konrad.filtering.ImageFilteringTool
      extended by edu.stanford.rsl.konrad.filtering.IndividualImageFilteringTool
          extended by edu.stanford.rsl.konrad.filtering.CosineWeightingTool
All Implemented Interfaces:
Citeable, GUIConfigurable, SafeSerializable, NamedParallelizableRunnable, ParallelizableRunnable, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable

public class CosineWeightingTool
extends IndividualImageFilteringTool

Filtering tool to apply cosine weights. Weights can either be computed from six geometry parameters or loaded from an ImagePlus. Raw cosine weights are sometimes provided as calibration data from some manufacturers. Computation from the geometry parameters follows Kak & Slaney, Principles of Computerized Tomographic Imaging, 1988;

Author:
Andreas Maier
See Also:
Serialized Form

Constructor Summary
CosineWeightingTool()
           
 
Method Summary
 ij.process.ImageProcessor applyToolToProcessor(ij.process.ImageProcessor imageProcessor)
          Is called in every thread to apply the tool to an individual ImageProcessor
 IndividualImageFilteringTool clone()
          All ImageFilteringTools need to be Cloneable in order to enable multiple processor usage.
 void configure()
          Configures the object before execution
 void convertImagePlusToWeights(ij.ImagePlus image)
          uses the currentProcessor of the image to read in the cosine weights.
 ij.ImagePlus convertWeightsToImagePlus()
          creates an ImagePlus to visualize the weights.
 void generateCosineWeights()
          Computes the cosine weights as described in Kak & Slaney, Computerized Tomographic Imaging, 1988
 java.lang.String getBibtexCitation()
          Returns the citation in bibTex format
 double[][] getCosineWeigths()
           
 int getDetectorHeight()
           
 int getDetectorWidth()
           
 java.lang.String getMedlineCitation()
          Returns the citation in Medline format
 double getPixelDimensionX()
           
 double getPixelDimensionY()
           
 double getSourceToCenterOfRotationDistance()
           
 double getSourceToDetectorDistance()
           
 java.lang.String getToolName()
          returns the name of the actual tool which was used.
 boolean isDeviceDependent()
          Cosine filtering depends on the projection geometry and is hence not device depdendent.
 void prepareForSerialization()
          Sets all data objects in the serialized object to null which do not implement the Serializable interface.
 void setConfiguration(Configuration config)
           
 void setCosineWeigths(double[][] cosineWeigths)
           
 void setDetectorHeight(int detectorHeight)
           
 void setDetectorWidth(int detectorWidth)
           
 void setPixelDimensionX(double pixelDimensionX)
           
 void setPixelDimensionY(double pixelDimensionY)
           
 void setSourceToCenterOfRotationDistance(double sourceToCenterOfRotationDistance)
           
 void setSourceToDetectorDistance(double sourceToDetectorDistance)
           
 
Methods inherited from class edu.stanford.rsl.konrad.filtering.IndividualImageFilteringTool
applyToolToProcessor, getFilteredImageProcessor, getImageIndex, getProcessName, run, setImageIndex, setImageProcessor, setLatch
 
Methods inherited from class edu.stanford.rsl.konrad.filtering.ImageFilteringTool
getFilterTools, isConfigured, setConfigured, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CosineWeightingTool

public CosineWeightingTool()
Method Detail

generateCosineWeights

public void generateCosineWeights()
                           throws java.lang.Exception
Computes the cosine weights as described in Kak & Slaney, Computerized Tomographic Imaging, 1988

Throws:
java.lang.Exception - if not all parameters are set.

getCosineWeigths

public double[][] getCosineWeigths()

setCosineWeigths

public void setCosineWeigths(double[][] cosineWeigths)

getPixelDimensionX

public double getPixelDimensionX()

setPixelDimensionX

public void setPixelDimensionX(double pixelDimensionX)

getPixelDimensionY

public double getPixelDimensionY()

setPixelDimensionY

public void setPixelDimensionY(double pixelDimensionY)

getSourceToDetectorDistance

public double getSourceToDetectorDistance()

setSourceToDetectorDistance

public void setSourceToDetectorDistance(double sourceToDetectorDistance)

getDetectorWidth

public int getDetectorWidth()

setDetectorWidth

public void setDetectorWidth(int detectorWidth)

getDetectorHeight

public int getDetectorHeight()

setDetectorHeight

public void setDetectorHeight(int detectorHeight)

getSourceToCenterOfRotationDistance

public double getSourceToCenterOfRotationDistance()

setSourceToCenterOfRotationDistance

public void setSourceToCenterOfRotationDistance(double sourceToCenterOfRotationDistance)

setConfiguration

public void setConfiguration(Configuration config)

clone

public IndividualImageFilteringTool clone()
Description copied from class: IndividualImageFilteringTool
All ImageFilteringTools need to be Cloneable in order to enable multiple processor usage.

Specified by:
clone in class IndividualImageFilteringTool

getToolName

public java.lang.String getToolName()
Description copied from class: ImageFilteringTool
returns the name of the actual tool which was used.

Specified by:
getToolName in class ImageFilteringTool
Returns:
the name of the tool as string.

applyToolToProcessor

public ij.process.ImageProcessor applyToolToProcessor(ij.process.ImageProcessor imageProcessor)
                                               throws java.lang.Exception
Description copied from class: IndividualImageFilteringTool
Is called in every thread to apply the tool to an individual ImageProcessor

Specified by:
applyToolToProcessor in class IndividualImageFilteringTool
Parameters:
imageProcessor - the ImageProcessor
Returns:
the filtered instance of the ImageProcessor
Throws:
java.lang.Exception

convertWeightsToImagePlus

public ij.ImagePlus convertWeightsToImagePlus()
creates an ImagePlus to visualize the weights.

Returns:
the weights as image.

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
Overrides:
prepareForSerialization in class IndividualImageFilteringTool

convertImagePlusToWeights

public void convertImagePlusToWeights(ij.ImagePlus image)
uses the currentProcessor of the image to read in the cosine weights.

Parameters:
image - the image from which the weights are read.

configure

public void configure()
Description copied from interface: GUIConfigurable
Configures the object before execution


getBibtexCitation

public java.lang.String getBibtexCitation()
Description copied from interface: Citeable
Returns the citation in bibTex format

Returns:
citation as String

getMedlineCitation

public java.lang.String getMedlineCitation()
Description copied from interface: Citeable
Returns the citation in Medline format

Returns:
citation as String

isDeviceDependent

public boolean isDeviceDependent()
Cosine filtering depends on the projection geometry and is hence not device depdendent.

Specified by:
isDeviceDependent in class ImageFilteringTool
Returns:
true if the method is device dependent.