3D interpolation Dicom data
4 ビュー (過去 30 日間)
古いコメントを表示
I have a series of dicom images which i would like to extend by interpolation, the old series is a [256 256 166] matrix with a voxel size of [0,9375 0,9375 1,200]. I would like to interpolate this in all 3 dimensions to create smaller voxels. When i try to apply the function interp3() i immediately get an error: Sample values must be a single or double array. But when i rewrite my data to single or double array i will lose all the information in my image.
Could anybody tell me how to apply this method or which method i should use to interpolate without losing the intensity values of my original data?
0 件のコメント
採用された回答
Alex Taylor
2013 年 10 月 31 日
編集済み: Alex Taylor
2013 年 11 月 4 日
If you have the Image Processing Toolbox, I would make this problem easier on yourself by using imwarp and possibily imref3d. You can represent what you are trying to do as a geometric transformation of your input image with a scale transformation. It sounds like your intention is to choose a scale factor > 1 to increase the grid size of your image.
Using imref3d will help you define the world location of your input image from the metadata in your dicom image.
S = load('mri');
I = squeeze(S.D);
RI = imref3d(size(I),0.9375 0.9375 1.200);
scaleFactor = 2;
tformResize = affine3d([scaleFactor 0 0 0; 0 scaleFactor 0 0; 0 0 scaleFactor 0; 0 0 0 1]);
[Inew,Rnew] = imwarp(I,RI,tformResize);
Conceptually, it should be possible to do what you are trying to do with interp3. My guess is that interp3 is returning a single/double image outside the range [0 1] because you are probably just using simple cast single(I) or double(I) instead of rescaling and casting (im2double). Many MATLAB/IPT functions that require a dynamic range assume that single/double data is normalized to the range [0 1]. I bet you have not actually lost information if you are interpolating correctly. You either need to adjust the dynamic range used in visualizing your floating point data:
imshow(I(:,:,10),[]);
Move your output image back to its original datatype, for example uint8, or rescale your output image to the range [0 1]:
I = I./max(I(:));
6 件のコメント
Daniel Ribeiro de Sousa
2016 年 2 月 10 日
Hi,
Could you explain me why the first and the last figures are empty? I mean they are only black without any interpolation data. I should have 27*2=54 pictures but there are only 52 images.
Thank you for explanation.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!