<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dear all<br>
<br>
<br>
I am converting an image from jpg to tiff and cant seem to find the
converted image in my directory. Where the converted image go. When you
WRITE an image where does it go.<br>
<br>
Please help me.<br>
<br>
Its very urgent<br>
<br>
The Code is as below<br>
.....................................................................................................................<br>
<br>
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">#include "itkImageFileReader.h"</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">#include "itkImageFileWriter.h"</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">#include "itkImage.h"</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">int main( int argc, char ** argv )</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">{</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> // Verify the number of parameters in the command line</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> if( argc < 3 )</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> {</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> std::cerr << "Usage: " << std::endl;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> std::cerr << argv[0] << " inputImageFile outputImageFile " << std::endl;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> return EXIT_FAILURE;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> }</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">typedef short PixelType;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> const unsigned int Dimension = 2;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> typedef itk::Image< PixelType, Dimension > ImageType;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> typedef itk::ImageFileReader< ImageType > ReaderType;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> typedef itk::ImageFileWriter< ImageType > WriterType;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">ReaderType::Pointer reader = ReaderType::New();</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> WriterType::Pointer writer = WriterType::New();</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> const char * inputFilename = argv[1];</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> const char * outputFilename = argv[2];</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">reader->SetFileName( "original.jpg" );</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> writer->SetFileName( "original.tiff" );</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">writer->SetInput( reader->GetOutput() );</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">try </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> { </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> writer->Update(); </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> } </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> catch( itk::ExceptionObject & err ) </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> { </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> std::cerr << "ExceptionObject caught !" << std::endl; </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> std::cerr << err << std::endl; </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> return EXIT_FAILURE;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);"> } </span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">return EXIT_SUCCESS;</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
<span style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">}</span><br style="font-family: courier,monaco,monospace,sans-serif; color: rgb(0, 64, 127);">
</td></tr></table><br>