[Insight-users] Re: Problem with ITKrawImageIOFactory

Luis Ibanez luis . ibanez at kitware . com
Fri, 07 Jun 2002 08:27:01 -0400


Hi cspl,

We just added two examples to better
illustrate the use of the Raw Image
reader.


You can find them under:

   Insight/Examples/RawImageReadWrite

and

   Insight/Examples/RawImageReaderViewer


The first will read a Raw image file and
save it in raw format again.

The secon is intended to be a RawViever.
(it requires FLTK to be installed in order
to support the GUI).

The interface will ask for the image size,
(this has to be filled before you hit the
"Load" button, or the "Show" button)


Please let us know if you find any
problems using these two new examples.


Thanks


Luis


=======================================
cspl wrote:
> Dear Mr.Luis,
> 
>  
> 
> I downloaded the new version of ItkRawImageIO.h and .txx.But Still I am 
> facing problem with RawImageIOFactory.How to Register exactly 
> RawImageIofactory.It is showing error
> "use of class template requires template argument list".
> I am also getting exception when reading using ImageFileReader.I have 
> written code as follows.I attached herewith my exception also.Please 
> give me in which way I will get result of Laplician filter.When ever Iam 
> calling Update function of any  object it is giving abnormal termination.
> 
>  
> 
> int main(int argc, char* argv[])
> {
>  
>  
>   UnsignedImageType::RegionType requestedRegion;
>   UnsignedImageType::SizeType  size;
>   UnsignedImageType::IndexType index;
> 
>  
> 
> 
>   //Set the size of the image region
>   //If you want to try a 2D image, you need to change the dimension.
>   size[0] = 512;
>   size[1] = 256;
>   size[2] = 10;
>  
>   index[0] = 0;
>   index[1] = 0;
>   index[2] = 0;
> 
>  
> 
>   requestedRegion.SetSize(size);
>   requestedRegion.SetIndex(index);
>   typedef itk::Image<char,2>  ImageType;
>   typedef itk::ImageFileReader< ImageType >  ReaderType; 
>   ReaderType::Pointer reader = ReaderType::New();
>   reader->SetFileName("c:\\one.raw");
> 
>  
> 
>    try
>  {
>     reader->Update();
>  }
>  catch( itk::ExceptionObject & except )
>  {
>   std::cerr << except << std::endl;
>  }
> 
>  
> 
>   cout<<"Laplacian filter test"<<endl;
>   itk::LaplacianImageFilter<ImageType, ImageType>::Pointer
>   lapFilter = itk::LaplacianImageFilter<ImageType, ImageType>::New();
>   lapFilter->SetInput(reader->GetOutput());
>   lapFilter->Update();
>   std::cerr << lapFilter->GetOutput() << std::endl;
>   return EXIT_SUCCESS;
> }
> 
>  
> 
> exception :
> 
>  
> 
> itk::ImageFileReaderException (0012F924)
> Location: "Unknown"
> File: F:\ITK\Insight\Code\IO\itkImageFileReader.txx
> Line: 85
> Description: Could not create IO object for file name
> 
>  
> 
>  
> 
>  
> 
> Thanking you,
> Regards,
> Ramakrishna
>