X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkMeshToBinaryImageFilter.txx;h=94424b8631ca4e9fa7d7e1f3c4af3fbf90bf1d70;hb=c84464b925114176d46e882f73a00c5c10d18ff1;hp=77252584885783336cde934ed433a83d81d3677b;hpb=a360b70353c02d20482d950c96ba7b289deca184;p=clitk.git diff --git a/itk/clitkMeshToBinaryImageFilter.txx b/itk/clitkMeshToBinaryImageFilter.txx index 7725258..94424b8 100644 --- a/itk/clitkMeshToBinaryImageFilter.txx +++ b/itk/clitkMeshToBinaryImageFilter.txx @@ -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());