#File clitkRTStructStatistics.ggo
package "clitkRTStructStatistics"
-version "2.0"
-purpose "Find the centroid/roundness of a binarized image."
+version "2.0"
+purpose "Find the centroid and roundness of a binarized image."
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
-option "input" i "Input image filename (mask)" string yes
+option "input" i "Input image filename (mask)" string yes
/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Authors belong to:
+ Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
* @author Thomas Baudier <thomas.baudier@creatis.insa-lyon.fr>
* @date 11 Jul 2016 08:37:53
- * @brief
+ * @brief
-------------------------------------------------------------------*/
// clitk include
//--------------------------------------------------------------------
namespace clitk {
-
+
template<class args_info_type>
class ITK_EXPORT RTStructStatisticsGenericFilter:
public clitk::ImageToImageGenericFilter<RTStructStatisticsGenericFilter<args_info_type> > {
-
+
public:
-
- // Constructor
+
+ // Constructor
RTStructStatisticsGenericFilter ();
// Types
// New
itkNewMacro(Self);
-
-
-
+
+
+
//--------------------------------------------------------------------
void SetArgsInfo(const args_info_type & a);
//--------------------------------------------------------------------
// Main function called each time the filter is updated
- template<class InputImageType>
+ template<class InputImageType>
void UpdateWithInputImageType();
- protected:
- template<unsigned int Dim> void InitializeImageType();
+ protected:
+ template<unsigned int Dim> void InitializeImageType();
args_info_type mArgsInfo;
}; // end class RTStructStatisticsGenericFilter
} // end namespace
//--------------------------------------------------------------------
-
+
#ifndef ITK_MANUAL_INSTANTIATION
#include "clitkRTStructStatisticsGenericFilter.txx"
#endif
// Set value
this->SetIOVerbose(mArgsInfo.verbose_flag);
-
+
if (mArgsInfo.input_given) this->AddInputFilename(mArgsInfo.input_arg);
-
+
}
//--------------------------------------------------------------------
typedef itk::LabelMap< ShapeLabelObjectType > LabelMapType;
typedef itk::ConnectedComponentImageFilter <MaskInputImageType, OutputImageType > ConnectedComponentImageFilterType;
typedef itk::LabelImageToShapeLabelMapFilter< OutputImageType, LabelMapType> I2LType;
-
+
typename ConnectedComponentImageFilterType::Pointer connected = ConnectedComponentImageFilterType::New ();
connected->SetInput(mask);
connected->FullyConnectedOn();
connected->Update();
-
+
//Create a map to contain all connectedComponent (even a little pixel)
typename I2LType::Pointer i2l = I2LType::New();
i2l->SetInput( connected->GetOutput() );
i2l->SetComputePerimeter(true);
i2l->Update();
-
+
// Retrieve the biggest component
LabelMapType *labelMap = i2l->GetOutput();
int largestComponent(0);
if (labelObject->GetNumberOfPixels() > nbPixel)
{
nbPixel = labelObject->GetNumberOfPixels();
- largestComponent = n;
+ largestComponent = n;
}
}
-
+
//Write statitistics on the largest component
ShapeLabelObjectType *labelObject = labelMap->GetNthLabelObject(largestComponent);
std::cout << " Centroid: " << std::endl;
#File clitkSUVPeak.ggo
package "clitkSUVPeak"
version "2.0"
-#This tool supports multiple images on the input, or even 4D, but all images must be of the same type and dimensions.
+#This tool supports multiple images on the input, or even 4D, but all images must be of the same type and dimensions.
purpose "Compute statistics on an image, or on part of an image specified by a mask and label(s). The tool also supports multichannel images, which is useful, e.g., for vector fields. All channels are processed (separately) by default, but only one channel may be chosen."
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
-option "input" i "Input first image filename" string yes
-option "mask" m "Mask image filename (uchar)" string no
+option "input" i "Input first image filename" string yes
+option "mask" m "Mask image filename (uchar)" string no
/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Authors belong to:
+ Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
* @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
* @date 23 Feb 2008 08:37:53
- * @brief
+ * @brief
-------------------------------------------------------------------*/
// clitk include
//--------------------------------------------------------------------
namespace clitk {
-
+
template<class args_info_type>
class ITK_EXPORT SUVPeakGenericFilter:
public clitk::ImageToImageGenericFilter<SUVPeakGenericFilter<args_info_type> > {
-
+
public:
-
- // Constructor
+
+ // Constructor
SUVPeakGenericFilter ();
// Types
// New
itkNewMacro(Self);
-
-
-
+
+
+
//--------------------------------------------------------------------
void SetArgsInfo(const args_info_type & a);
//--------------------------------------------------------------------
// Main function called each time the filter is updated
- template<class InputImageType>
+ template<class InputImageType>
void UpdateWithInputImageType();
- protected:
- template<unsigned int Dim> void InitializeImageType();
+ protected:
+ template<unsigned int Dim> void InitializeImageType();
args_info_type mArgsInfo;
}; // end class SUVPeakGenericFilter
} // end namespace
//--------------------------------------------------------------------
-
+
#ifndef ITK_MANUAL_INSTANTIATION
#include "clitkSUVPeakGenericFilter.txx"
#endif
// Set value
this->SetIOVerbose(mArgsInfo.verbose_flag);
-
+
if (mArgsInfo.input_given) this->AddInputFilename(mArgsInfo.input_arg);
-
+
if (mArgsInfo.mask_given) this->AddInputFilename(mArgsInfo.mask_arg);
}
//--------------------------------------------------------------------
double volume = 1000; //1 cc into mc
const double PI = 3.141592653589793238463;
double radius = std::pow(3*volume/(4*PI),1./3);
-
+
typename ImageType::Pointer kernel = ComputeMeanFilterKernel<ImageType>(input->GetSpacing(), radius);
// Perform the convolution
filter->SetKernelImage(kernel);
filter->Update();
typename ImageType::Pointer output = filter->GetOutput();
-
-
+
+
typedef itk::ImageRegionConstIteratorWithIndex<ImageType> IteratorType;
typedef itk::ImageRegionConstIteratorWithIndex<MaskImageType> MIteratorType;
IteratorType iters(output, output->GetLargestPossibleRegion());
//--------------------------------------------------------------------
template<class args_info_type>
template<class ImageType>
-typename ImageType::Pointer
+typename ImageType::Pointer
SUVPeakGenericFilter<args_info_type>::ComputeMeanFilterKernel(const typename ImageType::SpacingType & spacing, double radius)
{
// Some kind of cache to speed up a bit