How to calculate random shift intensity difference (RSID) feature?

조회 수: 12 (최근 30일)
Sara Salimi
Sara Salimi 2018년 12월 8일
댓글: Sara Salimi 2018년 12월 30일
Hi,
I have 3D patients volumes saved in a matlab variable.
I need to extract random shift intensity difference (RSID) feature, this feature compares the intensity of the current voxel x and another
voxel x + u with random offset u, ` f(x, u) = I(x + u) − I(x)`, where u is a random offset vector.
My question is
  1. How many neighbors of a specific voxel needs to be considered to calculate RSID?
  2. How to find them with matlab code?
Your help is appreciated

답변 (1개)

Image Analyst
Image Analyst 2018년 12월 9일
I think you'd have to scan your 3-D value one voxel at a time.
If you just want the intensity difference over all the neighbors, you can simply use convn with a kernel of all -1 excel the center being 26
kernel = -1 * ones(3,3,3);
kernel(2,2,2) = 26;
kernel = kernel / 26; % So output is in same intensity range as input.
output = convn(inputImage, kernel, 'same');
Why do you want the difference at just one randomly located pixel instead of the average over ALL neighbors?
  댓글 수: 6
Sara Salimi
Sara Salimi 2018년 12월 11일
편집: Sara Salimi 2018년 12월 11일
Could I ask is image3d the input 3D array of image, and diffimage is the output? Once I am running the last code, I am getting an error:
Subscript indices must either be real positive integers or logicals.
Error in (line 10)
randomPixel = double(inputDataVol(row+ur, col+uc, slice+us));
The intensity range for the original image has been normalized between [0,1].
Once I am running the first code, After applying the following code,
kernel = -1 * ones(3,3,3);
kernel(2,2,2) = 26;
kernel = kernel / 26; % So output is in same intensity range as input.
output = convn(inputImage, kernel, 'same');
I get an image like for RSID that I have show for a specific slide and the ranges of values is between [-0.3517:0.6728]
and for RSPD I get the following image for a specific probability map of structure, the values ranging [-0.6063: 0.6893]
Sara Salimi
Sara Salimi 2018년 12월 30일
Thanks for your help,
I found an easier way to do this:
shiftRange=[-1,1]; % defining a shift range
u=[randi(shiftRange),randi(shiftRange),randi(shiftRange)];
I2 = imtranslate(I,u);
Id=imabsdiff(I,I2); % the difference between original image and shifted imag
However I a not sure should I shift with a bigger range or not, sth like this:
u=2*[randi(shiftRange),randi(shiftRange),randi(shiftRange)]-1;
makes the shift range changes between [-3,3]

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by