educelab / volume-cartographer

Volumetric processing toolkit and C++ libraries for the recovery and restoration of damaged cultural materials
GNU General Public License v3.0
63 stars 22 forks source link

[Feature] Add UV alignment, orientation instructions in volume meta.json #113

Open skyward7187 opened 6 days ago

skyward7187 commented 6 days ago

What problem is your feature request solving?

Scrolls can be scanned upright or upside down, and slice ordering has two possibilities. Each combination requires inputting different --uv-align-to-axis or --uv-flip, uv-rotate operations into vc_render to orient the flattened segment properly for reading.

What is your feature request?

We should add support for volume-specific uv orientation instructions to the volume meta.json

What alternative solutions have you considered?

Edit all volumes: use the internal spiral information to rotate all volumes to be "upright and to have the same slice ordering. Downsides are the possibility of making mistakes, and the presence of uncorrected volumes already released to the public.

Is there anything else we should know that wasn't included already?

No response

Are you proposing to work on this feature yourself?

Code of Conduct

stephenrparsons commented 6 days ago

There are a few considerations to include here, and it should be inclusive of other manuscript forms like books/codices, not just scrolls. Do these variables (names could probably be improved) cover it? vc_render could then make informed choices about UV rotation and flip, as well as normal vector orientation.

csparker247 commented 6 days ago

Internally, this functionality has been desired for a long time, and I think it would dramatically improve the interpretability of vc_render outputs. I've seen too many people tried to read "text" that would be impossible given the orientation of the UV map. I'm open to an extension of the volume metadata which provides this. I'm unlikely to work on this in the near future myself, but I'll happily review a PR for it!

An idea from years ago was to annotate the volume with landmarks which could then be used as orientation references. This has a theoretical advantage of being able to support auto-alignment for sample types beyond books and scrolls, or even just books or scrolls in a weird scan orientation. That said, it would be a complicated system, so I don't think it's necessarily worth doing at the moment unless this strikes someone's particular fancy.

I like this generally, and I haven't fully thought through edge cases for this, but some initial thoughts: