X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkRTStructStatisticsGenericFilter.txx;h=d83b25d9caeff24194d67af207d5a4bda60d1f8d;hb=adcb66e6659f609eab388827c24f52280253db99;hp=d658e2b7f965c49b7e307f2665db55c347793d3f;hpb=f05cc2cf37d7ec960b73fa9d2393d5a888e1f87a;p=clitk.git diff --git a/tools/clitkRTStructStatisticsGenericFilter.txx b/tools/clitkRTStructStatisticsGenericFilter.txx index d658e2b..d83b25d 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); - + } //-------------------------------------------------------------------- @@ -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,10 +101,10 @@ 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;