1 / 11

Function 說明

Function 說明. 陳家宏. OpenFolder () ReadImage () 載入影像 ReadDICOMFolder ( 目的路徑 ) 讀取 DICOM 影像資料 回 傳 影像指標 CloneImage ( 來源影像 ) 複製 DICOM 影像 資料 回 傳 影像 指標. 前處理 BinaryThresholder ( 來源影像 , 背景值 , 前景值 , 低門檻值 , 高門檻值 ) Binary Thresholder 處理 回傳結果影像指標

jean
Download Presentation

Function 說明

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. Function說明 陳家宏

  2. OpenFolder() • ReadImage() • 載入影像 • ReadDICOMFolder(目的路徑) • 讀取DICOM影像資料 • 回傳影像指標 • CloneImage(來源影像) • 複製DICOM影像資料 • 回傳影像指標

  3. 前處理 • BinaryThresholder(來源影像, 背景值, 前景值, 低門檻值, 高門檻值) • Binary Thresholder處理 • 回傳結果影像指標 • ReplaceImage(目的影像,來源影像,空氣的低門檻值,空氣的高門檻值,液體的低門檻值,液體的高門檻值,取代值,來源影像前景值) • 將DICOM影像中的液體改成空氣的值 • AutoGetSeedPoint(來源影像, 種子點指標,空氣的低門檻值,空氣的高門檻值) • 找Connected Threshold的種子點 • ConnectedThreshold(來源影像,種子點,空氣的低門檻值,空氣的高門檻值,取代值) • Connected Threshold分割處理 • 回傳結果影像指標

  4. Isolated自動分割 • Allocate3DBMPImage(來源影像) • 配置3D的影像空間 • 回傳影像指標 • ExtractionShortImage(來源影像,選擇第N張影像) • 從DDICOM影像中抽出第N張影像 • 回傳影像指標 • ExtractionCharImage(來源影像,選擇第N張影像) • 從DBMP影像中抽出第N張影像 • 回傳影像指標 • Allocate2DBMPImage(來源影像) • 配置2D的影像空間 • 回傳影項指標

  5. RegionSearch(目的影像,來源影像) • 搜尋相連的區域並標號 • 回傳總共多少區 • GetBoundingBox(box座標,seed1座標,來源影像,區域數量,影像的寬,影像的高) • 找seed1 • SearchSeed2(seed2座標,box座標,來源影像,高門檻值,低門檻值) • 找seed2 • AutoIsolatedConnected(來源影像,seed1座標,seed2座標,低門檻值,取代值) • Isolated Threshold處理 • 回傳結果影像指標

  6. InsertCharImage(2D來源影像,3D來源影像,插入至第N張)InsertCharImage(2D來源影像,3D來源影像,插入至第N張) • 將Isolated Threshold結果塞回3D影像

  7. 人造影像製作步驟(1) 準備動作: const unsigned int Dimension = 3; typedef unsigned char PixelType; typedef itk::Image< PixelType, Dimension > ImageType; // prepare a 3D image int w = 512, h=512, z = 10; ImageType::Pointer image = ImageType::New(); ImageType::IndexType start; start[0] = 0; start[1] = 0; start[2] = 0; ImageType::SizeType size; size[0] = w; size[1] = h; size[2] = z;

  8. 人造影像製作步驟(2) ImageType::RegionType region; region.SetSize(size); region.SetIndex(start); image->SetRegions(region); image->Allocate(); // initialize the 3D image PixelType * pPixel = image->GetBufferPointer(); memset(pPixel, 0, w * h * z * sizeof(PixelType) );

  9. 人造影像製作步驟(3) 創造影像: for(intzLoop=0; zLoop<z ; zLoop++) { PixelType * pTmpPixel = pPixel + (w*h)*zLoop; for(int hLoop=0 ; hLoop < h ; hLoop++) { for(int wLoop=0 ; wLoop < w ; wLoop++) { *( pTmpPixel + hLoop * w + wLoop ) = wLoop/2; } } }

  10. 人造影像製作步驟(4) 產生影像: typedef itk::Image< PixelType, 2> Image2DType; typedefitk::ImageSeriesWriter<ImageType, Image2DType> WriterType; typedefitk::NumericSeriesFileNamesNameGeneratorType; WriterType::Pointer writer = WriterType::New(); NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); std::string format = “colon%03d.bmp”;//檔案名稱 nameGenerator->SetSeriesFormat(format.c_str()); nameGenerator->SetStartIndex(1);//起始編號 nameGenerator->SetEndIndex(10);//結束編號 nameGenerator->SetIncrementIndex(1);//編號每一次增加多少 writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetInput ( image ); writer->Update();

  11. The End

More Related