1 / 15

Read a DICOM File

Read a DICOM File. typedef unsigned char InputPixelType; const unsigned int InputDimension = 2; typedef itk::Image<InputPixelType, InputDimension> InputImageType; typedef itk::ImageFileReader<InputImageType> ReaderType; typedef itk::GDCMImageIO ImageIOType;

oakes
Télécharger la présentation

Read a DICOM File

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Read a DICOM File typedef unsigned char InputPixelType; const unsigned int InputDimension = 2; typedef itk::Image<InputPixelType, InputDimension> InputImageType; typedef itk::ImageFileReader<InputImageType> ReaderType; typedef itk::GDCMImageIO ImageIOType; 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 char OutputPixelType; const unsigned int OutputDimension = 2; typedef itk::Image<OutputPixelType, OutputDimension> OutputImageType; typedef itk::ImageFileWriter< OutputImageType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetFileName("D:\\test.jpg"); writer->SetInput( reader->GetOutput() ); writer->Update();

  3. Rescale typedef itk::RescaleIntensityImageFilter< InputImageType, OutputImageType > FilterType; FilterType::Pointer filter = FilterType::New();

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

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

  6. DiConverter • Deadline • 2007/04/24 (Tue.) • Grading • Results • 60% • Manual • 30% • 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; strFolder=dialog.GetPathName(); AfxMessageBox(strFolder); CFileFinder Finder(strFolder); Finder.FindAllFiles("*.*"); for (int i=0; i<Finder.GetSize(); i++) AfxMessageBox(Finder.GetPath(i)); }

  9. Metadata • Metadata • Data about data

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

  11. DICOM File

  12. ITK Software Guide • 7.12.5 • 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

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

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

More Related