X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbtkStaticLecture.cxx;fp=packages%2Fvtk%2Fsrc%2FbbtkStaticLecture.cxx;h=fc1f9af7dd468b35ef8e0356f093ade9510f5bb3;hb=427d8c0ac838ab789a57b28f62a7f9ff243e7b60;hp=e166919ed9f2b09e368ab4ca7ce63cddc105a2f3;hpb=c2d2ccbc4bac635e5d0b802d9830efd94b060dab;p=bbtk.git diff --git a/packages/vtk/src/bbtkStaticLecture.cxx b/packages/vtk/src/bbtkStaticLecture.cxx index e166919..fc1f9af 100755 --- a/packages/vtk/src/bbtkStaticLecture.cxx +++ b/packages/vtk/src/bbtkStaticLecture.cxx @@ -27,6 +27,39 @@ #include "bbtkStaticLecture.h" +#include + +int bbtkStaticLecture::GetTypeFormat( std::string formatStr , vtkImageData* image ) +{ + int outputformat = VTK_UNSIGNED_CHAR; + if (formatStr=="SAME") + { + if (image!=NULL) outputformat = image->GetScalarType(); + } + else if (formatStr=="VTK_BIT") outputformat = VTK_BIT; // 1 + else if (formatStr=="VTK_CHAR") outputformat = VTK_CHAR; // 2 + else if (formatStr=="VTK_SIGNED_CHAR") outputformat = VTK_SIGNED_CHAR; // 15 + else if (formatStr=="VTK_UNSIGNED_CHAR") outputformat = VTK_UNSIGNED_CHAR; // 3 + else if (formatStr=="VTK_SHORT") outputformat = VTK_SHORT; // 4 + else if (formatStr=="VTK_UNSIGNED_SHORT") outputformat = VTK_UNSIGNED_SHORT; // 5 + else if (formatStr=="VTK_INT") outputformat = VTK_INT; // 6 + else if (formatStr=="VTK_UNSIGNED_INT") outputformat = VTK_UNSIGNED_INT; // 7 + else if (formatStr=="VTK_LONG") outputformat = VTK_LONG; // 8 + else if (formatStr=="VTK_UNSIGNED_LONG") outputformat = VTK_UNSIGNED_LONG; // 9 + else if (formatStr=="VTK_FLOAT") outputformat = VTK_FLOAT; // 10 + else if (formatStr=="VTK_DOUBLE") outputformat = VTK_DOUBLE; // 11 + else if (formatStr=="MET_CHAR") outputformat = VTK_CHAR; // 2 + else if (formatStr=="MET_UCHAR") outputformat = VTK_UNSIGNED_CHAR; // 3 + else if (formatStr=="MET_SHORT") outputformat = VTK_SHORT; // 4 + else if (formatStr=="MET_USHORT") outputformat = VTK_UNSIGNED_SHORT; // 5 + else if (formatStr=="MET_SHORT") outputformat = VTK_SHORT; // 4 + else if (formatStr=="MET_FLOAT") outputformat = VTK_FLOAT; // 10 + else if (formatStr=="MET_DOUBLE") outputformat = VTK_DOUBLE; // 11 + + return outputformat; +} + + void bbtkStaticLecture::setPixelValue(int i, int j, int k, vtkImageData* img, double value) {