Presentation is loading. Please wait.

Presentation is loading. Please wait.

Read a DICOM File typedef unsigned charInputPixelType; const unsigned intInputDimension = 2; typedef itk::Image InputImageType; typedef itk::ImageFileReader.

Similar presentations


Presentation on theme: "Read a DICOM File typedef unsigned charInputPixelType; const unsigned intInputDimension = 2; typedef itk::Image InputImageType; typedef itk::ImageFileReader."— Presentation transcript:

1 Read a DICOM File typedef unsigned charInputPixelType; const unsigned intInputDimension = 2; typedef itk::Image InputImageType; typedef itk::ImageFileReader ReaderType; typedef itk::GDCMImageIOImageIOType; ReaderType::Pointer reader = ReaderType::New(); ImageIOType::Pointer gdcmImageIO = ImageIOType::New(); reader->SetFileName(lpszPathName);reader->SetImageIO(gdcmImageIO);reader->Update();

2 Write a DICOM File typedef unsigned charOutputPixelType; const unsigned intOutputDimension = 2; typedef itk::Image OutputImageType; typedef itk::ImageFileWriter WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetFileName("D:\\test.jpg"); writer->SetInput( reader->GetOutput() ); writer->Update();

3 Rescale typedef itk::RescaleIntensityImageFilter FilterType; FilterType::Pointer filter = FilterType::New();

4 Binary Threshold typedef itk::BinaryThresholdImageFilter FilterType2; FilterType2::Pointer filter2 = FilterType2::New(); filter2->SetOutsideValue(0);filter2->SetInsideValue(1200);filter2->SetLowerThreshold(800);filter2->SetUpperThreshold(1200);

5 DiConverter Input DICOM file(s) DICOM file(s)Output RAW Data RAW Data JPG/PNG JPG/PNG Exe file Console Console argc / argv Windows (MFC) Windows (MFC)

6 DiConverter Deadline 2007/04/24 (Tue.) 2007/04/24 (Tue.)Grading Results Results60% Manual Manual30% Miscel. (coding practice) Miscel. (coding practice)10%

7 Access Pixel Data InputImageType::Pointer ptrImage = reader->GetOutput(); reader->Update(); InputImageType::IndexType pixelIndex; pixelIndex[0] = 0; pixelIndex[1] = 0; InputImageType::PixelType pixelValue = ptrImage- >GetPixel(pixelIndex);

8 CPathDialog and CFileFinder CPathDialog dialog(" 目錄對話盒元件範例 "," 選取目錄 ","D:\\"); if ( dialog.DoModal() == IDOK ) { CString strFolder; CString strFolder; strFolder=dialog.GetPathName(); strFolder=dialog.GetPathName(); AfxMessageBox(strFolder); AfxMessageBox(strFolder); CFileFinder Finder(strFolder); Finder.FindAllFiles("*.*"); for (int i=0; i<Finder.GetSize(); i++) AfxMessageBox(Finder.GetPath(i)); AfxMessageBox(Finder.GetPath(i));}

9 Metadata Metadata Data about data Data about data

10 DICOM File Header Tag Tag (group number, element number ) Patient’s age: (0010, 0010) Patient’s age: (0010, 0010) Patient’s sex: (0010, 0040) Patient’s sex: (0010, 0040)

11 DICOM File

12 ITK Software Guide 7.12.5 Printing DICOM Tags From One Slice Printing DICOM Tags From One Slice

13 Topics for Final Project (I) Thresholding Edge Detection Casting and Intensity Mapping Gradients Second Order Derivatives Neighborhood Filters Mean Filter & Median Filter Mean Filter & Median Filter

14 Topics for Final Project (II) Thresholding Edge Detection Casting and Intensity Mapping Gradients Second Order Derivatives Neighborhood Filters Mean Filter & Median Filter Mean Filter & Median Filter Morphology and Voting Filters Morphology and Voting Filters

15 Topics for Final Project (II) Smoothing Blurring and Local Blurring Blurring and Local Blurring Edge Preserving Smoothing Edge Preserving Smoothing Frequency Domain Extracting Surfaces


Download ppt "Read a DICOM File typedef unsigned charInputPixelType; const unsigned intInputDimension = 2; typedef itk::Image InputImageType; typedef itk::ImageFileReader."

Similar presentations


Ads by Google