Resizing x and y values of a DICOM/3D logical matrix, slice-by-slice, using for-loop.
    조회 수: 2 (최근 30일)
  
       이전 댓글 표시
    
Hello, I am a new Matlab user. I would like your help with a for-loop code please.
I'll be using a software which will forward a DICOM file to Matlab, and convert the image into a logical matrix. For example 1536x1536x90, but the x,y,z values will vary depending on the input DICOM file.
I would like to adjust the images to 512x512 for every 90 slices.
Here's what I'm picturing:
For slices thru s = 1 to s = #slices in a dicom file 
     specify the x and y dimensions of the slice s
     set the x and y dimensions of s to 512*512
     repeat until s reaches #slices in the dicom file 
End
Right now I have:
for s = 1:size(img,3) 
    xy = img(:,:,s)
    use imresize on xy?
end
And I don't know where I'm going with this. Being a newbie I don't think I fully understand how to deal with various types of matrices, so any help is appreciated.
Thanks in advance!
댓글 수: 0
답변 (1개)
  Walter Roberson
      
      
 2016년 10월 5일
        out = imresize(img, [512, 512]);
It happens that imresize() handles the case of multiple planes, without needing a loop.
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 DICOM Format에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!