[Insight-users] reading a dicom image

John Drescher drescherjm at gmail.com
Sat Jun 20 09:34:34 EDT 2009


On Sat, Jun 20, 2009 at 6:31 AM, Syrine Sahmim<syrine.sahmim at yahoo.fr> wrote:
> hi all,
> i try to read a dicom image
> i write this code
> #if defined(_MSC_VER)
> #pragma warning ( disable : 4786 )
> #endif
>
> #ifdef __BORLANDC__
> #define ITK_LEAN_AND_MEAN
> #endif
>
> #include "itkImageFileReader.h"
> //#include "itkImageFileWriter.h"
> #include "itkRescaleIntensityImageFilter.h"
> #include "itkGDCMImageIO.h"
> #include <list>
> #include <fstream>
>
>
> int main( int argc, char* argv[] )
> {if( argc < 5 )
>     {
>     std::cerr << "Usage: " << std::endl;
>     std::cerr << argv[0] << " DicomImage OutputDicomImage ";
>         std::cerr << " OutputImage RescaleDicomImage\n";
>     return EXIT_FAILURE;
>     }
> typedef signed short InputPixelType;
>   const unsigned int   InputDimension = 2;
>
>   typedef itk::Image< InputPixelType, InputDimension > InputImageType;
>   typedef itk::ImageFileReader< InputImageType > ReaderType;
>
>   ReaderType::Pointer reader = ReaderType::New();

>   reader->SetFileName( "C:\Documents and Settings\Sirouna\Mes
> documents\Master\imgdicom" );

This is illegal in C and C++ (and several other languages)

\ is used for escape sequences. And \D \S \M  \i are all not defined
escape sequences..

use \\ or / where you have \

John


More information about the Insight-users mailing list