From 19bbb0558fc5368833b085664291363e5985b023 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Thu, 16 Jun 2011 13:38:49 +0000 Subject: [PATCH] Fix mistyping --- .../src/bbitkvtkvtkImageData2itkImage.cxx | 10 +++--- ...tkvtkvtkImageDataVector2itkImageVector.cxx | 35 ++++++++++--------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx b/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx index ceee695..0a23b76 100644 --- a/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx +++ b/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkvtkvtkImageData2itkImage.cxx,v $ Language: C++ - Date: $Date: 2011/06/16 12:28:57 $ - Version: $Revision: 1.6 $ + Date: $Date: 2011/06/16 13:38:49 $ + Version: $Revision: 1.7 $ =========================================================================*/ @@ -70,8 +70,8 @@ namespace bbitkvtk BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH_DIM(I,3,M) void vtkImageData2itkImage::Convert() - { - BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH(bbGetInputIn(),Convert) + { + BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH(bbGetInputIn(),Convert) } @@ -141,7 +141,7 @@ namespace bbitkvtk bbtkDebugMessage("process",5,"<== ["<()<<","<() *DONE*"<GetDataDimension()==DIM) \ - { \ - if (I->GetScalarType()==VTK_CHAR) M(); \ - else if (I->GetScalarType()==VTK_SIGNED_CHAR) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_CHAR) M(); \ - else if (I->GetScalarType()==VTK_SHORT) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_SHORT) M(); \ - else if (I->GetScalarType()==VTK_INT) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_INT) M(); \ - else if (I->GetScalarType()==VTK_LONG) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_LONG) M(); \ - else if (I->GetScalarType()==VTK_FLOAT) M(); \ - else if (I->GetScalarType()==VTK_DOUBLE) M(); \ +// we assume all the vector elements have the same type +#define BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH_DIM(I,DIM,M) \ + if (I[0]->GetDataDimension()==DIM) \ + { \ + if (I[0]->GetScalarType()==VTK_CHAR) M(); \ + else if (I[0]->GetScalarType()==VTK_SIGNED_CHAR) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_CHAR) M(); \ + else if (I[0]->GetScalarType()==VTK_SHORT) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_SHORT) M(); \ + else if (I[0]->GetScalarType()==VTK_INT) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_INT) M(); \ + else if (I[0]->GetScalarType()==VTK_LONG) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_LONG) M(); \ + else if (I[0]->GetScalarType()==VTK_FLOAT) M(); \ + else if (I[0]->GetScalarType()==VTK_DOUBLE) M(); \ } #define BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH(I,M) \ @@ -135,7 +136,7 @@ namespace bbitkvtk bbtkDebugMessage("process",5," ["<Update(); itkImageType* out = const_cast(conv->GetOutput()); - m_Output_Vector.push_back(conv->GetOutput()); + m_Output_Vector.push_back(out); } catch( itk::ExceptionObject & e) -- 2.47.1