X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOGimmickView.cpp;h=245b0b563c829ad96d34abb6fd28bfce268a37d6;hb=f5357d5e24ce935ff82ebb98d21dc95185c3528e;hp=0af8ded092fb945947d429616830751e53b3b4a5;hpb=42cd1f59493627931b5068f3dceb401abc4b8c4c;p=creaImageIO.git diff --git a/src/creaImageIOGimmickView.cpp b/src/creaImageIOGimmickView.cpp index 0af8ded..245b0b5 100644 --- a/src/creaImageIOGimmickView.cpp +++ b/src/creaImageIOGimmickView.cpp @@ -27,7 +27,7 @@ #include -#include + #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& 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& 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& 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& 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& s, std::vect std::vector::iterator it; std::vector::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 & 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& 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& s, std::vect void GimmickView::readImages(std::vector& o_output, std::vector im, OutputAttr i_attr, int i_dim, double i_zspc) { - int size = im.size(); + int size = (int)im.size(); if ( size == 0) { return;