[ITK-users] [ITK] error executing in median filter for nifty(nii) file

Matt McCormick matt.mccormick at kitware.com
Tue Apr 29 14:00:39 EDT 2014


Hi Neela,

The Debug mode explains the slow execution.

The debugger can be used to look at the stack trace to see where the
error is occurring.

Hope this helps,
Matt

PS.  Please reply-to-all so the message hits the mailing list.

On Fri, Apr 25, 2014 at 8:43 AM, neela ramamoorthi <avcneela at gmail.com> wrote:
> sir
>
> i am building the programs in debug mode.  Also during there is runtime
> error in executing the registration examples (for nii files)
>
> your help will be very valuable for me
> thanking you
> neela
>
>
>
> On Thu, Apr 24, 2014 at 2:34 AM, Matt McCormick <matt.mccormick at kitware.com>
> wrote:
>>
>> Also, for DICOM images, specification of which series of slices is
>> required to read into the 3D image.  See [1].
>>
>> Hope this helps,
>> Matt
>>
>> [1]
>> http://www.itk.org/Doxygen/html/IO_2DicomSeriesReadImageWrite2_8cxx-example.html
>>
>>
>> On Tue, Apr 22, 2014 at 7:51 AM, Bill Lorensen <bill.lorensen at gmail.com>
>> wrote:
>> > Are you building your ITK and Median program in Release mode? If it is
>> > build in Debug mode, the times can be 10-100 times slower.
>> >
>> >
>> > On Tue, Apr 22, 2014 at 6:54 AM, neela <avcneela at gmail.com> wrote:
>> >> hi
>> >>
>> >> i am new to itk programming.  I want to just simple filter(say median
>> >> filter) for nii file.  I changed the MedianImageFilter.cxx program
>> >> available
>> >> with ITK as follows: (change size from 2 to 3) and include radius along
>> >> z
>> >> direction.
>> >>
>> >> #include "itkImageFileReader.h"
>> >> #include "itkImageFileWriter.h"
>> >>
>> >> #include "itkMedianImageFilter.h"
>> >>
>> >> int main( int argc, char * argv[] )
>> >> {
>> >>   if( argc < 3 )
>> >>     {
>> >>     std::cerr << "Usage: " << std::endl;
>> >>     std::cerr << argv[0] << "  inputImageFile   outputImageFile" <<
>> >> std::endl;
>> >>     return EXIT_FAILURE;
>> >>     }
>> >>
>> >>
>> >>   typedef   unsigned char  InputPixelType;
>> >>   typedef   unsigned  char  OutputPixelType;
>> >>
>> >>   typedef itk::Image< InputPixelType,  3 >   InputImageType;
>> >>   typedef itk::Image< OutputPixelType, 3 >   OutputImageType;
>> >>
>> >>   typedef itk::ImageFileReader< InputImageType  >  ReaderType;
>> >>   typedef itk::ImageFileWriter< OutputImageType >  WriterType;
>> >>
>> >>   ReaderType::Pointer reader = ReaderType::New();
>> >>   WriterType::Pointer writer = WriterType::New();
>> >>
>> >>   reader->SetFileName( argv[1] );
>> >>   writer->SetFileName( argv[2] );
>> >>
>> >>   typedef itk::MedianImageFilter<
>> >>                InputImageType, OutputImageType >  FilterType;
>> >>
>> >>   FilterType::Pointer filter = FilterType::New();
>> >>   InputImageType::SizeType indexRadius;
>> >>
>> >>   indexRadius[0] = 1; // radius along x
>> >>   indexRadius[1] = 1; // radius along y
>> >> indexRadius[2] = 1; // radius along z
>> >>
>> >>   filter->SetRadius( indexRadius );
>> >>
>> >>   filter->SetInput( reader->GetOutput() );
>> >>   writer->SetInput( filter->GetOutput() );
>> >>   writer->Update();
>> >>
>> >>
>> >>
>> >>   return EXIT_SUCCESS;
>> >> }
>> >>
>> >> But it works well for JPG images, when i tried for DCM images i got
>> >> only
>> >> partial output (only one slice) where as for nii image system hangs.
>> >> Anybody please help me.
>> >>
>> >> thanks
>> >>
>> >>
>> >> _____________________________________
>> >> 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
>> >
>> >
>> >
>> > --
>> > Unpaid intern in BillsBasement at noware dot 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
>> > _______________________________________________
>> > Community mailing list
>> > Community at itk.org
>> > http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
>


More information about the Insight-users mailing list