]> Creatis software - creaImageIO.git/blobdiff - src/creaImageIOGimmickView.cpp
Bug #1963
[creaImageIO.git] / src / creaImageIOGimmickView.cpp
index 0af8ded092fb945947d429616830751e53b3b4a5..245b0b563c829ad96d34abb6fd28bfce268a37d6 100644 (file)
@@ -27,7 +27,7 @@
 
 
 #include <creaImageIOGimmickView.h>
-#include <creaImageIOSystem.h>
+
 #include "boost/filesystem.hpp"
 
 #if defined(USE_GDCM)
@@ -46,7 +46,9 @@
 #include "gdcmAnonymizer.h"
 #include "gdcmGlobal.h"
 #endif*/
-
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
 
 namespace fs = boost::filesystem;
 namespace creaImageIO
@@ -382,11 +384,11 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
 
                        if(ext[5] == 0)
                        {
-                               ext[5] = im.size()-1;
+                               ext[5] = (int)im.size()-1;
                        }
                        else
                        {
-                               ext[5] = ext[5] * im.size()-1; // to deal with multiframes - JPR
+                               ext[5] = ext[5] * (int)im.size()-1; // to deal with multiframes - JPR
                        }
                        out->SetExtent(ext);
 
@@ -395,7 +397,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                        int dim[3];
                        first->GetDimensions(dim);
 
-                       out->SetDimensions(dim[0], dim[1], im.size() );
+                       out->SetDimensions(dim[0], dim[1], (int)im.size() );
                        out->AllocateScalars();
                        out->Update();
 
@@ -517,11 +519,11 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                first->GetWholeExtent(ext);  // send also 0,0 in Z 
                if(ext[5] == 0)
                {
-                       ext[5] = im.size()-1;
+                       ext[5] = (int)im.size()-1;
                }
                else
                {
-                       ext[5] = ext[5] * im.size()-1; // to deal with multiframes 
+                       ext[5] = ext[5] * (int)im.size()-1; // to deal with multiframes 
                }
                out.img->SetExtent(ext);
                int dim[3];
@@ -529,7 +531,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                first->GetDimensions(dim);
                first->GetSpacing(spac);
                out.img->SetSpacing(spac);
-               out.img->SetDimensions(dim[0], dim[1], im.size() );
+               out.img->SetDimensions(dim[0], dim[1], (int)im.size() );
                out.img->AllocateScalars();
                out.img->Update();
                unsigned long imsize = dim[0] * dim[1];
@@ -573,7 +575,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                std::vector<std::string>::iterator it;
                std::vector<OutStrGimmick>::iterator it_out = o_output.begin();
 
-               for (it=im.begin(); it!=im.end(); ++it, it_out += dim[2])
+               for (it=im.begin(); it!=im.end(); ++it)//, it_out ++)
                {
                        vtkImageData* cur = mReader.GetImage( (*it) );
                        for (int slice= 0 ; slice <dim[2]; slice++)
@@ -594,8 +596,8 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                                memcpy(out.img->GetScalarPointer(0,0,0), cur->GetScalarPointer(0,0,slice), imsize);
                                o_output.push_back(out);
                        }
-                       if(i_attr.mult)
-                               getAttributes((*it),(*it_out).infos,i_attr);
+       //              if(i_attr.mult)
+               //              getAttributes((*it),(*it_out).infos,i_attr);
                }
                if(!i_attr.mult)
                {
@@ -630,7 +632,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                        out.img->SetExtent(ext);
                        first->GetSpacing(spac);
                        out.img->SetSpacing(spac);
-                       out.img->SetDimensions(dim[0], dim[1], im.size() );
+                       out.img->SetDimensions(dim[0], dim[1], (int)im.size() );
                        out.img->AllocateScalars();
                        out.img->Update();
                        unsigned long imsize = dim[0] * dim[1];
@@ -659,7 +661,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
        void GimmickView::readImages(std::vector<OutStrGimmick>& o_output, std::vector<std::string> im,
                         OutputAttr i_attr, int i_dim, double i_zspc)
        {
-               int size = im.size();
+               int size = (int)im.size();
                if ( size == 0)
                {
                        return;