catmaid / CATMAID

Collaborative Annotation Toolkit for Massive Amounts of Image Data
https://catmaid.org
GNU General Public License v3.0
188 stars 57 forks source link

Crop tool improvements #1216

Open acardona opened 9 years ago

acardona commented 9 years ago

A number of issues to address:

tomka commented 9 years ago

@arcardona, I just factored the cropping tool's crop request generation into a separate CATMAID.crop() function. This should allow you to create the sub-volumes you wanted based on project space coordinates. Cropping a bouding box from (10, 11, 12) to (21,22,23) in the current project and active stack viewer's primary stack at zoom level 1 would look like this:

var stackId = project.focusedStackViewer.primaryStack.id;
CATMAID.crop(project.id, [stackId], 10, 11, 12, 21, 22, 23, 1);

You can optionally add a (clockwise) rotation around project Z as an extra parameter. The function returns a promise. So to do add a continuation to this call, use .then, e.g. CATMAID.crop(...).then(function() { console.log('done'); });.