X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOGimmickView.cpp;h=5ad0525e5202c73c3960e59bb3f23a0042aa8bc3;hb=2a8a9b27d2eba4985b76d2f0218fd4ba83784ca9;hp=93d286b21952e2b6a33d5c0a8ddc79c98e3e40ff;hpb=eb28ece612248f85890c32e1861703bffd506d06;p=creaImageIO.git diff --git a/src/creaImageIOGimmickView.cpp b/src/creaImageIOGimmickView.cpp index 93d286b..5ad0525 100644 --- a/src/creaImageIOGimmickView.cpp +++ b/src/creaImageIOGimmickView.cpp @@ -28,20 +28,20 @@ namespace creaImageIO public: ImageExtent(const std::string& x, const std::string& y, const std::string& z, const std::string& t) { - sscanf(x.c_str(),"%d",&mExtent[0]); - sscanf(y.c_str(),"%d",&mExtent[1]); - sscanf(z.c_str(),"%d",&mExtent[2]); - sscanf(t.c_str(),"%d",&mExtent[3]); - if(x==""){mExtent[0]=1;} - if(y==""){mExtent[1]=1;} - if(z==""){mExtent[2]=1;} - if(t==""){mExtent[3]=1;} - - if (mExtent[3]>1) mDim=4; - else if (mExtent[2]>1) mDim=3; - else if (mExtent[1]>1) mDim=2; - else if (mExtent[0]>1) mDim=1; - else mDim=0; + sscanf(x.c_str(),"%d",&mExtent[0]); + sscanf(y.c_str(),"%d",&mExtent[1]); + sscanf(z.c_str(),"%d",&mExtent[2]); + sscanf(t.c_str(),"%d",&mExtent[3]); + if(x==""){mExtent[0]=1;} + if(y==""){mExtent[1]=1;} + if(z==""){mExtent[2]=1;} + if(t==""){mExtent[3]=1;} + + if (mExtent[3]>1) mDim=4; + else if (mExtent[2]>1) mDim=3; + else if (mExtent[1]>1) mDim=2; + else if (mExtent[0]>1) mDim=1; + else mDim=0; } @@ -296,11 +296,16 @@ namespace creaImageIO mValidationSignal(ivalid); } + void GimmickView::stopReader() + { + mReader.Stop(); + } + //====================================================================== ///Reads Images (Non Threaded) void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vector im, int dimension) { - mReader.Stop(); + stopReader(); /* remember! #define GIMMICK_NO_IMAGE_SELECTION 0 @@ -462,7 +467,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect // If we want only one output information structure, we set it outside the loop if(!i_attr.mult) { - getAttributes(im.front(), o_output.front().infos,i_attr); + getAttributes(im.front(), o_output.front().infos, i_attr); } } @@ -564,7 +569,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect } - ////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////// // create an output structure with n entries (T size) = T + n output ////////////////////////////////////////////////////////// void GimmickView::readImages4(std::vector& o_output, std::vector im, @@ -685,7 +690,6 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect - void GimmickView::ReadImagesNotThreadedInVector(std::vector& s, std::vector im, int dimension) { // Create the output data @@ -701,6 +705,7 @@ void GimmickView::ReadImagesNotThreadedInVector(std::vector& s, s } else if (im.size()>1) // Test inutile ? JPR { + /// \TODO fix unused variable 'first' vtkImageData* first = mReader.GetImage( im.front()); if (dimension == 2) { @@ -927,4 +932,4 @@ void GimmickView::ReadImagesNotThreadedInVector(std::vector& s, s // } //} // -} // EO namespace creaImageIO \ No newline at end of file +} // EO namespace creaImageIO