[ITK-users] TileImageFilter SideBySide

Michka Popoff michkapopoff at gmail.com
Mon Aug 18 11:01:57 EDT 2014


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> 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>
> Sent: Wednesday, August 13, 2014 2:32 AM
> To: Dan Mercik
> Cc: ITK Mailing List; 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>> 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 by 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>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140818/79c44d27/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tiling.py
Type: text/x-python-script
Size: 881 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140818/79c44d27/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140818/79c44d27/attachment-0001.html>


More information about the Insight-users mailing list