[Insight-users] MultiResolutionImageFilter question again
Fucang Jia
jiafucang at hotmail . com
Thu, 20 Nov 2003 10:27:57 +0800
Hi, Lydia,
Thank you very much!
As you said, this is due to the pixel type. Here is another question:
My input image type is 512x512 unsigned short. I set the number of
multiresolution to 8, and the levels be
[256, 256] -> first
[128, 128] -> second
[64, 64] -> third
[32, 32] -> fourth
[16, 16] -> fifth
[8, 8] -> sixth
[4, 4] -> seventh
[2, 2] -> eighth
the first to the fifth level is right now. But the sixth to eighth level
images are not
right yet. The ImageViewer application tells that
Int.Range:nan0x7fffffff - nan0x7fffffff
Int.Window: nan0x7fffffff(Min) - nan0x7fffffff(Max).
I think the multiresolution image filter can only downsample to 8x8 at
larget for a 2d image, is that right?
Thank you!
Fucang
>From: "Lydia Ng" <lng at insightful . com>
>To: "Fucang Jia" <jiafucang at hotmail . com>, <insight-users at itk . org>
>Subject: RE: [Insight-users] Why MultiResolutionPyramidImageFilter does not
>produce right image?
>Date: Wed, 19 Nov 2003 09:25:54 -0800
>
>Hi Fucang,
>
>I think the filter requires the output pixel type to be floating point.
>Could
>you try it out as an experiment?
>
>- Lydia
>
> > -----Original Message-----
> > From: Fucang Jia [mailto:jiafucang at hotmail . com]
> > Sent: Wednesday, November 19, 2003 1:17 AM
> > To: insight-users at itk . org
> > Subject: [Insight-users] Why MultiResolutionPyramidImageFilter does not
> > produce right image?
> >
> > Hi, everyone,
> >
> > I am using ITK 1.4 and want to do some experiments based on
> > MultiResolutionPyramid. But the following program does not give correct
> > images. It does produce 8 images, but the first level image is all
>zeros.
> > So
> > the error spreads to the next level images. Is there some error in this
> > program?
> >
> > Thanks a lot!
> >
> > Fucang
> >
> >
> > =============================
> > int main(int argc, char *argv[] )
> > {
> >
> >
> > if(argc<2)
> > {
> > std::cerr<<argv[0]<<" Input2DImage"<<std::endl;
> > return -1;
> > }
> >
> > typedef unsigned short PixelType;
> > const unsigned short Dimension = 2;
> >
> > typedef itk::Image<PixelType,Dimension> InputImageType;
> > typedef itk::Image<PixelType,Dimension> OutputImageType;
> > typedef itk::ImageFileReader<InputImageType> ReaderType;
> > typedef itk::ImageFileWriter<OutputImageType> WriterType;
> > typedef
> > itk::MultiResolutionPyramidImageFilter<InputImageType,OutputImageType>
> > PyramidType;
> > ReaderType::Pointer reader = ReaderType::New();
> > WriterType::Pointer writer = WriterType::New();
> > PyramidType::Pointer pyramid = PyramidType::New();
> >
> >
> > reader->SetFileName(argv[1]);
> > reader->Update();
> >
> > pyramid->SetInput( reader->GetOutput() );
> >
> > unsigned int numLevels;
> > itk::Vector<unsigned int,Dimension> factors;
> >
> > numLevels = 8;
> > factors[0] = 256; factors[1] = 256;
> >
> > pyramid->SetNumberOfLevels( numLevels );
> > pyramid->SetStartingShrinkFactors( 256 );
> > pyramid->Print( std::cout );
> >
> > pyramid->Update();
> >
> > for (int i=0;i<numLevels;i++)
> > {
> > char str[4096];
> > sprintf(str,"test_%d.png",i);
> > writer->SetFileName(str);
> > writer->SetInput(pyramid->GetOutput(i));
> > writer->Update();
> > }
> >
> > return 0;
> > }
> >
> > _________________________________________________________________
> > The new MSN 8: advanced junk mail protection and 2 months FREE*
> > http://join . msn . com/?pagežatures/junkmail
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk . org
> > http://www . itk . org/mailman/listinfo/insight-users
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk . org
>http://www . itk . org/mailman/listinfo/insight-users
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join . msn . com/?page=features/junkmail