X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkMeshToBinaryImageFilter.txx;h=94424b8631ca4e9fa7d7e1f3c4af3fbf90bf1d70;hb=b1a94242c6faae33b9e0908a24cacc3e3f7d4e92;hp=db9897015b8b96d3f36f0a1d24336a8f6c4cdcd0;hpb=34f45c6507a3605351e265f4d5eb5b4bb31a1fa6;p=clitk.git diff --git a/itk/clitkMeshToBinaryImageFilter.txx b/itk/clitkMeshToBinaryImageFilter.txx index db98970..94424b8 100644 --- a/itk/clitkMeshToBinaryImageFilter.txx +++ b/itk/clitkMeshToBinaryImageFilter.txx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -30,7 +30,7 @@ //-------------------------------------------------------------------- template clitk::MeshToBinaryImageFilter:: -MeshToBinaryImageFilter():itk::ImageSource() +MeshToBinaryImageFilter() : itk::ImageSource(), m_Extrude(true) { } //-------------------------------------------------------------------- @@ -102,11 +102,16 @@ GenerateData() sts->SetInformationInput(binary_image); // Extrusion - vtkSmartPointer extrude=vtkSmartPointer::New(); - extrude->SetInput(m_Mesh); - // We extrude in the -slice_spacing direction to respect the FOCAL convention - extrude->SetVector(0, 0, -m_LikeImage->GetSpacing()[2]); - sts->SetInput(extrude->GetOutput()); + if (m_Extrude) + { + vtkSmartPointer extrude=vtkSmartPointer::New(); + extrude->SetInput(m_Mesh); + // We extrude in the -slice_spacing direction to respect the FOCAL convention + extrude->SetVector(0, 0, -m_LikeImage->GetSpacing()[2]); + sts->SetInput(extrude->GetOutput()); + } + else + sts->SetInput(m_Mesh); // Stencil vtkSmartPointer stencil=vtkSmartPointer::New(); @@ -134,7 +139,7 @@ GenerateData() m_Exporter->SetInput( stencil->GetOutput() ); m_Importer->Update(); - writeImage(m_Importer->GetOutput(), "f.mhd"); + // writeImage(m_Importer->GetOutput(), "f.mhd"); this->SetNthOutput(0, m_Importer->GetOutput());