[Insight-users] Insight-users Digest, Vol 111, Issue 1 [FLTK error]

Nicola Amoroso nicola.amoroso at ba.infn.it
Mon Jul 1 12:03:41 EDT 2013


Dear Mahetab,
I'm sorry for the delay I answer your mail; in my case problem was solved by editing the CMakeLists.txt. After the CHECK_FUNCTION_EXISTS(png_set_tRNS…) insert the line 
set(CMAKE_REQUIRED_LIBRARIES)
as in the following example.

Best regards.

N.

#######################################################################
# functions
include(CheckFunctionExists)

if(HAVE_DLFCN_H)
   set(CMAKE_REQUIRED_LIBRARIES dl)
   set(HAVE_DLFCN_H 1)
endif(HAVE_DLFCN_H)
CHECK_FUNCTION_EXISTS(dlsym                  HAVE_DLSYM)

CHECK_FUNCTION_EXISTS(localeconv             HAVE_LOCALECONV)

if(LIB_png)
   set(CMAKE_REQUIRED_LIBRARIES png)
endif(LIB_png)
CHECK_FUNCTION_EXISTS(png_get_valid          HAVE_PNG_GET_VALID)
CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha  HAVE_PNG_SET_TRNS_TO_ALPHA)


set(CMAKE_REQUIRED_LIBRARIES)


CHECK_FUNCTION_EXISTS(scandir                HAVE_SCANDIR)
CHECK_FUNCTION_EXISTS(snprintf               HAVE_SNPRINTF)
Il giorno 01/lug/2013, alle ore 18:01, insight-users-request at itk.org ha scritto:

> Send Insight-users mailing list submissions to
> 	insight-users at itk.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.itk.org/mailman/listinfo/insight-users
> or, via email, send a message with subject or body 'help' to
> 	insight-users-request at itk.org
> 
> You can reach the person managing the list at
> 	insight-users-owner at itk.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Insight-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: FLTK error (Matt McCormick)
>   2. Re: building ITK with Python wrappers on Ubuntu	13.04 (Young Lee)
>   3. Please help: Cannot open include file: 'fltkLightButton.h',
>      'fltkImageViewer.h', ?errors when building GaussianFilter outside
>      Insightapplications (anna han wan)
>   4. Exteding itkProcessObject (Alessandro)
>   5. loading 4d dicom image (Jose Ignacio Prieto)
>   6. Re: loading 4d dicom image (Alessandro)
>   7. Re: loading 4d dicom image (Jose Ignacio Prieto)
>   8. Re: Reading multi-frame 2D+time DICOM files (marianabb)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 30 Jun 2013 12:16:44 -0400
> From: Matt McCormick <matt.mccormick at kitware.com>
> Subject: Re: [Insight-users] FLTK error
> To: Mahetab Salama <mahetab.salama at gmail.com>
> Cc: insight-users at itk.org
> Message-ID:
> 	<CALzTN-TN1nE_ha+DTQCRz3aiC9J5pLQJ7b9n4He78VWN6mm=mA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi Mahetab,
> 
> Please address your questions to the insight-users at itk.org so everyone
> can benefit.
> 
>> From your reported error, it does not appear that you are using the
> superbuild.  To use the superbuild, point the CMake source directory
> to ITKApps/Superbuild on initial CMake configuration.
> 
> Also, 4.4.0 of ITKApps (InsightApplications) is highly recommended.
> 
> Hope this helps,
> Matt
> 
> On Sun, Jun 30, 2013 at 6:26 AM, Mahetab Salama
> <mahetab_msalama at yahoo.com> wrote:
>> Dear Matt,
>> 
>> I'm a research assistant at cairo university and i'm facing the same problem
>> you disscued with nicola while ago regrading an error with FLTK but i don't
>> understand how did you solve it. I will be grateful if you can help. Knowing
>> that i tried the superbuild and i put the fltk build directory correctly and
>> still can't solve the problem.
>> Here is your post that i'm refereing to:
>> http://public.kitware.com/pipermail/insight-users/2013-January/047070.html
>> Looking forward for your reply..
>> 
>> matt.mccormick at kitware.com
>> ITK VERSION: 4.3.1
>> VTK VERSION: 5.10.1
>> CMake Error at CMakeLists.txt:134 (FIND_PACKAGE):
>> Could not find a package configuration file provided by "FLTK" with any of
>> the following names:
>> FLTKConfig.cmake
>> fltk-config.cmake
>> Add the installation prefix of "FLTK" to CMAKE_PREFIX_PATH or set
>> "FLTK_DIR" to a directory containing one of the above files. If "FLTK"
>> provides a separate development package or SDK, be sure it has been
>> installed.
>> Configuring incomplete, errors occurred!
>> 
>> Best Regards
>> 
>> Mahetab  Salama
>> 
>> 
>> 
>> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Sun, 30 Jun 2013 14:50:29 -0700
> From: Young Lee <s43Lee at ucsd.edu>
> Subject: Re: [Insight-users] building ITK with Python wrappers on
> 	Ubuntu	13.04
> To: insight-users at itk.org
> Message-ID: <51D0A825.1010202 at ucsd.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> The default on Ubuntu13.04 is gcc-4.7.3.  But I suspected there was a 
> problem with gcc so I tried it as well with gcc-4.4.7 that is in the 
> Ubuntu repository. I got the identical error message with both versions 
> of gcc.  On the RHEL 6.2 system where I got it to compile, it used 
> gcc-4.4.6.
> 
> 
> On 06/29/2013 03:35 PM, Bradley Lowekamp wrote:
>> What version of gcc are you using?  There is a good chance that version is not supported by gcc_xml.
>> 
>> On Jun 29, 2013, at 6:09 PM, Young Lee <s43Lee at ucsd.edu> wrote:
>> 
>>> Hi,
>>> 
>>> I was wondering if anyone had any suggestions on the error I'm getting when I try to build ITK 4.4.0 with Python wrappers on Ubuntu 13.04.  I'm able to build it OK on RHEL 6.2 and Ubuntu 12.04.  I can also build ITK4.4.0  on Ubntu 13.04 without problems if I turn off the Python wrappers option.  But when I try to build ITK4.4.0 with Python wrappers on Ubuntu 13.04,  I get the following error message:
>>> 
>>> [ 43%] Generating vcl_complex.xml
>>> In file included from /usr/include/endian.h:60,
>>>                 from /usr/include/ctype.h:40,
>>>                 from /usr/include/c++/4.7/cctype:44,
>>>                 from /usr/include/c++/4.7/bits/localefwd.h:44,
>>>                 from /usr/include/c++/4.7/string:45,
>>>                 from /home/young/prog/Lin/ITK/InsightToolkit-4.4.0/Modules/Core/Common/include/itkMacro.h:46,
>>>                 from /home/young/prog/Lin/ITK/InsightToolkit-4.4.0/Modules/Core/Common/include/itkLightObject.h:21,
>>>                 from /home/young/prog/Lin/ITK/InsightToolkit-4.4.0/Modules/Core/Common/include/itkObject.h:31,
>>>                 from /home/young/prog/Lin/ITK/InsightToolkit-4.4.0/Modules/Core/Common/include/itkCommand.h:21,
>>>                 from /home/young/prog/Lin/ITK/ITKBuild4.4.0/Wrapping/Modules/ITKCommon/vcl_complex.cxx:1:
>>> /usr/include/x86_64-linux-gnu/bits/byteswap.h: In function 'unsigned int __bswap_32(unsigned int)':
>>> /usr/include/x86_64-linux-gnu/bits/byteswap.h:47: error: '__builtin_bswap32' was not declared in this scope
>>> /usr/include/x86_64-linux-gnu/bits/byteswap.h: In function '__uint64_t __bswap_64(__uint64_t)':
>>> /usr/include/x86_64-linux-gnu/bits/byteswap.h:111: error: '__builtin_bswap64' was not declared in this scope
>>> make[2]: *** [Wrapping/Modules/ITKCommon/vcl_complex.xml] Error 1
>>> make[1]: *** [Wrapping/Modules/ITKCommon/CMakeFiles/ITKCommonGccXML.dir/all] Error 2
>>> 
>>> Thanks
>>> Young
>>> 
>>> 
>>> _____________________________________
>>> Powered by www.kitware.com
>>> 
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>> 
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>> 
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Mon, 1 Jul 2013 09:20:02 +0100
> From: anna han wan <anna.han.wan at gmail.com>
> Subject: [Insight-users] Please help: Cannot open include file:
> 	'fltkLightButton.h', 'fltkImageViewer.h', ?errors when building
> 	GaussianFilter outside Insightapplications
> To: insight-users at itk.org
> Message-ID:
> 	<CAJx50C9SCYph6RuUtNVUAw3k2vc3ALB8GZgpXxU35uRj2x0pqg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi,
> 
> I want to build GaussianFilter application outside Insightapplications, so
> I followed Mr Luis instructions given in: *
> http://public.kitware.com/pipermail/insight-users/2003-December/005780.html*
> 
> I copied FltkImageViewer folder into the binary directory of my
> GaussianFilter. I manage to build successfully FltkImageViewer , however  when
> I build GaussianFilter I get the following errors:
> 
> 
> 
> Error      1              fatal error C1083: Cannot open include file:
> 'fltkLightButton.h': No such file or directory
> C:\Research\GaussianFilter\bin\liFilterConsoleGUI.h      8
> GaussianFilter
> 
> Error      2              fatal error C1083: Cannot open include file:
> 'fltkImageViewer.h': No such file or directory
> C:\Research\GaussianFilter\liFilterConsole.h      20
> GaussianFilter
> 
> Error      3              fatal error C1083: Cannot open include file:
> 'fltkLightButton.h': No such file or directory
> C:\Research\GaussianFilter\bin\liFilterConsole2DGUI.h                8
> GaussianFilter2D
> 
> Error      4              fatal error C1083: Cannot open include file:
> 'fltkImage2DViewer.h': No such file or directory
> C:\Research\GaussianFilter\liFilterConsole2D.h 20           GaussianFilter2D
> 
> Warning               5              warning C4996: 'std::copy': Function
> call with parameters that may be unsafe - this call relies on the caller to
> check that the passed values are correct. To disable this warning, use
> -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++
> 'Checked Iterators'
> c:\tools\itk-3.20.0\insighttoolkit-3.20.0\code\io\itkImageFileReader.txx
> 439
> GaussianFilter
> 
> Error      6              fatal error C1083: Cannot open include file:
> 'fltkImageViewer.h': No such file or directory
> C:\Research\GaussianFilter\liFilterConsole.h      20
> GaussianFilter
> 
> Warning               7              warning C4996: 'std::copy': Function
> call with parameters that may be unsafe - this call relies on the caller to
> check that the passed values are correct. To disable this warning, use
> -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++
> 'Checked Iterators'
> c:\tools\itk-3.20.0\insighttoolkit-3.20.0\code\io\itkImageFileReader.txx
> 439
> GaussianFilter2D
> 
> Error      8              fatal error C1083: Cannot open include file:
> 'fltkImage2DViewer.h': No such file or directory
> C:\Research\GaussianFilter\liFilterConsole2D.h 20           GaussianFilter2D
> 
> 
> 
> 
> 
> Can some one help please, I attach the CMakeLists.txt file for your
> attention.
> 
> Thank you very much,
> 
> 
> 
> Anna.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20130701/16fe3e79/attachment-0001.htm>
> -------------- next part --------------
> PROJECT(GaussianFilter)
> 
> # The fluid-generated fltk sources have many warnings.  This macro
> # will disable warnings for the generated files on some compilers.
> MACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS files)
>  IF(CMAKE_COMPILER_IS_GNUCXX)
>    FOREACH(f ${files})
>      STRING(REGEX REPLACE "\\.fl$" ".cxx" SRC "${f}")
>      STRING(REGEX REPLACE ".*/([^/]*)$" "\\1" SRC "${SRC}")
>      SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS -w)
>    ENDFOREACH(f)
>  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
> ENDMACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS)
> 
> # Macro for adding resources to GUI application on the Mac
> #
> IF(APPLE AND NOT FLTK_USE_X)
>    FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)
>    FIND_FILE(ITK_FLTK_RESOURCE mac.r /usr/local/include/FL)
>    IF(NOT ITK_FLTK_RESOURCE)
>      MESSAGE("Fltk resources not found, GUI application will not respond to
> mouse events")
>    ENDIF(NOT ITK_FLTK_RESOURCE)
> 
>    MACRO(ADD_GUI_EXECUTABLE name sources)
>      ADD_EXECUTABLE(${name} ${sources})
>      INSTALL_TARGETS(/bin ${name})
>      SET(EXEC_PATH ${EXECUTABLE_OUTPUT_PATH})
>      IF(NOT EXEC_PATH)
>        SET(EXEC_PATH ${CMAKE_CURRENT_BINARY_DIR})
>      ENDIF(NOT EXEC_PATH)
>        IF(ITK_APPLE_RESOURCE)
>          ADD_CUSTOM_COMMAND(SOURCE ${name}
>                             COMMAND ${ITK_APPLE_RESOURCE}
>                             ARGS -t APPL ${ITK_FLTK_RESOURCE} -o
>                             ${EXEC_PATH}/${name}
>                             TARGET ${name})
>        ENDIF(ITK_APPLE_RESOURCE)
>    ENDMACRO(ADD_GUI_EXECUTABLE)
> ELSE(APPLE AND NOT FLTK_USE_X)
>  MACRO(ADD_GUI_EXECUTABLE name sources)
>    ADD_EXECUTABLE(${name} ${sources})
>    INSTALL_TARGETS(/bin ${name})
>  ENDMACRO(ADD_GUI_EXECUTABLE)
> ENDIF(APPLE AND NOT FLTK_USE_X)
> 
> 
> INCLUDE_DIRECTORIES(
> ${FltkImageViewer_SOURCE_DIR} 
> ${FltkImageViewer_BINARY_DIR}
> ${GaussianFilter_SOURCE_DIR}
> ${GaussianFilter_BINARY_DIR}
> )
> 
> 
> 
> 
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
>  INCLUDE(${ITK_USE_FILE})
> ENDIF(ITK_FOUND)
> 
> 
> FIND_PACKAGE(VTK REQUIRED)
> IF(VTK_FOUND)
>  INCLUDE(${VTK_USE_FILE})
> ENDIF(VTK_FOUND)
> 
> 
> FIND_PACKAGE(FLTK REQUIRED)
> IF(FLTK_FOUND)
>  INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
> ENDIF(FLTK_FOUND)
> 
> SET(GaussianFilter_SRCS
>  liFilterConsole.cxx
>  liFilterConsoleBase.cxx
>  GaussianFilter.cxx
>  )
> 
> SET(GaussianFilter2D_SRCS
>  liFilterConsole2D.cxx
>  liFilterConsole2DBase.cxx
>  GaussianFilter2D.cxx
>  )
> 
> FLTK_WRAP_UI(GaussianFilter liFilterConsoleGUI.fl)
> FLTK_WRAP_UI(GaussianFilter2D liFilterConsole2DGUI.fl)
> 
> SET(GaussianFilter_SRCS
> ${GaussianFilter_SRCS}
> ${GaussianFilter_FLTK_UI_SRCS}
> )
> 
> SET(GaussianFilter2D_SRCS
> ${GaussianFilter2D_SRCS}
> ${GaussianFilter2D_FLTK_UI_SRCS}
> )
> 
> ADD_GUI_EXECUTABLE(GaussianFilter   "${GaussianFilter_SRCS}")
> ADD_GUI_EXECUTABLE(GaussianFilter2D "${GaussianFilter2D_SRCS}")
> 
> 
> ITK_DISABLE_FLTK_GENERATED_WARNINGS(GaussianFilter.cxx)
> ITK_DISABLE_FLTK_GENERATED_WARNINGS(liFilterConsole.cxx)
> ITK_DISABLE_FLTK_GENERATED_WARNINGS(liFilterConsoleGUI.cxx)
> ITK_DISABLE_FLTK_GENERATED_WARNINGS(liFilterConsole2D.cxx)
> ITK_DISABLE_FLTK_GENERATED_WARNINGS(liFilterConsole2DGUI.cxx)
> 
> TARGET_LINK_LIBRARIES(GaussianFilter ${FltkImageViewer} ITKIO ITKBasicFilters)
> TARGET_LINK_LIBRARIES(GaussianFilter2D ${FltkImageViewer} ITKIO ITKBasicFilters)
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Mon, 1 Jul 2013 10:35:54 +0200
> From: Alessandro <notinmyhead at gmail.com>
> Subject: [Insight-users] Exteding itkProcessObject
> To: Insight-users User <insight-users at itk.org>
> Message-ID: <AA3907CA-49C1-451B-BB95-FEB051C240C4 at gmail.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Hello,
> 
> I'm experiencing some issue trying to extend itk::ProcessObject class. Following some ITK example, I declared my new class as:
> 
> class myClass : public itk::ProcessObject
> {
> public:
>    itkNewMacro(myClass)
> 
>    itkTypeMacro(myClass, itk::ProcessObject)
> 
>    myClass();
>    ~myClass();
> 
>    std::string myExtraPublicMethod (std::string bla);
> ...
> }
> 
> The first issue arise if I instantiate myClass this way: 
> 
> myClass myClass_instance; 
> 
> As soon as the program close, I get this WARNING:
> WARNING: In <path>/InsightToolkit-4.3.1/Modules/Core/Common/src/itkLightObject.cxx, line 274
> LightObject (0x9434234): Trying to delete object with non-zero reference count.
> 
> So I figure out it could be some internal issue and I look for a dynamic allocation through smart pointers:
> 
> myClass::Pointer myclass_instance = myClass::New();
> 
> this way, at compilation time, no "extra" methods are recognized:  error: 'class itk::ProcessObject' has no member named 'myExtraPublicMethod'
> 
> What happened?
> 
> Alessandro
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Mon, 1 Jul 2013 09:49:53 -0400
> From: Jose Ignacio Prieto <joseignacio.prieto at gmail.com>
> Subject: [Insight-users] loading 4d dicom image
> To: insight-users at itk.org
> Message-ID:
> 	<CANkppu7TaPvLtHkG=8ivbBrU_fEZ09mf4aCmCb-TA7i4ComjMw at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi, I am trying to load a 4d image into ITK using gdcm libraries. They are
> a 4DFlow and a M2D Dicom created with a phillips resonator. I have both
> datasets in multiple files dicom and in enhanced dicom. I can load them as
> a 3d image now, with time changing in Z direction (all frames together for
> a single z position, and then the next slice in z direction again with all
> the frames), but i want the libaries to recognize it is a 4d, not a 3d. I
> have tried to load every volume separated by the tag 0018|1060, but it
> would be a vector of volumes and not a 4d matrix. And I don't know how to
> make it for enhanced dicom. What would be the best approach??
> Thanks!
> 
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkGDCMImageIO.h"
> #include "itkGDCMSeriesFileNames.h"
> #include "itkImageSeriesReader.h"
> #include "itkImageFileWriter.h"
> #include <itkImageToVTKImageFilter.h>
> #include <itkExtractImageFilter.h>
> 
> typedef unsigned short    PixelType;
> typedef itk::Image< PixelType, Dimension3>         ImageType3D;
> typedef itk::Image< PixelType, Dimension4 >         ImageType;
> typedef itk::ImageSeriesReader< ImageType >        ReaderType;
> typedef itk::GDCMSeriesFileNames NamesGeneratorType;
> typedef std::vector< std::string >   FileNamesContainer;
> typedef itk::GDCMImageIO       ImageIOType;
> typedef std::vector< std::string >    SeriesIdContainer;
> 
> const unsigned int      Dimension3 = 3;
> const unsigned int      Dimension4 = 4;
> ReaderType::Pointer reader = ReaderType::New();
> ImageIOType::Pointer dicomIO = ImageIOType::New();
> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
> FileNamesContainer fileNames;
> std::string seriesIdentifier;
> 
> reader->SetImageIO( dicomIO );
> nameGenerator->SetDirectory( argv[9]);
> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();
> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
> SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();
> seriesIdentifier = seriesUID.begin()->c_str();
> fileNames = nameGenerator->GetFileNames( seriesIdentifier );
> reader->SetFileNames( fileNames );
> reader->Update();
> 
> 
> -- 
> Jos? Ignacio Prieto
> celular(nuevo): 94348182
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20130701/2db1a85e/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 6
> Date: Mon, 1 Jul 2013 15:59:29 +0200
> From: Alessandro <notinmyhead at gmail.com>
> Subject: Re: [Insight-users] loading 4d dicom image
> To: Insight-users User <insight-users at itk.org>
> Message-ID: <85CE7603-0AE8-4213-BD06-E950762841AA at gmail.com>
> Content-Type: text/plain; charset=iso-8859-1
> 
> Using this iterators (seriesItr and seriesEnd), you should be able to loop and set a vector of images (such as typedef std::vector < ImageType3D >  4dVector) by loading one volume after another.
> 
> In your code, you only read the first volume by setting the filenames into ImageSeriesReader object...
> 
> 
> Il giorno 01/lug/2013, alle ore 15.49, Jose Ignacio Prieto ha scritto:
> 
>> Hi, I am trying to load a 4d image into ITK using gdcm libraries. They are a 4DFlow and a M2D Dicom created with a phillips resonator. I have both datasets in multiple files dicom and in enhanced dicom. I can load them as a 3d image now, with time changing in Z direction (all frames together for a single z position, and then the next slice in z direction again with all the frames), but i want the libaries to recognize it is a 4d, not a 3d. I have tried to load every volume separated by the tag 0018|1060, but it would be a vector of volumes and not a 4d matrix. And I don't know how to make it for enhanced dicom. What would be the best approach??
>> Thanks!
>> 
>> #include "itkImage.h"
>> #include "itkImageFileReader.h"
>> #include "itkImageFileWriter.h"
>> #include "itkGDCMImageIO.h"
>> #include "itkGDCMSeriesFileNames.h"
>> #include "itkImageSeriesReader.h"
>> #include "itkImageFileWriter.h"
>> #include <itkImageToVTKImageFilter.h>
>> #include <itkExtractImageFilter.h>
>> 
>> typedef unsigned short    PixelType;
>> typedef itk::Image< PixelType, Dimension3>         ImageType3D;
>> typedef itk::Image< PixelType, Dimension4 >         ImageType;
>> typedef itk::ImageSeriesReader< ImageType >        ReaderType;
>> typedef itk::GDCMSeriesFileNames NamesGeneratorType;
>> typedef std::vector< std::string >   FileNamesContainer;
>> typedef itk::GDCMImageIO       ImageIOType;
>> typedef std::vector< std::string >    SeriesIdContainer;
>> 
>> const unsigned int      Dimension3 = 3;
>> const unsigned int      Dimension4 = 4;
>> ReaderType::Pointer reader = ReaderType::New();
>> ImageIOType::Pointer dicomIO = ImageIOType::New();
>> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
>> FileNamesContainer fileNames;
>> std::string seriesIdentifier;
>> 
>> reader->SetImageIO( dicomIO );
>> nameGenerator->SetDirectory( argv[9]);
>> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();
>> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
>> SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();
>> seriesIdentifier = seriesUID.begin()->c_str();
>> fileNames = nameGenerator->GetFileNames( seriesIdentifier );
>> reader->SetFileNames( fileNames );
>> reader->Update();
>> 
>> 
>> -- 
>> Jos? Ignacio Prieto
>> celular(nuevo): 94348182
>> _____________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
> 
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Mon, 1 Jul 2013 10:09:11 -0400
> From: Jose Ignacio Prieto <joseignacio.prieto at gmail.com>
> Subject: Re: [Insight-users] loading 4d dicom image
> To: Alessandro <notinmyhead at gmail.com>
> Cc: Insight-users User <insight-users at itk.org>
> Message-ID:
> 	<CANkppu5hL7ANCDdob2AfiKPr=B71Q7T_gCiBO=dQmVNn7x1_rA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> ok, but i don't want a vector of images. I want to have a 4d matrix so I
> can do segmentation through time
> 
> 
> On Mon, Jul 1, 2013 at 9:59 AM, Alessandro <notinmyhead at gmail.com> wrote:
> 
>> Using this iterators (seriesItr and seriesEnd), you should be able to loop
>> and set a vector of images (such as typedef std::vector < ImageType3D >
>> 4dVector) by loading one volume after another.
>> 
>> In your code, you only read the first volume by setting the filenames into
>> ImageSeriesReader object...
>> 
>> 
>> Il giorno 01/lug/2013, alle ore 15.49, Jose Ignacio Prieto ha scritto:
>> 
>>> Hi, I am trying to load a 4d image into ITK using gdcm libraries. They
>> are a 4DFlow and a M2D Dicom created with a phillips resonator. I have both
>> datasets in multiple files dicom and in enhanced dicom. I can load them as
>> a 3d image now, with time changing in Z direction (all frames together for
>> a single z position, and then the next slice in z direction again with all
>> the frames), but i want the libaries to recognize it is a 4d, not a 3d. I
>> have tried to load every volume separated by the tag 0018|1060, but it
>> would be a vector of volumes and not a 4d matrix. And I don't know how to
>> make it for enhanced dicom. What would be the best approach??
>>> Thanks!
>>> 
>>> #include "itkImage.h"
>>> #include "itkImageFileReader.h"
>>> #include "itkImageFileWriter.h"
>>> #include "itkGDCMImageIO.h"
>>> #include "itkGDCMSeriesFileNames.h"
>>> #include "itkImageSeriesReader.h"
>>> #include "itkImageFileWriter.h"
>>> #include <itkImageToVTKImageFilter.h>
>>> #include <itkExtractImageFilter.h>
>>> 
>>> typedef unsigned short    PixelType;
>>> typedef itk::Image< PixelType, Dimension3>         ImageType3D;
>>> typedef itk::Image< PixelType, Dimension4 >         ImageType;
>>> typedef itk::ImageSeriesReader< ImageType >        ReaderType;
>>> typedef itk::GDCMSeriesFileNames NamesGeneratorType;
>>> typedef std::vector< std::string >   FileNamesContainer;
>>> typedef itk::GDCMImageIO       ImageIOType;
>>> typedef std::vector< std::string >    SeriesIdContainer;
>>> 
>>> const unsigned int      Dimension3 = 3;
>>> const unsigned int      Dimension4 = 4;
>>> ReaderType::Pointer reader = ReaderType::New();
>>> ImageIOType::Pointer dicomIO = ImageIOType::New();
>>> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
>>> FileNamesContainer fileNames;
>>> std::string seriesIdentifier;
>>> 
>>> reader->SetImageIO( dicomIO );
>>> nameGenerator->SetDirectory( argv[9]);
>>> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();
>>> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
>>> SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();
>>> seriesIdentifier = seriesUID.begin()->c_str();
>>> fileNames = nameGenerator->GetFileNames( seriesIdentifier );
>>> reader->SetFileNames( fileNames );
>>> reader->Update();
>>> 
>>> 
>>> --
>>> Jos? Ignacio Prieto
>>> celular(nuevo): 94348182
>>> _____________________________________
>>> Powered by www.kitware.com
>>> 
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>> 
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>> 
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>> 
>> _____________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>> 
> 
> 
> 
> -- 
> Jos? Ignacio Prieto
> celular(nuevo): 94348182
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20130701/6b2f527b/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 8
> Date: Mon, 1 Jul 2013 07:24:34 -0700 (PDT)
> From: marianabb <marianabb at gmail.com>
> Subject: Re: [Insight-users] Reading multi-frame 2D+time DICOM files
> To: insight-users at itk.org
> Message-ID: <1372688674874-7583407.post at n2.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Hello!
> 
> I spoke to the nice people at gdcm-developers forum. They checked the GDCM
> code and made some changes in order to handle this type of files correctly.
> 
> The version of GDCM that is now on their git repository (git/release or
> git/master) works for me.
> 
> 
> Best regards,
> --
> Mariana
> 
> 
> 
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Reading-multi-frame-2D-time-DICOM-files-tp7583206p7583407.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> 
> 
> ------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 
> End of Insight-users Digest, Vol 111, Issue 1
> *********************************************

Nicola Amoroso
Dipartimento di Fisica
Università degli studi di Bari  "Aldo Moro"
Istituto di Fisica Nucleare (Bari)

tel. 080 5442391





More information about the Insight-users mailing list