]> Creatis software - creaImageIO.git/blobdiff - src/creaImageIOGimmickView.cpp
#2451 creaImageIO Bug New Normal - not complete the Map with all DicomTags
[creaImageIO.git] / src / creaImageIOGimmickView.cpp
index 02d18a7d490af03bb2eab27f1540d000f6b5aea3..0a76936736294655e38f4d77fa54c0a5790b89f9 100644 (file)
@@ -1,5 +1,33 @@
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
+#                        pour la Santé)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+#  This software is governed by the CeCILL-B license under French law and 
+#  abiding by the rules of distribution of free software. You can  use, 
+#  modify and/ or redistribute the software under the terms of the CeCILL-B 
+#  license as circulated by CEA, CNRS and INRIA at the following URL 
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability. 
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------
+*/
+
+
 #include <creaImageIOGimmickView.h>
-#include <creaImageIOSystem.h>
+
 #include "boost/filesystem.hpp"
 
 #if defined(USE_GDCM)
 #include <vtkGdcmReader.h>
 #endif
 
-#if defined(USE_GDCM2)
+/*#if defined(USE_GDCM2)
 #include <vtkGDCMImageReader.h>
 #include "gdcmSystem.h"
 #include "gdcmCryptographicMessageSyntax.h"
 #include "gdcmUIDGenerator.h"
 #include "gdcmAnonymizer.h"
 #include "gdcmGlobal.h"
+#endif*/
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
 #endif
 
-
 namespace fs = boost::filesystem;
 namespace creaImageIO
 {
@@ -354,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);
 
@@ -367,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();
 
@@ -489,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];
@@ -501,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];
@@ -545,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++)
@@ -566,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)
                {
@@ -602,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];
@@ -631,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;
@@ -648,11 +678,8 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                        else
                        {
                                readImages2(o_output,im, i_attr,i_zspc);
-                       }
-                       
-               }
-               else
-               {
+                       }                       
+               } else {
                        // multiple or single frame
                        if ( isSingle(im.front()) )
                        {
@@ -840,7 +867,7 @@ void GimmickView::ReadImagesNotThreadedInVector(std::vector<vtkImageData*>& s, s
   }      
   
 
-
+#if defined(USE_GDCM)
 ////////////////////////////////////////////////////////////////////////
 void GimmickView::Anonymize(std::vector<std::string> i_filenames, int type)
 {
@@ -901,6 +928,12 @@ void GimmickView::Anonymize(std::vector<std::string> i_filenames, int type)
           fh->Delete();
    }
 }
+#endif
+#if defined(USE_GDCM2)
+void GimmickView::Anonymize(std::vector<std::string> i_filenames, int type)
+{
+}
+#endif
 ////////////////////////////////////////////////////////////////////////
 //void GimmickView::Anonymize(std::vector<std::string> i_filenames, int type)
 //{