X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageStatisticsGenericFilter.txx;h=b3eff93ce1082304554c03f1a71589a41d2fa059;hb=182d324aaea3d92e8b676d8a6e609ba8fab44726;hp=32b31bc1b4ebb0571b87be599f3e9ccc2b215221;hpb=e06bbd15e271bf0a4092b673399d040a5cb25efe;p=clitk.git diff --git a/tools/clitkImageStatisticsGenericFilter.txx b/tools/clitkImageStatisticsGenericFilter.txx index 32b31bc..b3eff93 100644 --- a/tools/clitkImageStatisticsGenericFilter.txx +++ b/tools/clitkImageStatisticsGenericFilter.txx @@ -166,6 +166,7 @@ namespace clitk } else { labelImage=LabelImageType::New(); + labelImage->SetDirection(input->GetDirection()); labelImage->SetRegions(input->GetLargestPossibleRegion()); labelImage->SetOrigin(input->GetOrigin()); labelImage->SetSpacing(input->GetSpacing()); @@ -246,6 +247,8 @@ namespace clitk std::cout<GetMaximum(label)<GetSum(label)<GetCount(label)*spacing_cc<GetBoundingBox(label).size(); i++) std::cout<GetBoundingBox(label)[i]<<" "; @@ -277,12 +280,14 @@ namespace clitk if(m_ArgsInfo.dvhistogram_given) { typename StatisticsImageFilterType::HistogramPointer dvhistogram = statisticsFilter->GetHistogram(label); + double totalVolumeCC = ((statisticsFilter->GetCount(label))*spacing_cc); + double totalVolume = statisticsFilter->GetCount(label); // Screen std::cout<<"# Total volume : "; - std::cout<GetCount(label)<<" [No. of voxels]"<GetCount(label))*spacing_cc)<<" [cc]"<GetMean(label)<<" [Gy]"<GetMaximum(label)<<" [Gy]"<GetFrequency(j)); } - double cumulativeVolume = popCumulativeVolume + (dvhistogram->GetFrequency(i)); + double cumulativeVolume = (totalVolume - (popCumulativeVolume + (dvhistogram->GetFrequency(i)))); double percentCumulativeVolume =(cumulativeVolume*100)/(statisticsFilter->GetCount(label)) ; - double ccCumulativeVolume = (popCumulativeVolume + (dvhistogram->GetFrequency(i)))*spacing_cc; + double ccCumulativeVolume = (totalVolumeCC -((popCumulativeVolume + (dvhistogram->GetFrequency(i)))*spacing_cc)); double percentDiffVolume = dvhistogram->GetFrequency(i)*100/(statisticsFilter->GetCount(label)); - if(i == 0) - { - std::cout<GetBinMax(0,i)<<"\t "<GetFrequency(i)<<"\t "<GetFrequency(i))*spacing_cc)<<"\t "<GetBinMax(0,i)<<"\t "<GetFrequency(i)<<"\t "<GetFrequency(i))*spacing_cc)<<"\t "<GetBinMin(0,m_ArgsInfo.bins_arg-i)<<"\t "<GetBinMax(0,i)<<"\t "<GetFrequency(i)<<"\t "<GetFrequency(i))*spacing_cc)<<"\t "<<"\t "<GetCount(label)<<" [No. of voxels]"<GetCount(label))*spacing_cc)<<" [cc]"<GetMean(label)<<" [Gy]"<GetMaximum(label)<<" [Gy]"<GetFrequency(j)); } - double cumulativeVolume = popCumulativeVolume + (dvhistogram->GetFrequency(i)); - double percentCumulativeVolume =(cumulativeVolume*100)/(statisticsFilter->GetCount(label)) ; - double ccCumulativeVolume = (popCumulativeVolume + (dvhistogram->GetFrequency(i)))*spacing_cc; + double cumulativeVolume = (totalVolume - (popCumulativeVolume + (dvhistogram->GetFrequency(i)))); + double percentCumulativeVolume =(cumulativeVolume*100)/(statisticsFilter->GetCount(label)); + double ccCumulativeVolume = (totalVolumeCC -((popCumulativeVolume + (dvhistogram->GetFrequency(i)))*spacing_cc)); double percentDiffVolume = ((dvhistogram->GetFrequency(i))*100)/(statisticsFilter->GetCount(label)); - if(i == 0) - { - dvhistogramFile<GetBinMax(0,i)<<"\t "<GetFrequency(i)<<"\t "<GetFrequency(i))*spacing_cc)<<"\t "<GetBinMax(0,i)<<"\t "<GetFrequency(i)<<"\t "<GetFrequency(i))*spacing_cc)<<"\t "<GetBinMin(0,m_ArgsInfo.bins_arg-i)<<"\t "<GetBinMax(0,i)<<"\t "<GetFrequency(i)<<"\t "<GetFrequency(i))*spacing_cc)<<"\t "<