[ITK] [ITK-users] TileImageFilter SideBySide

Dr. Roman Grothausmann grothausmann.roman at mh-hannover.de
Wed Aug 20 03:37:40 EDT 2014


Hi


As this is a nice case of a question I have always had: In the case of the c++ 
example 
(http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_CreateVolume)

InputImageType::Pointer inputImageTile;

   for (int i = 1; i < argc - 1; i++)
     {
     reader->SetFileName( argv[i] );
     reader->UpdateLargestPossibleRegion();
     inputImageTile = reader->GetOutput();
     inputImageTile->DisconnectPipeline();
     tiler->SetInput( inputImageNumber++, inputImageTile );
     }

When the reader output is assigned to inputImageTile, I thought this is only a 
pointer assignment and not a full copy of the image. However, I wonder, what 
makes sure the address space in the memory is not used (partially) again for the 
next image read? Is there a full copy created "behind the scene" at any point in 
the code? Or does the reader remember the address space of former images read 
even though DisconnectPipeline was called?

Thanks for any explanations
Roman

On 18/08/14 17:01, Michka Popoff wrote:
> Hi
>
> Going the way described in the CreateVolume example is the way to go.
>
> Why did you uncomment the DisconnectPipeline() call and Update() call in the for
> loop ? They need to stay there, else you will always use the last image.
> That’s why you see the same image, the single update call will be triggered at
> the end of the script and read only one image.
>
> You don’t need to call tileFilter->Update(), you can remove this line. The
> writer->Update() will take care of the pipeline update.
> As a bonus, you may wrap your writer->Update() call, to fetch errors at the end
> of the pipeline:
>
>    try
>      {
>      writer->Update();
>      }
>    catch( itk::ExceptionObject & error )
>      {
>      std::cerr << "Error: " << error << std::endl;
>      return EXIT_FAILURE;
>      }
>
> I made a little Python prototype, the syntax is a little bit different than in
> C++ but it gives you the main idea.
>
> Michka
>
>
>
>
> On 18 août 2014, at 16:05, Dan Mercik <mercikd at thomas.edu
> <mailto:mercikd at thomas.edu>> wrote:
>
>> Good Morning,
>>
>>
>>
>>                        The demonstration you showed me works great, however if
>> I wanted to do 20 images that would take  some time. So, I tried doing a for
>> loop which didn't work exactly how I wanted it to work. I would like the
>> program to take any amount of images and output them side by side , any ideas?
>> The attachment shows the for loop I used similar to TileImageFilter
>> CreateVolume example however when I use it for some odd reason only one image
>> is being display side by side multiple times.
>>
>>
>>
>> Daniel Mercik
>>
>> Computer Science Major
>>
>> Service Desk Technician
>>
>> Thomas College
>>
>> ________________________________
>> From: Michka Popoff <michkapopoff at gmail.com <mailto:michkapopoff at gmail.com>>
>> Sent: Wednesday, August 13, 2014 2:32 AM
>> To: Dan Mercik
>> Cc: ITK Mailing List;community at itk.org <mailto:community at itk.org>
>> Subject: Re: [ITK-users] TileImageFilter SideBySide
>>
>> Hi
>>
>>
>> Moving this mail to the new community mailing list
>>
>>
>> For your problem, you should use the setLayout method [1]
>>
>>
>> For 4 images, that would be:
>>
>>
>>
>> itk::FixedArray< unsigned int, 2 > layout;
>>
>> layout[0] = 4;
>> layout[1] = 0;
>>
>>
>> Michka
>>
>>
>> [1]
>> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide
>>
>> On 13 ao?t 2014, at 01:06, Dan Mercik <mercikd at thomas.edu
>> <mailto:mercikd at thomas.edu><mailto:mercikd at thomas.edu>> wrote:
>>
>> Good Afternoon,
>>
>>
>>
>>                   I want to know if it's possible to have more than two image
>> be side by side vertically? If so what would I have to change in the
>> algorithm, would I have to make a loop for the amount of input images? Any
>> help would be greatly appreciative.
>>
>>
>>
>> Daniel Mercik
>>
>> Computer Science Major
>>
>> Service Desk Technician
>>
>> Thomas College
>> _____________________________________
>> Powered bywww.kitware.com <http://www.kitware.com/><http://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://public.kitware.com/mailman/listinfo/insight-users
>>
>> <TileImageFilter_SideBySide.cxx><Tilesidebyside.JPG>
>
>
>
> _____________________________________
> 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://public.kitware.com/mailman/listinfo/insight-users
>

-- 
Dr. Roman Grothausmann

Tomographie und Digitale Bildverarbeitung
Tomography and Digital Image Analysis

Institut für Funktionelle und Angewandte Anatomie, OE 4120
Medizinische Hochschule Hannover
Carl-Neuberg-Str. 1
D-30625 Hannover

Tel. +49 511 532-9574
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users



More information about the Community mailing list