X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkRTStructStatisticsGenericFilter.txx;h=3657b50fda32d2c900f75358704d985c484fa414;hb=5578995d9a82792833333eeb3dd5c8ecac967293;hp=9418ac529e0274c9a78e022a5ada44fb755e608a;hpb=009d76f939a3feb18b4005d0f8965863a4fbbb82;p=clitk.git diff --git a/tools/clitkRTStructStatisticsGenericFilter.txx b/tools/clitkRTStructStatisticsGenericFilter.txx index 9418ac5..3657b50 100644 --- a/tools/clitkRTStructStatisticsGenericFilter.txx +++ b/tools/clitkRTStructStatisticsGenericFilter.txx @@ -56,9 +56,9 @@ void RTStructStatisticsGenericFilter::SetArgsInfo(const args_inf // Set value this->SetIOVerbose(mArgsInfo.verbose_flag); - + if (mArgsInfo.input_given) this->AddInputFilename(mArgsInfo.input_arg); - + } //-------------------------------------------------------------------- @@ -70,7 +70,7 @@ void RTStructStatisticsGenericFilter::UpdateWithInputImageType() { // Read mask input typedef itk::Image MaskInputImageType; - typename MaskInputImageType::Pointer mask = NULL; + typename MaskInputImageType::Pointer mask; mask = this->template GetInput(0); //Create the Shape Label Map from the mask @@ -79,18 +79,18 @@ void RTStructStatisticsGenericFilter::UpdateWithInputImageType() typedef itk::LabelMap< ShapeLabelObjectType > LabelMapType; typedef itk::ConnectedComponentImageFilter 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); @@ -101,13 +101,13 @@ void RTStructStatisticsGenericFilter::UpdateWithInputImageType() 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; + std::cout << " Centroid position (mm): " << std::endl; std::cout << labelObject->GetCentroid()[0] << std::endl; std::cout << labelObject->GetCentroid()[1] << std::endl; std::cout << labelObject->GetCentroid()[2] << std::endl;