MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / doProjections

Method doProjections

ij/src/main/java/ij/plugin/Projector.java:263–458  ·  view source on GitHub ↗
(ImagePlus imp)

Source from the content-addressed store, hash-verified

261 }
262
263 private ImagePlus doProjections(ImagePlus imp) {
264 int nSlices; // number of slices in volume
265 int projwidth, projheight; //dimensions of projection image
266 int xcenter, ycenter, zcenter; //coordinates of center of volume of rotation
267 int theta; //current angle of rotation in degrees
268 double thetarad; //current angle of rotation in radians
269 int sintheta, costheta; //sine and cosine of current angle
270 int offset;
271 int curval, prevval, nextval, aboveval, belowval;
272 int n, nProjections, angle;
273 boolean minProjSize = true;
274
275 stack = imp.getStack();
276 if (imp.getBitDepth()==16 || imp.getBitDepth()==32) {
277 ImageStack stack2 = new ImageStack(imp.getWidth(),imp.getHeight());
278 for (int i=1; i<=stack.size(); i++)
279 stack2.addSlice(stack.getProcessor(i).convertToByte(true));
280 stack = stack2;
281 }
282 if ((angleInc==0) && (totalAngle!=0))
283 angleInc = 5;
284 boolean negInc = angleInc<0;
285 if (negInc) angleInc = -angleInc;
286 angle = 0;
287 nProjections = 0;
288 if (angleInc==0)
289 nProjections = 1;
290 else {
291 while (angle<=totalAngle) {
292 nProjections++;
293 angle += angleInc;
294 }
295 }
296 if (angle>360)
297 nProjections--;
298 if (nProjections<=0)
299 nProjections = 1;
300 if (negInc) angleInc = -angleInc;
301
302 ImageProcessor ip = imp.getProcessor();
303 Rectangle r = ip.getRoi();
304 left = r.x;
305 top = r.y;
306 right = r.x + r.width;
307 bottom = r.y + r.height;
308 nSlices = imp.getStackSize();
309 imageWidth = imp.getWidth();
310 width = right - left;
311 height = bottom - top;
312 xcenter = (left + right)/2; //find center of volume of rotation
313 ycenter = (top + bottom)/2;
314 zcenter = (int)(nSlices*sliceInterval/2.0+0.5);
315
316 projwidth = 0;
317 projheight = 0;
318 if (minProjSize && axisOfRotation!=zAxis) {
319 switch (axisOfRotation) {
320 case xAxis:

Callers 3

runMethod · 0.95
doRGBProjectionsMethod · 0.95

Calls 15

addSliceMethod · 0.95
getRoiMethod · 0.95
errorMethod · 0.95
allocateArraysMethod · 0.95
getImageArrayMethod · 0.95
setCalibrationMethod · 0.95
resetEscapeMethod · 0.95
showStatusMethod · 0.95
showProgressMethod · 0.95
getPixelsMethod · 0.95
doOneProjectionXMethod · 0.95
doOneProjectionYMethod · 0.95

Tested by

no test coverage detected