-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] : Save ImageGrainCrops in .topostats files #1102
Comments
After discussion @SylviaWhittle and I have agreed that we should be looking to structure HDF5 output differently to its current structure. Current Structure
This means each time something "new" is to be incorporated a level of nesting is added three deep and within that an Proposed StructureWe are proposing switching this round so that the third level of nesting is the grain and each grain then has a series Instead of the above structure we are suggesting the following... ❱ h5glance tests/resources/file.topostats -d 5 | cat
tests/resources/file.topostats
├filename [ASCII string: scalar]
├grain_masks
│ └above [int64: 1024 × 1024]
├grain_trace_data
│ └above
│ ├0
│ │ ├cropped_images [float64: 63 × 83]
│ │ ├ordered_trace_cumulative_distances [float64: 95]
│ │ ├ordered_trace_heights [float64: 95]
│ │ ├ordered_traces [int64: 95 × 2]
│ │ ├splined_traces [float64: 1330 × 2]
│ │ ├grain_statistics [type: n x c]
│ │ ├something_yet_to_be_determined [type: n x c]
│ │ └tensor [int32: 63 x 83 x c]
│ ├1
│ │ ├cropped_images [float64: 85 × 64]
│ │ ├ordered_trace_cumulative_distances [float64: 116]
│ │ ├ordered_trace_heights [float64: 116]
│ │ ├ordered_traces [int64: 116 × 2]
│ │ ├splined_traces [float64: 1624 × 2]
│ │ ├grain_statistics [type: n x c]
│ │ ├something_yet_to_be_determined [type: n x c]
│ │ └tensor [int32: 85 x 64 x c]
... |
Started looking at this and I think there are two components.
Modify
|
Is your feature request related to a problem?
We need a way to be able to save and load
ImageGrainCrops
objects into and out of.topostats
files for reproducible work.@ns-rse and I have been pondering it and think a simple solution of nesting keys and data in a structure similar to that of how the classes are laid out, would be sensible. It would require boilerplate code but probably the simplest solution than trying to make in Class mechanics into the file directly.
Max is also in need of this when we can do it.
Describe the solution you would like.
Add simple packer - unpacker functions to allow
ImageGrainCrop
class objects to be serialized into.topostats
HDF5 format.Describe the alternatives you have considered.
Trying to be clever and listing the class behavior in the file structure - I believe Tensorflow might do this with their models? Ie listing what class an object should be, as metadata alongside the data as opposed to hardcoding it in a SCHEMA in TopoStats. But this would be more planning & work.
Additional context
N/A
The text was updated successfully, but these errors were encountered: