[Insight-users] ITK to VTK for 4D images

Andriy Fedorov fedorov at bwh.harvard.edu
Mon Apr 23 10:46:34 EDT 2012


Mathieu,

I can't answer you specific question, but if you just need to
visualize a 4D dataset, you might look into this module in 3D Slicer:

http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/MultiVolumeExplorer

If you have any questions about this functionality, please post to
Slicer user list
(http://massmail.bwh.harvard.edu/mailman/listinfo/slicer-users)

AF



> Date: Mon, 23 Apr 2012 14:22:52 +0200
> From: Mathieu Stumpf <mathieu.stumpf at etu.unistra.fr>
> Subject: [Insight-users] ITK to VTK for 4D images
> To: insight-users at itk.org
> Message-ID: <1335183772.3235.204.camel at mivstg2011a.u-strasbg.fr>
> Content-Type: text/plain; charset="UTF-8"
>
> Hello,
>
> I'm seeking information to open (with python) a 4D image with ITK and
> visualize it with the help of VTK.
>
> I followed several tracks but nothing which works until now.
>
> # ConnectVTKITK used in the Examples directory
>
> I first found an example using ConnectVTKITK  in
> ${itk-src}/Examples/Visualization/CannyEdgeDetectionImageFilterConnectVTKITK.py
>
> I didn't manage to install InsightApplications yet. InsightApplications
> provides ConnectVTKITK, but here is my problem :
>
>  CMake Warning at ConnectVTKITK/CMakeLists.txt:11 (FIND_PACKAGE):
>   Could not find module FindCableSwig.cmake or a configuration file for
>   package CableSwig.
>
>   Adjust CMAKE_MODULE_PATH to find FindCableSwig.cmake or set CableSwig_DIR
>   to the directory containing a CMake configuration file for CableSwig.  The
>   file will have one of the following names:
>
>     CableSwigConfig.cmake
>     cableswig-config.cmake
>
> I downloaded CableSwig, but didn't find such a file.
>
> Moreover the ITK documentation say[1] :
>        Note that not all image types will work correctly. VTK will only
>        support images of 1, 2, or 3 dimensions. Scalar value types can
>        be one of: float, double, char, unsigned char, short, unsigned
>        short, int, unsigned int, long, unsigned long.
>
> As I need to visualize 4D images, maybe it's not the way to go anyway.
> Is the documentation right? As far as I understand, VTK enable to
> visualize tractographies and so on, so does it mean that it's the
> conversion which is not provided through this way ?
>
> [1] http://www.itk.org/Doxygen/html/classitk_1_1VTKImageExport.html
>
> # Conversion from a C++ wiki example
>
> Following a wiki page[2], I wrote a python code which provide a vtk
> image with itk filters :
> [2] http://www.itk.org/Wiki/ITK/Examples/IO/ImageToVTKImageFilter
>
>        InputImageType = itk.Image.SS3
>        reader = itk.ImageFileReader[InputImageType].New()
>        reader.SetFileName(str(file_path)) # str() to avoid a wrapper bug
>
>        # itk->vtk conversion
>        connector = itk.ImageToVTKImageFilter[InputImageType].New()
>        connector.SetInput(reader.GetOutput())
>        connector.Update()
>        self.vtk_image = connector.GetOutput()
>
> Well, it provide a vtkImageData (I checked with a print), but using it
> instead of my previous solution using SimpleITK make my application
> crash, without any debugging information. The previous working solution
> being :
>
>        self.sitk_image = sitk.ReadImage(str(file_path) )
>        self.numpy_img = sitk.GetArrayFromImage( self.sitk_image )
>        n2vtk = vtkImageImportFromArray() # Converter
>        n2vtk.SetArray(self.numpy_img)
>        n2vtk.Update()
>        self.vtk_image = n2vtk.GetOutput()
>
> I welcome any suggestion
> kind regards,
> mathieu
>
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 23 Apr 2012 15:27:31 +0300
> From: Hila Hiler <hilahiler at gmail.com>
> Subject: [Insight-users] container for iterators of images
> To: insight-users at itk.org
> Message-ID:
>        <CACeyOhZBunJbJ_VnS7K9w5wkwhRYgTtPDyhE2DyxkD0DabfO8A at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi All,
>
> I'd like to generate a new image by summarizing some other images in the
> same dimensions.
> So I generated a new image and a std::list for the images iterators.
> (actually, I thought that this dynamic container is the best way to mange
> an unknown number of images)
>
> For now, it isn't working because I don't know how to forward the image's
> iterator from that vector. in other words, how do I do the same as:
> output_it++ from a vector?
>
> Here is my code:
>
>    typedef itk::ImageRegionIterator            <ImageType>
> iteratorType;
>    typedef itk::ImageRegionConstIterator    <ImageType>
> constIteratorType;
>
>    constIteratorType    first_it    (first_img,
> first_img->GetRequestedRegion());
>    iteratorType            output_it (output_img, output_img->
> GetRequestedRegion());
>
>    std::list<constIteratorType> list;
>    std::list<constIteratorType>::iterator it;
>
>    list.push_back(first_it);
>
>    if (second_img.IsNotNull())
>    {
>        constIteratorType second_it (second_img,
> second_img->GetRequestedRegion());
>        list.push_back (second_it);
>    }
>
>    //initialize all the iterators at the begin of input images
>    for(it = list.begin(); it < list.end(); it++)
>    {
>        it->GoToBegin();
>    }
>
>    for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)
>    {
>        for(it = list.begin(); it < list.end(); it++)//move on the images
> and get at each iteration the pixel value and insert to the new image
>        {
>            output_val = it->Get() + output_val;  //get values from each
> image and insert in the output image
>            // How do I forward the image's iterator from here ?????
>        }
>
>        output_it.Set(output_val);
>
>    }
>
>
>
> Any thoughts would be very welcome ...
> Hila
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/e8ed02e2/attachment-0001.htm>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 23 Apr 2012 18:38:48 +0530
> From: alex Dowson <alexdowson at hotmail.com>
> Subject: Re: [Insight-users] container for iterators of images
> To: "Hila Hiler" <hilahiler at gmail.com>, <insight-users at itk.org>
> Message-ID: <SNT138-ds7355B3D7696780271FD67D1210 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi
>
> Look at this examples
>
>
> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator
> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator
>
>
>
>
>
>
>
> From: Hila Hiler
> Sent: Monday, April 23, 2012 5:57 PM
> To: insight-users at itk.org
> Subject: [Insight-users] container for iterators of images
>
> Hi All,
>
> I'd like to generate a new image by summarizing some other images in the same dimensions.
> So I generated a new image and a std::list for the images iterators. (actually, I thought that this dynamic container is the best way to mange an unknown number of images)
>
> For now, it isn't working because I don't know how to forward the image's iterator from that vector. in other words, how do I do the same as: output_it++ from a vector?
>
> Here is my code:
>
>    typedef itk::ImageRegionIterator            <ImageType>            iteratorType;
>    typedef itk::ImageRegionConstIterator    <ImageType>            constIteratorType;
>
>    constIteratorType    first_it    (first_img, first_img->GetRequestedRegion());
>    iteratorType            output_it (output_img, output_img-> GetRequestedRegion());
>
>    std::list<constIteratorType> list;
>    std::list<constIteratorType>::iterator it;
>
>    list.push_back(first_it);
>
>    if (second_img.IsNotNull())
>    {
>        constIteratorType second_it (second_img, second_img->GetRequestedRegion());
>        list.push_back (second_it);
>    }
>
>    //initialize all the iterators at the begin of input images
>    for(it = list.begin(); it < list.end(); it++)
>    {
>        it->GoToBegin();
>    }
>
>    for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)
>    {
>        for(it = list.begin(); it < list.end(); it++)//move on the images and get at each iteration the pixel value and insert to the new image
>        {
>            output_val = it->Get() + output_val;  //get values from each image and insert in the output image
>            // How do I forward the image's iterator from here ?????
>        }
>
>        output_it.Set(output_val);
>
>    }
>
>
>
> Any thoughts would be very welcome ...
> Hila
>
>
>
> --------------------------------------------------------------------------------
> _____________________________________
> 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
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/4a6a6430/attachment-0001.htm>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 23 Apr 2012 15:40:13 +0200
> From: Kerstin M?ller <kerstin.mueller612 at googlemail.com>
> Subject: [Insight-users] Question regarding
>        itkNormalizedMutualInformationHistogramImageToImageMetric
> To: insight-users <insight-users at itk.org>
> Message-ID:
>        <CANvchAoXZQZrWjxtEhWDG4TQLtD5LvUj2X3B+rAD_vHnBV5WzQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello everybody,
>
> I want to compute the NMI with the
> itkNormalizedMutualInformationHistogramImageToImageMetric, unfortunately I
> do not have access to the book which is referenced that's why I'm posting
> my question here. What's the range of this NMI? I thought it would be 0 - 1
> but it's not, if I insert the same image the metric measure is 2 and if i
> insert complete different images it is not 0.
> Can someone comment on that?
>
> Thank you very much,
>
> Kerstin
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/6ff2c456/attachment-0001.htm>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 23 Apr 2012 16:45:18 +0300
> From: Hila Hiler <hilahiler at gmail.com>
> Subject: Re: [Insight-users] container for iterators of images
> To: alex Dowson <alexdowson at hotmail.com>
> Cc: insight-users at itk.org
> Message-ID:
>        <CACeyOhY4mKNTQwEa9i0dp2ijKaA-M6cE18tH=ofRtVEAGcF=PA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Alex,
> first of all, many thanks for the response.
>
> I'm afraid that you haven't noticed that I did the same as described in
> your link (it was the easy part) ...
> Actually my question was about a vector of iterators to itk images.
> Please, read my attached code. I'll be pleased to understand what have I
> missed.
>
> Regards,
> Hila
>
>
> On Mon, Apr 23, 2012 at 4:08 PM, alex Dowson <alexdowson at hotmail.com> wrote:
>
>>   Hi
>>
>> Look at this examples
>>
>>
>> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator
>> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator
>>
>>
>>
>>
>>
>>
>>
>>  *From:* Hila Hiler <hilahiler at gmail.com>
>> *Sent:* Monday, April 23, 2012 5:57 PM
>> *To:* insight-users at itk.org
>> *Subject:* [Insight-users] container for iterators of images
>>
>>  Hi All,
>>
>> I'd like to generate a new image by summarizing some other images in the
>> same dimensions.
>> So I generated a new image and a std::list for the images iterators.
>> (actually, I thought that this dynamic container is the best way to mange
>> an unknown number of images)
>>
>> For now, it isn't working because I don't know how to forward the image's
>> iterator from that vector. in other words, how do I do the same as:
>> output_it++ from a vector?
>>
>> Here is my code:
>>
>>     typedef itk::ImageRegionIterator            <ImageType>
>> iteratorType;
>>     typedef itk::ImageRegionConstIterator    <ImageType>
>> constIteratorType;
>>
>>     constIteratorType    first_it    (first_img,
>> first_img->GetRequestedRegion());
>>     iteratorType            output_it (output_img, output_img->
>> GetRequestedRegion());
>>
>>     std::list<constIteratorType> list;
>>     std::list<constIteratorType>::iterator it;
>>
>>     list.push_back(first_it);
>>
>>     if (second_img.IsNotNull())
>>     {
>>         constIteratorType second_it (second_img,
>> second_img->GetRequestedRegion());
>>         list.push_back (second_it);
>>     }
>>
>>     //initialize all the iterators at the begin of input images
>>     for(it = list.begin(); it < list.end(); it++)
>>     {
>>         it->GoToBegin();
>>     }
>>
>>     for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)
>>     {
>>         for(it = list.begin(); it < list.end(); it++)//move on the images
>> and get at each iteration the pixel value and insert to the new image
>>         {
>>             output_val = it->Get() + output_val;  //get values from each
>> image and insert in the output image
>>             // How do I forward the image's iterator from here ?????
>>         }
>>
>>         output_it.Set(output_val);
>>
>>     }
>>
>>
>>
>> Any thoughts would be very welcome ...
>> Hila
>>
>> ------------------------------
>> _____________________________________
>> 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
>>
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/7e2f6af9/attachment-0001.htm>
>
> ------------------------------
>
> Message: 9
> Date: Mon, 23 Apr 2012 09:46:32 -0400
> From: Brad King <brad.king at kitware.com>
> Subject: Re: [Insight-users] Maintenance branch for the 3.20 series
> To: Matt McCormick <matt.mccormick at kitware.com>
> Cc: insight-users at itk.org, ITK <insight-developers at itk.org>,    Vivien
>        Delmon <vivien.delmon at creatis.insa-lyon.fr>
> Message-ID: <4F955D38.5000409 at kitware.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 4/23/2012 3:19 AM, Matt McCormick wrote:
>> A patch has been submitted to build ITK 3.20.1 with GCC 4.7   Although
>> there will not be any more feature releases for the 3-series, it would
>> be good to start a branch for bug fixes.  What is a preferred name for
>> this branch?  3-20-maint?
>
> http://www.itk.org/pipermail/insight-developers/2011-December/021000.html
>
> -Brad
>
>
> ------------------------------
>
> Message: 10
> Date: Mon, 23 Apr 2012 19:21:36 +0530
> From: alex Dowson <alexdowson at hotmail.com>
> Subject: Re: [Insight-users] container for iterators of images
> To: "Hila Hiler" <hilahiler at gmail.com>
> Cc: insight-users at itk.org
> Message-ID: <SNT138-ds6FDFD9DAF88BBD9849CE1D1210 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi
>
> I think I still did not understand your problem completely .  Why you want to store image in container ?  Can you describe what exactly you trying to do ?
>
>
> Alex
>
>
> From: Hila Hiler
> Sent: Monday, April 23, 2012 7:15 PM
> To: alex Dowson
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] container for iterators of images
>
> Hi Alex,
> first of all, many thanks for the response.
>
> I'm afraid that you haven't noticed that I did the same as described in your link (it was the easy part) ...
> Actually my question was about a vector of iterators to itk images.
> Please, read my attached code. I'll be pleased to understand what have I missed.
>
> Regards,
> Hila
>
>
>
> On Mon, Apr 23, 2012 at 4:08 PM, alex Dowson <alexdowson at hotmail.com> wrote:
>
>  Hi
>
>  Look at this examples
>
>
>  http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator
>  http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator
>
>
>
>
>
>
>
>  From: Hila Hiler
>  Sent: Monday, April 23, 2012 5:57 PM
>  To: insight-users at itk.org
>  Subject: [Insight-users] container for iterators of images
>
>  Hi All,
>
>  I'd like to generate a new image by summarizing some other images in the same dimensions.
>  So I generated a new image and a std::list for the images iterators. (actually, I thought that this dynamic container is the best way to mange an unknown number of images)
>
>  For now, it isn't working because I don't know how to forward the image's iterator from that vector. in other words, how do I do the same as: output_it++ from a vector?
>
>  Here is my code:
>
>      typedef itk::ImageRegionIterator            <ImageType>            iteratorType;
>      typedef itk::ImageRegionConstIterator    <ImageType>            constIteratorType;
>
>      constIteratorType    first_it    (first_img, first_img->GetRequestedRegion());
>      iteratorType            output_it (output_img, output_img-> GetRequestedRegion());
>
>      std::list<constIteratorType> list;
>      std::list<constIteratorType>::iterator it;
>
>      list.push_back(first_it);
>
>      if (second_img.IsNotNull())
>      {
>          constIteratorType second_it (second_img, second_img->GetRequestedRegion());
>          list.push_back (second_it);
>      }
>
>      //initialize all the iterators at the begin of input images
>      for(it = list.begin(); it < list.end(); it++)
>      {
>          it->GoToBegin();
>      }
>
>      for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)
>      {
>          for(it = list.begin(); it < list.end(); it++)//move on the images and get at each iteration the pixel value and insert to the new image
>          {
>              output_val = it->Get() + output_val;  //get values from each image and insert in the output image
>              // How do I forward the image's iterator from here ?????
>          }
>
>          output_it.Set(output_val);
>
>      }
>
>
>
>  Any thoughts would be very welcome ...
>  Hila
>
>
> ------------------------------------------------------------------------------
>  _____________________________________
>  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
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/d38ea26d/attachment-0001.htm>
>
> ------------------------------
>
> Message: 11
> Date: Mon, 23 Apr 2012 10:29:24 -0400
> From: Bradley Lowekamp <blowekamp at mail.nih.gov>
> Subject: Re: [Insight-users] ITK 4.1.0 Build problems with JOM
> To: Rupert Brooks <rupert.brooks at gmail.com>
> Cc: "insight-users at itk.org" <insight-users at itk.org>
> Message-ID: <82CD1C0C-698A-4EB8-BEAE-3BB575BFB1ED at mail.nih.gov>
> Content-Type: text/plain; charset="us-ascii"
>
> Thanks for reporting the issue.
>
> As for your VS2005 issue, we have realized that the itk Header tests generate too many targets for certain Visual Studio IDE. These are defined in the file CMake/ITKModuleHeaderTest.cmake. The tests have been excluded for VS2010, from your report is sounds like they should be excluded from 2005 ( VS8 ) as well.  Currently if testing is disabled then these HeaderTests will also be disabled, so I would suspect that this IDE would be stable for you. Have you tested that?
>
> I have not heard for JOM before. Hopefully, someone else will chime in on that ticket.
>
> Brad
>
>
> On Apr 20, 2012, at 5:28 PM, Rupert Brooks wrote:
>
>> Done.  Issue # ITK ITK-2919
>>
>> Once again, im happy to take a shot at fixing it if someone can give
>> me a pointer where to start looking. I realize theres probably not a
>> lot of Visual 2005/JOM users out there. What macros create the
>> ITKTargets.cmake file?
>>
>> Have a good weekend
>> Rupert
>> --------------------------------------------------------------
>> Rupert Brooks
>> rupert.brooks at gmail.com
>>
>>
>>
>> On Fri, Apr 20, 2012 at 16:07, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
>>> Hello Rupert,
>>>
>>> Could you please report this issue into the ITK issue tracker:
>>>
>>> http://issues.itk.org
>>>
>>>
>>> Thanks,
>>> Brad
>>>
>>> On Apr 20, 2012, at 1:22 PM, Rupert Brooks wrote:
>>>
>>> Hi everyone,
>>>
>>> I'm trying to use itk 4.1.0 using Visual Studio 2005, in 32 bit.  The
>>> IDE is very unstable (read, unusuable) due to the number of projects
>>> that are created, a problem thats been noted here before.  To work
>>> around this, i started using JOM, which is a multithreaded NMake
>>> clone.  It seems to build faster anyway.
>>>
>>> ITK4.1.0 builds fine with JOM, however, I cant link any projects
>>> against it.  They fail to find some libraries, because the name of the
>>> library set by the FindITK Cmake process is incorrect.
>>>
>>> This seems to be because the ITKTargets.cmake has errors.
>>> Specifically, when building with JOM, there are no entries in the
>>> ITKTargets.cmake corresponding to some, but not all of the ITK
>>> Libraries.  These entries are necessary because they tag the -4.1
>>> extension on the name of the library. So with JOM, some get put in,
>>> and some dont.
>>>
>>> I find it particularly strange how all the libraries get passed
>>> through correctly for Visual Studio, but only some do for JOM.  If
>>> they all failed to pass through it would be easier to understand.
>>>
>>> I am having trouble parsing the maze of CMake commands that actually
>>> ends up setting this filename to determine what is the difference
>>> between the modules that work and those that dont.  I dont mind
>>> debugging more if somebody could give me a pointer where to look.
>>>
>>> The list of ITK Libraries follows.  As you can see - some but not all
>>> get put into the ITKTargets.cmake.  Those that dont end up with just
>>> the lib name.
>>>
>>> Cheers,
>>> Rupert
>>>
>>>
>>> E:\ext\ITK-4.1.0-R\lib\itksys-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\itkvnl_algo-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\itkvnl-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\itkv3p_netlib-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\ITKCommon-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\itkNetlibSlatec-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\ITKStatistics-4.1.lib
>>> ITKIOImageBase.lib
>>> ITKIOBMP.lib
>>> ITKIOBioRad.lib
>>> ITKEXPAT.lib
>>> itkopenjpeg.lib
>>> itkzlib.lib
>>> gdcmDICT.lib
>>> gdcmMSFF.lib
>>> ITKIOGDCM.lib
>>> ITKIOGIPL.lib
>>> itkjpeg.lib
>>> ITKIOJPEG.lib
>>> itktiff.lib
>>> ITKIOTIFF.lib
>>> ITKIOLSM.lib
>>> ITKMetaIO.lib
>>> ITKIOMeta.lib
>>> ITKznz.lib
>>> ITKniftiio.lib
>>> ITKIONIFTI.lib
>>> ITKNrrdIO.lib
>>> ITKIONRRD.lib
>>> itkpng.lib
>>> ITKIOPNG.lib
>>> ITKIOStimulate.lib
>>> ITKIOVTK.lib
>>> ITKMesh.lib
>>> ITKSpatialObjects.lib
>>> ITKPath.lib
>>> ITKLabelMap.lib
>>> ITKQuadEdgeMesh.lib
>>> ITKOptimizers.lib
>>> ITKPolynomials.lib
>>> ITKBiasCorrection.lib
>>> ITKBioCell.lib
>>> ITKFFT.lib
>>> ITKDICOMParser.lib
>>> ITKIOXML.lib
>>> ITKIOSpatialObjects.lib
>>> ITKFEM.lib
>>> ITKIOIPL.lib
>>> ITKIOGE.lib
>>> ITKIOSiemens.lib
>>> ITKKLMRegionGrowing.lib
>>> ITKVTK.lib
>>> ITKWatersheds.lib
>>> ITKDeprecated.lib
>>> ITKgiftiio.lib
>>> ITKIOMesh.lib
>>> itkhdf5_cpp.lib
>>> itkhdf5.lib
>>> ITKIOCSV.lib
>>> ITKIOHDF5.lib
>>> ITKIOTransformBase.lib
>>> ITKIOTransformHDF5.lib
>>> ITKIOTransformInsightLegacy.lib
>>> ITKIOTransformMatlab.lib
>>> ITKOptimizersv4.lib
>>> ITKReview.lib
>>> ITKVideoCore.lib
>>> ITKVideoIO.lib
>>> ITKVideoBridgeOpenCV.lib
>>> ws2_32.lib
>>> E:\ext\ITK-4.1.0-R\lib\ITKVNLInstantiation-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\itkv3p_lsqr-4.1.lib
>>> E:\ext\ITK-4.1.0-R\lib\itkvcl-4.1.lib
>>>
>>> --------------------------------------------------------------
>>> Rupert Brooks
>>> rupert.brooks at gmail.com
>>> _____________________________________
>>> 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
>>>
>>>
>>> ========================================================
>>>
>>> Bradley Lowekamp
>>>
>>> Medical Science and Computing for
>>>
>>> Office of High Performance Computing and Communications
>>>
>>> National Library of Medicine
>>>
>>> blowekamp at mail.nih.gov
>>>
>>>
>>>
>>>
>
> ========================================================
> Bradley Lowekamp
> Medical Science and Computing for
> Office of High Performance Computing and Communications
> National Library of Medicine
> blowekamp at mail.nih.gov
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/62c6ec28/attachment-0001.htm>
>
> ------------------------------
>
> Message: 12
> Date: Mon, 23 Apr 2012 17:40:39 +0300
> From: Hila Hiler <hilahiler at gmail.com>
> Subject: Re: [Insight-users] container for iterators of images
> To: alex Dowson <alexdowson at hotmail.com>
> Cc: insight-users at itk.org
> Message-ID:
>        <CACeyOhadt2S1Vbz255DbV_x80XvYBy-t9ZAGEcB6wAh96c-zSw at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thank you for your interest.
>
> I'll try to explain it as clear as I can...
> The major goal is to generate an image which any of its pixel is the sum of
> other images corresponding pixels.
> For example: any pixel of the new image should be the sum of the
> corresponding pixels from the other images (im1(pix) = im2(pix)+im3(pix)).
> Note that because I don't know in advance the number of the input images, I
> created a STL container to store the iterators of the images. I chose this
> way in because later I can increment all the iterators in one loop (until
> the end of the container) ...
>
> So, back to my code:
>
> vector of iterators:
> | it_1 | it_2 | ... | it_n |
>
> // iterators for the n input images
> constIteratorType  it_1 (img_1, img_1->GetRequestedRegion());
> constIteratorType  it_2 (img_2, img_2->GetRequestedRegion());
> ...
> constIteratorType  it_n (img_n, img_n->GetRequestedRegion());
>
> //iterator of the output image
> iteratorType          output_it (output_img, output_img->
> GetRequestedRegion());
>
> //container to store the iterators
> std::list<constIteratorType> list;
> std::list<constIteratorType>::iterator it;
>
> // iterator of the list that suppose to initialize all of the iterators
> (it_1, it_2, etc)
>    for(it = list.begin(); it < list.end(); it++)
>    {
>        it->GoToBegin();
>    }
>
> //move in parallel with all of the input images and set in the output image
> the sum of the corresponding images pixel
>    for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)
>    {
>            output_val = 0;
>        for (it = list.begin(); it < list.end(); it++) //move on each image
> in the list and get it's pixel value
>        {
>            output_val = it->Get() + output_val;  //get values from each
> image and insert in the output image
>            // How do I forward the image's iterator from here ?????
>        }
>        output_it.Set(output_val);
>    }
>
> Hope that now it's clearer ...
>
> Hila
>
>
>
> On Mon, Apr 23, 2012 at 4:51 PM, alex Dowson <alexdowson at hotmail.com> wrote:
>
>>   Hi
>>
>> I think I still did not understand your problem completely .  Why you want
>> to store image in container ?  Can you describe what exactly you trying to
>> do ?
>>
>>
>> Alex
>>
>>
>>  *From:* Hila Hiler <hilahiler at gmail.com>
>> *Sent:* Monday, April 23, 2012 7:15 PM
>> *To:* alex Dowson <alexdowson at hotmail.com>
>> *Cc:* insight-users at itk.org
>> *Subject:* Re: [Insight-users] container for iterators of images
>>
>>  Hi Alex,
>> first of all, many thanks for the response.
>>
>> I'm afraid that you haven't noticed that I did the same as described in
>> your link (it was the easy part) ...
>> Actually my question was about a vector of iterators to itk images.
>> Please, read my attached code. I'll be pleased to understand what have I
>> missed.
>>
>> Regards,
>> Hila
>>
>>
>> On Mon, Apr 23, 2012 at 4:08 PM, alex Dowson <alexdowson at hotmail.com>wrote:
>>
>>>   Hi
>>>
>>> Look at this examples
>>>
>>>
>>> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator
>>> http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  *From:* Hila Hiler <hilahiler at gmail.com>
>>> *Sent:* Monday, April 23, 2012 5:57 PM
>>> *To:* insight-users at itk.org
>>> *Subject:* [Insight-users] container for iterators of images
>>>
>>>   Hi All,
>>>
>>> I'd like to generate a new image by summarizing some other images in the
>>> same dimensions.
>>> So I generated a new image and a std::list for the images iterators.
>>> (actually, I thought that this dynamic container is the best way to mange
>>> an unknown number of images)
>>>
>>> For now, it isn't working because I don't know how to forward the image's
>>> iterator from that vector. in other words, how do I do the same as:
>>> output_it++ from a vector?
>>>
>>> Here is my code:
>>>
>>>     typedef itk::ImageRegionIterator            <ImageType>
>>> iteratorType;
>>>     typedef itk::ImageRegionConstIterator    <ImageType>
>>> constIteratorType;
>>>
>>>     constIteratorType    first_it    (first_img,
>>> first_img->GetRequestedRegion());
>>>     iteratorType            output_it (output_img, output_img->
>>> GetRequestedRegion());
>>>
>>>     std::list<constIteratorType> list;
>>>     std::list<constIteratorType>::iterator it;
>>>
>>>     list.push_back(first_it);
>>>
>>>     if (second_img.IsNotNull())
>>>     {
>>>         constIteratorType second_it (second_img,
>>> second_img->GetRequestedRegion());
>>>         list.push_back (second_it);
>>>     }
>>>
>>>     //initialize all the iterators at the begin of input images
>>>     for(it = list.begin(); it < list.end(); it++)
>>>     {
>>>         it->GoToBegin();
>>>     }
>>>
>>>     for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)
>>>     {
>>>         for(it = list.begin(); it < list.end(); it++)//move on the images
>>> and get at each iteration the pixel value and insert to the new image
>>>         {
>>>             output_val = it->Get() + output_val;  //get values from each
>>> image and insert in the output image
>>>             // How do I forward the image's iterator from here ?????
>>>         }
>>>
>>>         output_it.Set(output_val);
>>>
>>>     }
>>>
>>>
>>>
>>> Any thoughts would be very welcome ...
>>> Hila
>>> ------------------------------
>>> _____________________________________
>>> 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
>>>
>>
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20120423/cdc43418/attachment.htm>
>
> ------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
> End of Insight-users Digest, Vol 96, Issue 31
> *********************************************


More information about the Insight-users mailing list