Skip to content
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

Segment group file format selection for serialization #527

Merged
merged 5 commits into from
Dec 31, 2023

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.

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.

package.json Outdated Show resolved Hide resolved
src/store/segmentGroups.ts Show resolved Hide resolved
@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.

@@ -203,6 +203,7 @@ export const useDicomWebStore = defineStore('dicom-web', () => {
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
Collaborator

@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
7 checks passed
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