glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
77 stars 35 forks source link

Allow to override min_size via command-line argument #114

Closed sbesson closed 2 years ago

sbesson commented 3 years ago

The current implementation stops downsampling the image as soon as both X and Y dimensions are smaller than 256. In some cases, we want this cut-off values to be configurable.

This commit makes the minimal change by keeping the default as 256 but allowing to override it via command-line option.

Tests are also added to cover the min-size arguments with various scenarios

sbesson commented 3 years ago

Heh. I was hesitant to start this conversation but since you brought it up, I am also not convinced by the --min-size terminology which is confusing as proven by your example. To be precise, the parameter actually specifies a maximum allowed size rather than a minimal value but it applies to the smallest resolution.

If we were to agree on the thumbnail nomenclature, I would propose something along the lines of --max-thumbnail-size. Should we brainstorm for additional terms before we introduce the option in the command-line?

melissalinkert commented 3 years ago

I'm fine with --max-thumbnail-size. --max-apex-size is the only other option that comes to mind (to avoid confusion between the smallest resolution and any separate thumbnail image), but that's probably not any clearer overall.

chris-allan commented 3 years ago

My inclination is to call this --target-min-size or similar and refer to what the "target" is explicitly in the documentation. As mentioned this is a desired minimum size of longest side of the highest level of the pyramid rather than a hard limit.

chris-allan commented 3 years ago

75b2863d274e01c5c41f7145b9674e6ad94d93d7 conceptually looks great to me. Will defer to @melissalinkert for anything else here.

melissalinkert commented 3 years ago

Looks good to me too, thanks!