]> Creatis software - clitk.git/commitdiff
always set trachea as output
authordsarrut <dsarrut>
Wed, 7 Jul 2010 07:03:32 +0000 (07:03 +0000)
committerdsarrut <dsarrut>
Wed, 7 Jul 2010 07:03:32 +0000 (07:03 +0000)
segmentation/clitkExtractLungFilter.h
segmentation/clitkExtractLungFilter.txx
segmentation/clitkExtractLungGenericFilter.txx

index 1f6252d04737c46bf556f69b4a4dfa81b912462f..781a885f67eca478cb989b347696eee61a67434b 100644 (file)
@@ -23,7 +23,7 @@
 #include "clitkFilterBase.h"
 #include "clitkDecomposeAndReconstructImageFilter.h"
 #include "clitkExplosionControlledThresholdConnectedImageFilter.h"
-#include "clitkSegmentationFunctions.h"
+#include "clitkSegmentationUtils.h"
 
 // itk
 #include "itkStatisticsImageFilter.h"
index 2c7be4c3546fb80629a7b25af8667981582e27e5..f291739d09cab2f346ca6f2aae46ab72493c0fca 100644 (file)
@@ -22,7 +22,7 @@
 // clitk
 #include "clitkImageCommon.h"
 #include "clitkSetBackgroundImageFilter.h"
-#include "clitkSegmentationFunctions.h"
+#include "clitkSegmentationUtils.h"
 #include "clitkAutoCropFilter.h"
 
 // itk
@@ -161,7 +161,7 @@ GenerateOutputInformation()
   patient = dynamic_cast<const TMaskImageType*>(itk::ProcessObject::GetInput(1));
 
   // Check image
-  if (!HasSameSizeAndSpacing<TInputImageType, TMaskImageType>(input, patient)) {
+  if (!HaveSameSizeAndSpacing<TInputImageType, TMaskImageType>(input, patient)) {
     this->SetLastError("* ERROR * the images (input and patient mask) must have the same size & spacing");
     return;
   }
@@ -209,6 +209,7 @@ GenerateOutputInformation()
   //--------------------------------------------------------------------
   //--------------------------------------------------------------------
   StartNewStep("Find the trachea");
+  //DD(m_Seeds.size());
   if (m_Seeds.size() == 0) { // try to find seed
     // Search seed (parameters = UpperThresholdForTrachea)
     static const unsigned int Dim = InputImageType::ImageDimension;
@@ -219,18 +220,21 @@ GenerateOutputInformation()
     sliceRegionSize[Dim-1]=5;
     sliceRegion.SetSize(sliceRegionSize);
     sliceRegion.SetIndex(sliceRegionIndex);
-    
+    //DD(GetUpperThresholdForTrachea());
+    //DD(sliceRegion);
     typedef  itk::ImageRegionConstIterator<InputImageType> IteratorType;
     IteratorType it(working_input, sliceRegion);
     it.GoToBegin();
     while (!it.IsAtEnd()) {
       if(it.Get() < GetUpperThresholdForTrachea() ) {
         AddSeed(it.GetIndex());
+       //      DD(it.GetIndex());
       }
       ++it;
     }
   }
   
+  //DD(m_Seeds.size());
   if (m_Seeds.size() != 0) {
     // Explosion controlled region growing
     typedef clitk::ExplosionControlledThresholdConnectedImageFilter<InputImageType, InternalImageType> ImageFilterType;
@@ -360,10 +364,10 @@ GenerateOutputInformation()
   //--------------------------------------------------------------------
   //--------------------------------------------------------------------
   StartNewStep("Croping lung");
-  cropFilter = CropFilterType::New(); // Needed to reset pipeline
-  cropFilter->SetInput(working_image);
-  cropFilter->Update();   
-  working_image = cropFilter->GetOutput();
+  typename CropFilterType::Pointer cropFilter2 = CropFilterType::New(); // Needed to reset pipeline
+  cropFilter2->SetInput(working_image);
+  cropFilter2->Update();   
+  working_image = cropFilter2->GetOutput();
   StopCurrentStep<InternalImageType>(working_image);
 
   //--------------------------------------------------------------------
index 18fc2cfa2bc161d6771f493b5fd9af445a2504a3..2bc8af880bc6fe3abc4ab4a017698aed6df55115 100644 (file)
@@ -97,8 +97,7 @@ void clitk::ExtractLungGenericFilter<ArgsInfoType>::UpdateWithInputImageType()
   // Write/Save results
   typename OutputImageType::Pointer output = filter->GetOutput();
   this->template SetNextOutput<OutputImageType>(output); 
-  if (mArgsInfo.outputTrachea_given) 
-    this->template SetNextOutput<typename FilterType::MaskImageType>(filter->GetTracheaImage()); 
+  this->template SetNextOutput<typename FilterType::MaskImageType>(filter->GetTracheaImage()); 
 }
 //--------------------------------------------------------------------