<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: rgb(0, 0, 0);"><div>hi all,<br>i try to read a dicom image<br>i write this code<br>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif<br><br>#ifdef __BORLANDC__<br>#define ITK_LEAN_AND_MEAN<br>#endif<br><br>#include "itkImageFileReader.h"<br>//#include "itkImageFileWriter.h"<br>#include "itkRescaleIntensityImageFilter.h"<br>#include "itkGDCMImageIO.h"<br>#include <list><br>#include <fstream><br><br><br>int main( int argc, char* argv[] )<br>{if( argc < 5 )<br> {<br> std::cerr << "Usage: " << std::endl;<br> std::cerr << argv[0] << " DicomImage OutputDicomImage ";<br>
std::cerr << " OutputImage RescaleDicomImage\n";<br> return
EXIT_FAILURE;<br> }<br>typedef signed short InputPixelType;<br> const unsigned int InputDimension = 2;<br><br> typedef itk::Image< InputPixelType, InputDimension > InputImageType;<br> typedef itk::ImageFileReader< InputImageType > ReaderType;<br><br> ReaderType::Pointer reader = ReaderType::New();<br> reader->SetFileName( "C:\Documents and Settings\Sirouna\Mes documents\Master\imgdicom" );<br> typedef itk::GDCMImageIO ImageIOType;<br><br> ImageIOType::Pointer gdcmImageIO = ImageIOType::New();<br> <br> reader->SetImageIO( gdcmImageIO );<br> try<br> {<br> reader->Update();<br> }<br> catch (itk::ExceptionObject & e)<br> {<br> std::cerr << "exception in file reader " <<
std::endl;<br> std::cerr << e << std::endl;<br> return EXIT_FAILURE;<br> }<br>}<br>i want to know where i must add the image path? is it correct my code?<br>when i build the project i have those warnings:<br>------ Build started: Project: DicomImageReadWrite, Configuration: Debug Win32 ------<br>Compiling...<br>DicomImageReadWrite.cxx<br>..\pj02dicom\DicomImageReadWrite.cxx(32) : warning C4129: 'D' : unrecognized character escape sequence<br>..\pj02dicom\DicomImageReadWrite.cxx(32) : warning C4129: 'S' : unrecognized character escape sequence<br>..\pj02dicom\DicomImageReadWrite.cxx(32) : warning C4129: 'M' : unrecognized character escape sequence<br>..\pj02dicom\DicomImageReadWrite.cxx(32) : warning C4129: 'M' : unrecognized character escape sequence<br>..\pj02dicom\DicomImageReadWrite.cxx(32) : warning C4129: 'i' : unrecognized character escape sequence<br>Linking...<br>
Creating library C:\Documents and
Settings\Sirouna\Bureau\prjitk\pj02dicom_b\Debug\DicomImageReadWrite.lib
and object C:\Documents and
Settings\Sirouna\Bureau\prjitk\pj02dicom_b\Debug\DicomImageReadWrite.exp<br>Embedding manifest...<br>Build
log was saved at "file://c:\Documents and
Settings\Sirouna\Bureau\prjitk\pj02dicom_b\DicomImageReadWrite.dir\Debug\BuildLog.htm"<br>DicomImageReadWrite - 0 error(s), 5 warning(s)<br>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------<br>Project not selected to build for this solution configuration <br>========== Build: 1 succeeded, 0 failed, 1 up-to-date, 1 skipped ==========<br>and when i debogue the program i have those errors:<br>'DicomImageReadWrite.exe':
Loaded 'C:\Documents and
Settings\Sirouna\Bureau\prjitk\pj02dicom_b\debug\DicomImageReadWrite.exe',
Symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.<br>'DicomImageReadWrite.exe':
Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\snmpapi.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.<br>'DicomImageReadWrite.exe':
Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcp80d.dll',
Symbols loaded.<br>'DicomImageReadWrite.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll',
Symbols loaded.<br>'DicomImageReadWrite.exe': Loaded
'C:\WINDOWS\system32\user32.dll', No symbols loaded.<br>'DicomImageReadWrite.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.<br>The program '[3472] DicomImageReadWrite.exe: Native' has exited with code 1 (0x1).<br>have you an idea to how can i do to read the dicom image<br></div></div><br>
<!-- kill --><br></div></div><br>
</body></html>