How can I resample an image without changing the matrix size in MATLAB?
Show older comments
I have two DICOM images both have the same matrix sizes 512X512, however in the DICOM metadata I realized that one image has 0.4mm/pixel and the other is 0.79mm/pixel. I resampled 0.79mm/pixel image to 0.4mm/pixel using imresample.m (written by Omer Demirkayabut)but my matrix size changed to 992x992. Is there any way I can perform the resampling without changing the matrix size? I would really appreciate it if someone can help me. Thanks!
Answers (1)
Jan
on 5 Jan 2017
0 votes
The question is not meaningful: The images are matrices only and do not contain the information of the resolution. Therefore you cannot resample the resolution, but only change the size of the matrix - and this cannot happen without changing the size of the matrix.
I guess, the problem is your assumption that a resampling is required. Please explain the actual problem in detail.
3 Comments
Walter Roberson
on 5 Jan 2017
512 pixels at 0.4mm per pixel is 204.8 mm.
512 pixels at 0.79mm per pixel is 404.48 mm.
Therefore the two images cover different areas. But you are trying to treat them as if they covered the same area. That is not going to work.
Slim
on 5 Jan 2017
Walter Roberson
on 6 Jan 2017
You could crop the expanded matrix, possibly at an arbitrary or random section. If the portion to be cropped is not to be arbitrary you might want to do something like image registration
Categories
Find more on DICOM Format in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!