]> Creatis software - clitk.git/commitdiff
Allow to write only new structures (do not copy older ones)
authorDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Thu, 20 Jun 2013 10:30:03 +0000 (12:30 +0200)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Thu, 20 Jun 2013 10:30:03 +0000 (12:30 +0200)
common/clitkImage2DicomRTStructFilter.h
common/clitkImage2DicomRTStructFilter.txx
tools/clitkImage2DicomRTStruct.cxx
tools/clitkImage2DicomRTStruct.ggo

index d570934d046f96f2d9f0e39ba4a8e180c44ad1f9..b6a74b2fe7829ff7fb59b7cce19b0c343f0427a1 100644 (file)
@@ -47,6 +47,7 @@ namespace clitk {
     itkSetMacro(OutputFilename, std::string);
     void SetROIType(std::string type);
     itkSetMacro(ThresholdValue, PixelType);
+    itkSetMacro(SkipInitialStructuresFlag, bool);
     
     // Run filter
     void Update();    
@@ -58,6 +59,7 @@ namespace clitk {
     std::string m_ROIType;
     PixelType m_ThresholdValue;
     std::vector<std::string> m_InputFilenames;
+    bool m_SkipInitialStructuresFlag;
   };
   //--------------------------------------------------------------------
 
index 248451d8fac4e0dff6ac74b2b1316750226037a0..77c5e07044f1684b502021b8196c13ec15c5c975 100644 (file)
@@ -62,6 +62,7 @@ clitk::Image2DicomRTStructFilter<PixelType>::Image2DicomRTStructFilter()
   m_DicomFolder = "";
   m_OutputFilename = "default-output.dcm";
   m_ThresholdValue = 0.5;
+  m_SkipInitialStructuresFlag = false;
 }
 //--------------------------------------------------------------------
 
@@ -119,6 +120,11 @@ void clitk::Image2DicomRTStructFilter<PixelType>::Update()
   // Init writer
   vtkGDCMPolyDataWriter * writer = vtkGDCMPolyDataWriter::New();
   int numMasks = reader->GetNumberOfOutputPorts() + m;
+
+  if (m_SkipInitialStructuresFlag) {
+    numMasks = m;
+  }
+
   writer->SetNumberOfInputPorts(numMasks);    
   writer->SetFileName(m_OutputFilename.c_str());
   writer->SetMedicalImageProperties(reader->GetMedicalImageProperties());
index a82b0ec539b158fd55d945b2c3e294acfb1173ba..807b073f8c1f01fd214fb2f8fc3ea77394d1640c 100644 (file)
@@ -42,6 +42,7 @@ int main(int argc, char * argv[]) {
   filter.SetOutputFilename(args_info.output_arg);
   filter.SetROIType(args_info.roitype_arg);
   filter.SetThresholdValue(args_info.threshold_arg);
+  filter.SetSkipInitialStructuresFlag(args_info.skip_flag);
   filter.Update();
 
   // This is the end my friend 
index 70f85b28daaea76ac94fa711ca13951f1fa05c67..7416d32b5c40fdf911258d5d742b7fb0933c9c20 100644 (file)
@@ -11,5 +11,6 @@ option "dicom"                 d "Input folder where the initial dicom ct is"
 option "output"                 o "Output DicomRT filename"          string    yes
 
 option "threshold"       t "Threshold for binary image"                         float   no default = "0.5"
+option "skip"           s "Do not write in output the structures that was in input"   flag off
 option "roitype"        - "Name of the type of roi added into the rt-struct"   string  no default = "ORGAN"