]> Creatis software - clitk.git/blobdiff - filters/clitkGuerreroVentilationGenericFilter.cxx
Added Varian OBI file format
[clitk.git] / filters / clitkGuerreroVentilationGenericFilter.cxx
index 5df7bea4b3b38ba2f5da01577cdf734ae550e2bd..9d1ab2dc0273f293447395e8fe46cf6448f5c3c3 100644 (file)
@@ -1,22 +1,27 @@
 /*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
-  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
-  l'Image). All rights reserved. See Doc/License.txt or
-  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
-                                                                                
-     This software is distributed WITHOUT ANY WARRANTY; without even
-     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-     PURPOSE.  See the above copyright notices for more information.
-                                                                             
-=========================================================================*/
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
+
+  It is distributed under dual licence
+
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+======================================================================-====*/
 /**
  -------------------------------------------------------------------
  * @file   clitkGuerreroVentilationGenericFilter.cxx
  * @author Joël Schaerer
  * @date   20 April 2009
 
- * @brief  
+ * @brief
  -------------------------------------------------------------------*/
 
 #include "clitkGuerreroVentilationGenericFilter.h"
@@ -25,8 +30,9 @@
 #include <itkExtractImageFilter.h>
 
 //--------------------------------------------------------------------
-clitk::GuerreroVentilationGenericFilter::GuerreroVentilationGenericFilter() 
-  :ImageToImageGenericFilter<Self>("GuerreroVentilationGenericFilter") {
+clitk::GuerreroVentilationGenericFilter::GuerreroVentilationGenericFilter()
+  :ImageToImageGenericFilter<Self>("GuerreroVentilationGenericFilter")
+{
   blood_mass_factor=1.;
   InitializeImageType<2>();
   InitializeImageType<3>();
@@ -35,7 +41,8 @@ clitk::GuerreroVentilationGenericFilter::GuerreroVentilationGenericFilter()
 
 //--------------------------------------------------------------------
 template<unsigned int Dim>
-void clitk::GuerreroVentilationGenericFilter::InitializeImageType() {      
+void clitk::GuerreroVentilationGenericFilter::InitializeImageType()
+{
   ADD_IMAGE_TYPE(Dim, short);
 }
 //--------------------------------------------------------------------
@@ -43,30 +50,31 @@ void clitk::GuerreroVentilationGenericFilter::InitializeImageType() {
 
 //--------------------------------------------------------------------
 template<class ImageType>
-void clitk::GuerreroVentilationGenericFilter::UpdateWithInputImageType() {
+void clitk::GuerreroVentilationGenericFilter::UpdateWithInputImageType()
+{
 
-    // Input should be 2
-    assert(mInputFilenames.size() == 2);
+  // Input should be 2
+  assert(m_InputFilenames.size() == 2);
 
-    // Reading input
-    typedef ImageType InputImageType;
-    typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
-    typename InputImageType::Pointer ref = this->template GetInput<InputImageType>(1);
+  // Reading input
+  typedef ImageType InputImageType;
+  typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
+  typename InputImageType::Pointer ref = this->template GetInput<InputImageType>(1);
 
-    typedef itk::Image<float,InputImageType::ImageDimension> OutputImageType;
-    //    typename ImageType::Pointer input = clitk::readImage<ImageType>(mInputFilenames[0], mIOVerbose);
-    //typename ImageType::Pointer ref = clitk::readImage<ImageType>(mInputFilenames[1], mIOVerbose);
+  typedef itk::Image<float,InputImageType::ImageDimension> OutputImageType;
+  //    typename ImageType::Pointer input = clitk::readImage<ImageType>(mInputFilenames[0], mIOVerbose);
+  //typename ImageType::Pointer ref = clitk::readImage<ImageType>(mInputFilenames[1], mIOVerbose);
 
-    typedef itk::BinaryGuerreroFilter<ImageType,ImageType,OutputImageType> GFilterType;
-    typename GFilterType::Pointer filter = GFilterType::New();
-    filter->SetInput1(ref);
-    filter->SetInput2(input);
-    filter->SetBloodCorrectionFactor(blood_mass_factor);
-    filter->SetUseCorrectFormula(use_correct_formula);
-    filter->Update();
+  typedef itk::BinaryGuerreroFilter<ImageType,ImageType,OutputImageType> GFilterType;
+  typename GFilterType::Pointer filter = GFilterType::New();
+  filter->SetInput1(ref);
+  filter->SetInput2(input);
+  filter->SetBloodCorrectionFactor(blood_mass_factor);
+  filter->SetUseCorrectFormula(use_correct_formula);
+  filter->Update();
 
-    this->SetNextOutput<OutputImageType>(filter->GetOutput());
-    //clitk::writeImage<OutputImageType>(filter->GetOutput(), mOutputFilename, mIOVerbose);
-    //std::cout << "Warning: removed " << filter->GetFunctor().aberant_voxels << " aberant voxels from the ventilation image"
-        //<< std::endl;
+  this->SetNextOutput<OutputImageType>(filter->GetOutput());
+  //clitk::writeImage<OutputImageType>(filter->GetOutput(), mOutputFilename, mIOVerbose);
+  //std::cout << "Warning: removed " << filter->GetFunctor().aberant_voxels << " aberant voxels from the ventilation image"
+  //<< std::endl;
 }