Skip to content

Commit

Permalink
Update dtiRoiToImg.m
Browse files Browse the repository at this point in the history
per Dan Bullock (git user DanNBullock), use of false() as a means of getting an array of zeros on sz resulted in an empty dimension when a negative is passed in. The previous structure seemed to be predicated on a presumption of either RAS or LPI. Use of Abs(sz) ensures that the actual dimensions are passed.
  • Loading branch information
bacaron authored May 18, 2018
1 parent b882e0b commit b55cda4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mrDiffusion/roi/dtiRoiToImg.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
end

sz = diff(ceil(mrAnatXformCoords(inv(imgXform), bb)))+1;
roiImg = false(sz);
roiImg = false(abs(sz));
% Remove coords outside the bounding box
badCoords = coords(:,1)<bb(1,1) | coords(:,1)>bb(2,1) ...
| coords(:,2)<bb(1,2) | coords(:,2)>bb(2,2) ...
Expand Down

1 comment on commit b55cda4

@DanNBullock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually fix it, it would seem. The problem actually manifests in the line above. If one of the values is negative above, the addition actually lowers the resultant value. Again, the overarching issue seems to be the assumption of an image orientation and the inability to deal with alternate orientations.

Please sign in to comment.