Subscripted assignment dimension mismatch.

1 次查看(过去 30 天)
I use this code
referenceImage = 'test1.dcm';
overlapImage = 'test3.dcm';
% Create blank new canvass the same size as the reference image.
newCanvass = zeros(size(referenceImage), 'uint8');
% Place overlap image down at row, column
data = dlmread('imgpositions.txt');
[row, column] = size(data);
newCanvass(row:end, column:end) = overlapImage;
And I get the error (see subject line) at newCanvass(row:end, column:end) = overlapImage;

采纳的回答

KSSV
KSSV 2018-5-3
newCanvass(row:end, column:end,:) = overlapImage(row:end, column:end,:);

更多回答(1 个)

Ameer Hamza
Ameer Hamza 2018-5-3
编辑:Ameer Hamza 2018-5-3
Something like this will work. Although I wonder are you correctly initializing values of row and column
[height, width] = size(overlapImage);
newCanvass(row:row+height-1, column:column+width-1, :) = overlapImage;

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by