<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi Julio,<br>
<br>
Welcome to ITK!<br>
<br>
One of the best places for newbies to start is the ITK Software Guide:
<a class="moz-txt-link-freetext" href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a>.<br>
<br>
You'll find that ITK supports many different types of files (mainly
image formats) including: jpg, png, mhd, bmp, analyze, dicom, gipl,
nrrd, tiff, vtk, and more! Check out
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_File_Formats">http://www.itk.org/Wiki/ITK_File_Formats</a> for a quick list.<br>
<br>
Reading and writing images using ITK can be done in the following
manner </font><font face="Helvetica, Arial, sans-serif"> (for unsigned
char pixel type, with two dimensions)</font><font
face="Helvetica, Arial, sans-serif">:<br>
<br>
<font face="Courier New, Courier, monospace">typedef unsigned char
PixelType;<br>
const unsigned int Dimension = 2;<br>
typedef itk::Image< PixelType, Dimension > ImageType;<br>
typedef itk::ImageFileReader< ImageType > ReaderType;<br>
typedef itk::ImageFileWriter< ImageType > WriterType;<br>
<br>
// Read an image<br>
ReaderType::Pointer reader = ReaderType::New();<br>
reader->SetFileName( inputFilename );<br>
reader->Update();<br>
ImageType::Pointer image = reader->GetOutput();<br>
<br>
// Write an image<br>
WriterType::Pointer writer = WriterType::New();<br>
writer->SetFileName( outputFilename );<br>
writer->SetInput( image );<br>
writer->Update();</font><br>
<br>
The above code might be a little more verbose than the VXL example you
gave, but with ITK you have the added benefit of SmartPointers to take
care of memory deallocation, etc. If you want concise, maybe consider
using the Python wrappers generated by WrapITK:<br>
<br>
<font face="Courier New, Courier, monospace">imagetype =
itk.Image[itk.UC, 2]<br>
reader = itk.ImageFileReader[imagetype].New( FileName=argv[1] )<br>
image = reader.GetOutput()</font><br>
<br>
Check out the Examples folder that came with the source files - it's
jammed packed with helpful examples. The above code is a snippet from
Examples/IO/ImageReadWrite.cxx. FYI: the ITK Software Guide was
actually generated directly from the folder of examples!<br>
<br>
I hope you enjoy ITK!<br>
<br>
Cheers<br>
<br>
Dan<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:pastrana@bgt.uni-hannover.de">pastrana@bgt.uni-hannover.de</a> wrote:</font>
<blockquote
cite="mid20070108222454.ufkrdaasso4owkw4@mail.rrzn.uni-hannover.de"
type="cite"><font face="Helvetica, Arial, sans-serif">Hello dear ITK
users ...
<br>
<br>
I have been looking a way to easy read an write files.
<br>
Well, I am getting started with ITK and I dont think it is
<br>
that easy ...
<br>
<br>
I mean it is not as easy as in VXL:
<br>
<br>
read>
<br>
vil_image_view<vil_rgb<vxl_byte> > rgb_image;
<br>
rgb_image = vil_load("/pathTOfile/file.bla");
<br>
write>
<br>
vil_save(image_buffer, "FILENAME", "jpeg");
<br>
<br>
<br>
With VXL one can read read almost any file
<br>
<br>
Is there anyway to do that with ITK??
<br>
<br>
... I am still trying to figure out the way to do that
<br>
with ITK ... if you could point me in the right direction
<br>
i would really apreciate it ( I know newie question!!!)
<br>
<br>
<br>
Thanks ... ciaooo
<br>
Julio
<br>
_______________________________________________
<br>
Insight-users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
<br>
</font>
</blockquote>
</body>
</html>