<div dir="ltr">And I just tried turning on the InPlace option on the pasteImageFilter and it just failed with exception. <div><br></div><div>at
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span><span style="color:#808000">inline</span><span style="color:#c0c0c0"> </span><span style="color:#808000">void</span><span style="color:#c0c0c0"> </span>Set(<span style="color:#800080">TType</span><span style="color:#c0c0c0"> </span>&<span style="color:#c0c0c0"> </span>output,<span style="color:#c0c0c0"> </span><span style="color:#808000">const</span><span style="color:#c0c0c0"> </span><span style="color:#800080">TType</span><span style="color:#c0c0c0"> </span>&<span style="color:#c0c0c0"> </span>input)<span style="color:#c0c0c0"> </span><span style="color:#808000">const</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>{<span style="color:#c0c0c0"> </span>output<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>input;<span style="color:#c0c0c0"> </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">itk<span style="color:rgb(0,0,128)">DefaultPixelAccessor.h</span></pre>
<br><div class="gmail_quote">On Tue, Oct 9, 2012 at 5:59 PM, Kannan U V <span dir="ltr"><<a href="mailto:kannanuv@cshl.edu" target="_blank">kannanuv@cshl.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Brad,<br>
I am using /usr/bin/c++ on a Mac as the compiler.<br>
<br>
retina:InsightToolkit-bin kannanuv$ /usr/bin/c++ -v<br>
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)<br>
Target: x86_64-apple-darwin11.3.0<br>
Thread model: posix<br>
<br>
I am using unsigned short 2D image.<br>
<br>
I re-build ITK with testing on. I did make; make install.<br>
<br>
retina:bin kannanuv$ /Applications/CMake\ 2.8-8.app/Contents/bin/ctest<br>
-V -R itkImageAlgorithmCopyTest$<br>
UpdateCTestConfiguration from :/usr/bin/DartConfiguration.tcl<br>
UpdateCTestConfiguration from :/usr/bin/DartConfiguration.tcl<br>
Test project /usr/bin<br>
Cannot create directory /usr/bin/Testing/Temporary<br>
Cannot create log file: LastTest.log<br>
Constructing a list of tests<br>
Checking test dependency graph...<br>
Checking test dependency graph end<br>
No tests were found!!!<br>
<br>
but when I did<br>
retina:InsightToolkit-bin kannanuv$ find ./ -name "itkImageAlgorithmCopyTest*"<br>
.//Modules/Core/Common/test/CMakeFiles/ITKCommon2TestDriver.dir/itkImageAlgorithmCopyTest.cxx.o<br>
<br>
Am I doing something wrong with the TEST build?<br>
<div class="HOEnZb"><div class="h5"><br>
On Sun, Oct 7, 2012 at 4:15 PM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br>
> Hello Kannann,<br>
><br>
> My brief last reply didn't make it to the mailing list, so I'll explain further.<br>
><br>
> Have you tried enabling the "InPlace" option?<br>
><br>
> By default the PasteImageFilter ( or most any other filter ) will create a new image for the output. This adds additional overhead to the filter which is what you may be experiencing. Some filters are derived from the InPlaceImageFilter, and have an "InPlace" option. When this option is enabled the input image is reused as the output image, for the paste image filter this will reduce the over head by not having to copy the image.<br>
><br>
> Recently with ITK 4.1 there has been an optimized ImageAgorithm::Copy method implemented. Under certain conditions the methods will be optimized to a memcpy. On my systems this resulted in over 100X performance in some cases over the ITK iterator methods. It would be good to know if your system is taking advantage of this. What is your compiler and what is the specific image type you are using? There is a test to evaluate this performance if you compile ITK with the test enabled it's called itkImageAlgorithmCopyTest and can be run by "ctest -V -R itkImageAlgorithmCopyTest$"<br>
><br>
> Thanks,<br>
> Brad<br>
><br>
> On Oct 5, 2012, at 6:46 PM, Kannan U V <<a href="mailto:kannanuv@cshl.edu">kannanuv@cshl.edu</a>> wrote:<br>
><br>
>> Thanks Bill. I built it in Release mode and still it is nearly a 1:2<br>
>> slower performance.<br>
>><br>
>> For release, I am using the following gcc arguments.<br>
>><br>
>> CMAKE_CXX_FLAGS_RELEASE -O3 -DNDEBUG<br>
>><br>
>> Is there any thing else that I can do?<br>
>><br>
>> On Fri, Oct 5, 2012 at 6:25 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>
>>> Make sure you build your application in Release mode. If you are building<br>
>>> Debug, ITK can be 10 to 50 times slower.<br>
>>><br>
>>> On Fri, Oct 5, 2012 at 6:00 PM, Kannan U V <<a href="mailto:kannanuv@cshl.edu">kannanuv@cshl.edu</a>> wrote:<br>
>>>><br>
>>>> I was missing a update on the pasteFilter. Now that the paste image<br>
>>>> filter works. but the performance is 1:4 times worse than just copying<br>
>>>> pixels from tile to mosaic from the tiles. Is there a way I can<br>
>>>> improve this performance issue?<br>
>>>><br>
>>>> On Thu, Sep 20, 2012 at 6:08 PM, Kannan U V <<a href="mailto:kannanuv@cshl.edu">kannanuv@cshl.edu</a>> wrote:<br>
>>>>> Hi All,<br>
>>>>> I am trying to use PasteImageFilter on a grid of image tiles. (These<br>
>>>>> are tiles with overlap) I know the position of the tiles and I want to<br>
>>>>> paste them on to the montage. I am using pasteImage filter. When I use<br>
>>>>> the following routine and I get only the last written time in the<br>
>>>>> mosaic image and all other regions are set to zero.<br>
>>>>><br>
>>>>> Moreover if I don't do a set regions on the mosaicImage I get a write<br>
>>>>> error on image writer. I need help figuring out how it has to be run.<br>
>>>>><br>
>>>>> for (int iY = 1; iY < 2; iY++) {<br>
>>>>> for (int iX = 1; iX < 3; iX++) {<br>
>>>>> cout << "Processing tile : (" << iX << "," << iY << ")" << endl;<br>
>>>>> CreateConstantImage (tileImage, (iX + iY));<br>
>>>>> pasteFilter->SetSourceImage(tileImage);<br>
>>>>> pasteFilter->SetDestinationImage (mosaicImage);<br>
>>>>><br>
>>>>> pasteFilter->SetSourceRegion(tileImage->GetLargestPossibleRegion());<br>
>>>>><br>
>>>>> mosaicIndex1[0] = iX * 812;<br>
>>>>> mosaicIndex1[1] = iY * 812;<br>
>>>>> pasteFilter->SetDestinationIndex(mosaicIndex1);<br>
>>>>><br>
>>>>> mosaicImage = pasteFilter->GetOutput();<br>
>>>>> mosaicImage->SetRegions(region);<br>
>>>>><br>
>>>>> }<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> --<br>
>>>>> Thanks,<br>
>>>>> Kannan<br>
>>>><br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> Thanks,<br>
>>>> Kannan<br>
>>>> _____________________________________<br>
>>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>>><br>
>>>> Visit other Kitware open-source projects at<br>
>>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>>><br>
>>>> Kitware offers ITK Training Courses, for more information visit:<br>
>>>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>>>><br>
>>>> Please keep messages on-topic and check the ITK FAQ at:<br>
>>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>>>><br>
>>>> Follow this link to subscribe/unsubscribe:<br>
>>>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Unpaid intern in BillsBasement at noware dot com<br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Thanks,<br>
>> Kannan<br>
>> _____________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Kitware offers ITK Training Courses, for more information visit:<br>
>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>><br>
>> Please keep messages on-topic and check the ITK FAQ at:<br>
>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Thanks,<br>
Kannan<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<br>Kannan<br>
</div></div>