]> Creatis software - creaImageIO.git/commitdiff
Merge branch 'master' into changestoITK3and4
authorEduardo DAVILA <davila@localhost.localdomain>
Thu, 31 Aug 2017 08:09:20 +0000 (10:09 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Thu, 31 Aug 2017 08:09:20 +0000 (10:09 +0200)
appli/TestWxGimmickReaderDialog/CMakeLists.txt
bbtk/src/bbcreaImageIOItkImagesChooserDialogBox.cxx
src/creaImageIOWxAnySimpleDlg.cpp

index fa7307b94e80e513e14f72e70f18340511081bbb..255ab8f39eec323a0467825df1ef4574dc639bd0 100644 (file)
@@ -30,6 +30,6 @@ ELSE(WIN32)
   ADD_EXECUTABLE(creaImageIOApp MACOSX_BUNDLE main)
 ENDIF(WIN32)
 
-TARGET_LINK_LIBRARIES(         creaImageIOApp creaImageIO  )
+TARGET_LINK_LIBRARIES(         creaImageIOApp creaImageIO ${ITK_LIBRARIES} )
 
 INSTALL_TARGETS(/bin/ creaImageIOApp )
index b3b8552023d5bb8675eeb0fff46694bfb0ab26a4..9c77a1de377b1cd7c416414c1b04e61aa985cd4b 100644 (file)
@@ -1,28 +1,28 @@
 /*
-       # ---------------------------------------------------------------------
-       #
-       # 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.
-       # ------------------------------------------------------------------------
+  # ---------------------------------------------------------------------
+  #
+  # 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.
+  # ------------------------------------------------------------------------
 */
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 #include "bbcreaImageIOItkImagesChooserDialogBox.h"
 #include "bbcreaImageIOPackage.h"
 
+// -------------------------------------------------------------------------
+// LFV: avoid itk::Concept check on 4d or superior images
+#define BBCREAIMAGEIO_ChooserDlg_Template( t, ty, di )            \
+  if( t == typeid( itk::Image< ty, di > ) )                       \
+  {                                                               \
+    this->Export< itk::Image< ty, di > >( );                      \
+    this->ExportVTK< itk::Image< ty, di > >( );                   \
+  }
+// -------------------------------------------------------------------------
+
 namespace bbcreaImageIO
 {
 
@@ -46,8 +56,43 @@ void ItkImagesChooserDialogBox::Process()
     dlg->ShowModal(); 
 
     bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front());
-    BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
-    BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, ExportVTK);
+
+    BBCREAIMAGEIO_ChooserDlg_Template( typ, char, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, short, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, int, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, long, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, float, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, double, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned char, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned short, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned int, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned long, 1 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, char, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, short, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, int, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, long, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, float, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, double, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned char, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned short, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned int, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned long, 2 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, char, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, short, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, int, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, long, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, float, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, double, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned char, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned short, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned int, 3 )
+    else BBCREAIMAGEIO_ChooserDlg_Template( typ, unsigned long, 3 );
+
+
+    /* Deprecated
+       BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
+       BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, ExportVTK);
+    */
 
     delete dlg;
 }
index 926e1181675271f373a4e08021c5670b1fa536a3..58b7d95c0fd57e42fed654352c35bd22bde14f6f 100644 (file)
 #include "creaImageIOWxAnySimpleDlg.h"
 
 #include "creaImageIOWxGimmickReaderDialog.h"
-#include <itkAnalyzeImageIO.h>
+
+#if ITK_VERSION_MAJOR < 4 //  : WARNING: deprecated in ITK 4.0
+#  include <itkAnalyzeImageIO.h>
+#  include <itkDICOMSeriesFileNames.h>
+#else // ITK_VERSION_MAJOR < 4
+#  include <itkGDCMSeriesFileNames.h>
+#endif // ITK_VERSION_MAJOR < 4
+
 #include <itkImageFileReader.h>
 #include <itkImageSeriesReader.h>
 #include <itkImage.h>
 #include <itkImageSeriesWriter.h>
 #include <itkGDCMImageIO.h>
-#include <itkDICOMSeriesFileNames.h>
 #include <itkNumericSeriesFileNames.h>
 #include <itkVectorImage.h>
 #include <itkMetaImageIO.h>
@@ -513,7 +519,11 @@ namespace creaImageIO
       {
           typedef itk::Image<short,3> TImage;
           typedef itk::GDCMImageIO GDCMType;
+#if ITK_VERSION_MAJOR < 4
           typedef itk::DICOMSeriesFileNames dicnames;
+#else // ITK_VERSION_MAJOR < 4
+          typedef itk::GDCMSeriesFileNames dicnames;
+#endif // ITK_VERSION_MAJOR < 4
           GDCMType::Pointer gdcmIO = GDCMType::New(); 
           dicnames::Pointer generator = dicnames::New();