<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2>I have an int- Array with grey values. In a first 
step i want to pass it to a itk image which i want to use for registering 
purposes. I tried to use iterators for fast access. To check the result, i tried 
ti write it out, but this dies not work. The message I get is:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>itk::ExceptionObject (0012F454)<BR>Location: 
"Unknown"<BR>File: f:\itk\insight\code\io\itkimagefilewriter.txx<BR>Line: 
143<BR>Description: itk::ERROR: ImageFileWriter(02260618): No ImageIO set, or 
none could be created.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The code I used:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> const unsigned int Dimension = 
2;<BR> typedef int PixelType;<BR> typedef itk::Image< PixelType, 
Dimension >  ImageType;  <BR> typedef 
itk::ImageRegionConstIterator< ImageType > 
ConstIteratorType;<BR> typedef itk::ImageRegionIterator< 
ImageType>       IteratorType;<BR> typedef 
itk::ImageFileWriter< ImageType > WriterType; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><BR> ImageType::Pointer image = 
ImageType::New();<BR> ImageType::IndexType 
start;<BR> ImageType::SizeType  size;<BR> size[0]  = 
W;<BR> size[1]  = W;<BR> start[0] =   
0;<BR> start[1] =   0;<BR> ImageType::RegionType 
region;<BR> region.SetSize( size );<BR> region.SetIndex( start 
);<BR> image->SetRegions( region 
);<BR> image->Allocate();<BR> ImageType::PixelType  
initialValue = 0;<BR> image->FillBuffer( initialValue );</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> IteratorType outputIt( image, 
image->GetRequestedRegion() );</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> i=0;<BR> for (outputIt.GoToBegin(); 
!outputIt.IsAtEnd();++outputIt)<BR> {<BR>  outputIt.Set(Image[i/W][i%W]); 
// dynamic int array Image<BR>  i++;<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> WriterType::Pointer writer = 
WriterType::New();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> writer->SetInput( image 
);<BR> writer->SetFileName("test.raw");<BR> try<BR>    
{<BR>  writer->Update();<BR>    }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> catch ( itk::ExceptionObject 
&err)<BR>    {<BR>  std::cerr << 
"ExceptionObject caught !" << std::endl; <BR>  std::cerr 
<< err << std::endl; <BR>    }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It would be fine, if i can register rgb values. is 
there a possibility. But this topic isnīt hot at time. First Iīm interessted why 
i get an exception.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for any help</FONT></DIV>
<DIV><FONT face=Arial size=2>Bernhard</FONT></DIV>
<DIV> </DIV></DIV></BODY></HTML>