Skip to content

Segment group file format selection for serialization #527

Merged
PaulHax merged 5 commits intoKitware:mainfrom
PaulHax:export-segment-group
Dec 31, 2023
Merged

Segment group file format selection for serialization #527
PaulHax merged 5 commits intoKitware:mainfrom
PaulHax:export-segment-group

Conversation

@PaulHax
Copy link
Collaborator

@PaulHax PaulHax commented Dec 1, 2023

VolView will save "segment group" images into a file format configurable by a config.JSON file. deserialize will read whatever format it finds in the .zip file.

This is the config json to change the saved format

{
  "io": {
    "segmentGroupSaveFormat": "nrrd"
  }
}

To test: Can drag and drop this config file on VolView before saving.
config-save-format.json

Possible formats here:
https://github.com/InsightSoftwareConsortium/itk-wasm/blob/main/packages/image-io/typescript/src/extension-to-image-io.ts

TODO

  • Direction consines not right after round trip for prostate
  • Stop itk-wasm:writeImage from detaching image array when passing to worker
  • Bundle @itk-wasm/image-io wasms in build
  • Use @itk-wasm/image-io for loading base images, not just segment groups
    - [ ] Add GUI to set format, maybe Follow up PR to add GUI.

@netlify
Copy link

netlify bot commented Dec 1, 2023

Deploy Preview for volview-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 67d2631
🔍 Latest deploy log https://app.netlify.com/sites/volview-dev/deploys/658efaf29d2d8d0008ccb268
😎 Deploy Preview https://deploy-preview-527--volview-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@PaulHax PaulHax force-pushed the export-segment-group branch from 6286cb4 to 97257f2 Compare December 1, 2023 02:59
@PaulHax PaulHax changed the title Segment Group file format selection for serialization Segment group file format selection for serialization Dec 1, 2023
@PaulHax PaulHax force-pushed the export-segment-group branch from 97257f2 to e2a0984 Compare December 5, 2023 23:41
@PaulHax PaulHax requested a review from jadh4v December 5, 2023 23:42
@PaulHax PaulHax force-pushed the export-segment-group branch from e2a0984 to df5e8f1 Compare December 5, 2023 23:44
Copy link
Collaborator

@jadh4v jadh4v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if there's going to be a conflict in the future regarding the segmentation information that is stored in the session's json file vs the embedded info stored inside .nrrd and other fancier file formats that we might support in the future.

@PaulHax PaulHax force-pushed the export-segment-group branch from 4345276 to a2634a7 Compare December 8, 2023 21:22
@PaulHax PaulHax marked this pull request as ready for review December 8, 2023 21:30
@PaulHax
Copy link
Collaborator Author

PaulHax commented Dec 8, 2023

This is good to go by me. Followup PR for GUI export button.

Copy link
Collaborator

@jadh4v jadh4v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, apart from a few general comments.

import { FileReaderMap } from '.';

import { readFileAsArrayBuffer } from './io';
import { stlReader, vtiReader, vtpReader } from './vtk/async';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like itk-wasm/mesh-io also has a similar generic reader for polydata? Maybe in the future we could get rid of these special readers as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, cool. VolView's mesh support is just vestigial at the moment.

state: 'Done',
};
} catch (error) {
console.error(error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to keep this, or was just added during debugging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good check, did want to keep actualy.

@PaulHax PaulHax force-pushed the export-segment-group branch from 55cb8a3 to 67d2631 Compare December 29, 2023 16:59
Copy link
Contributor

@floryst floryst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Haven't tested functionality yet.

@PaulHax PaulHax added this pull request to the merge queue Dec 31, 2023
Merged via the queue into Kitware:main with commit b1951c4 Dec 31, 2023
PaulHax added a commit to PaulHax/VolView that referenced this pull request Apr 24, 2025
Segment group file format selection for serialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants