Open miketaormina opened 3 years ago
Hi @miketaormina ,
I can answer why the numbers (minimal_x, minimal_y, ...
) show up in the recorded command:
If you click through the dialogs by hand, it will show you the box it has determined and allow manual adjustments - those values will show up in the recording. If you delete the parameters, as you did in your first snippet, it should just use whatever is determined automatically.
The divergent behaviour in a macro vs. GUI is more puzzling - in both cases we are using the same code... Do you have an example of how these numbers differ? Ideally, you could send us the corresponding XML file so we can do some probing into what goes wrong...
Best, David
Thanks @hoerldavid ,
Reproducing the issue is pretty hit or miss, but I'll see if I can find you an example file where this happens. I think that I mostly see this when performing this operation on several files sequentially, where the first is flawless and subsequent ones misbehave. I wonder if it has more to do with keeping one initialization of pyimagej around. There is also a possibility that I'm simply mucking it up!
Sorry for the delay in response here, I have been circumventing the problem by calculating the maximum bounding box directly from the XML file bounds and transforms, which is maybe how I should be doing this operation anyways. Once I pull those numbers, I can use a script to define the bounding box explicitly and fuse from there.
The stitching and fusion with this plugin work impressively well, by the way, kudos to the team for this incredibly useful tool!
Thanks again and I'll see if I can make an XML file and notebook that reproduce this. -Mike
I'm using the following macro to calculate the maximum bounding box (called from pyimagej):
This sometimes, but not always yields a different bounding box than if I do the operation from the plugin (which yields the correct answer). Is this the proper way to calculate the max bounding box in headless mode? When I try to record the macro with ImageJ, it seems to do the calculation of the bounding box before constructing the command:
But this isn't really helpful for a scripting application, since these are the numbers I'm trying to determine. Should I be reading/calculating these numbers from the xml file directly?