Skip to content

Instantly share code, notes, and snippets.

@odinsbane
Last active October 27, 2021 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odinsbane/eeb10ebce9c608034f4af7fe091b14e0 to your computer and use it in GitHub Desktop.
Save odinsbane/eeb10ebce9c608034f4af7fe091b14e0 to your computer and use it in GitHub Desktop.
function snapshotsThreeSixty(steps){
total = 1260
mf3d = controls.getMeshFrame3D();
stack = 0;
perStep = 1260/steps;
for(var i = 0; i<steps; i++){
mf3d.rotateView(perStep, 0);
img = mf3d.snapShot();
proc = new ColorProcessor(img);
if(stack==0){
stack = new ImageStack(proc.getWidth(), proc.getHeight());
}
stack.addSlice(proc);
}
plus = new ImagePlus();
plus.setStack(stack);
plus.setTitle("rotating snapshot");
plus.show();
}
function zoomInMovie(steps){
mf3d = controls.getMeshFrame3D();
stack = 0;
for(var i = 0; i<steps; i++){
mf3d.getCanvas().zoomIn();
img = mf3d.snapShot();
proc = new ColorProcessor(img);
if(stack==0){
stack = new ImageStack(proc.getWidth(), proc.getHeight());
}
stack.addSlice(proc);
}
plus = new ImagePlus();
plus.setStack(stack);
plus.setTitle("zoom-in-snapshot");
plus.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment