I'm actually trying to perform cumulative sums along arbitrary directions in images. For sure a simple sum can be done with the radon() function, however I need to keep track of an integral, thus requiring a cumsum(). I've tried to use imrotate() and then cumsum() but initial and final images don't have the same dimensions anymore, causing another problem.
Any help would be really appreciated!
I pretty sure there's nothing built in to MATLAB or the Image Processing Toolbox to do that. You'd have to program it up yourself. Sorry, but it's just such a unique requirement that there's no code yet to do that as far as I know. It can be done though. You might find improfile() helpful as you scan across, at one pixel spacings or whatever you require, getting profiles and calling cumsum().
Direct from the documentation:
B = cumsum(A,dim) returns the cumulative sum of the elements along dimension dim.
Does that help?
A = magic(5);
B_down = cumsum(A,1); % Cumulative sum down columns (the default) B_across = cumsum(A,2); % Cumulative sum across the rows