Login  Register

Re: Two suggestions for ImageJ when dealing with stacks of images initially having different sizes

Posted by Kenneth Sloan-2 on Jan 20, 2020; 8:25pm
URL: http://imagej.273.s1.nabble.com/Two-suggestions-for-ImageJ-when-dealing-with-stacks-of-images-initially-having-different-sizes-tp5022855p5022863.html

Following up on the suggestions for more options on different size images...

My needs are simpler (but, if implemented, should probably be spread wider than MY immediate need).

Perhaps I have missed something...and I'm doing it the hard way (would not be the first time).

In one of my major suites of plugins, I deal with image stacks where ALMOST ALL of the images have a specific size (or, failing that, a specific aspect ratio - usually square).  I often process the images in some way while adding them (one at a time, in Java) to a stack where the first image used to begin the stack controls the dimensions of the final stack.

Until last week, I was happy with "resize()".  But then, I hit a snag, and needed to resize a single image to the dimensions of the existing stack while maintaining PIXEL aspect ratio.  "resize()" appears to independently scale in X and Y so that the resized image just fits in the target frame.  This distorts the image.  Instead, I wanted to resize the source image so that it "just fits" in one dimension, but was padded (and centered) in the other dimension.

This was not challenging to write - but I wonder if it would be a generally useful option for "resize()".

While not my choice for this application - I can also see a need for a "resize()" that CROPS the source image (so that one dimension "just fits" and the other is cropped (and centered...perhaps other options are useful?)

Just a suggestion - I have no immediate need.  I'm just commenting on what looks like a gap in the API.


--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html