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

cornerstone: preview medical images online #23

Closed
kousu opened this issue Nov 27, 2022 · 3 comments
Closed

cornerstone: preview medical images online #23

kousu opened this issue Nov 27, 2022 · 3 comments

Comments

@kousu
Copy link
Member

kousu commented Nov 27, 2022

(moved from https://github.com/neuropoly/computers/issues/167#issuecomment-1272611388)
Use @cornerstonejs/nifti-image-loader to let Gitea preview medical scans the same way it can preview PDFs and SVGs and spreadsheets. Something like:

Screenshot 2022-10-13 at 17-16-14 https __www cornerstonejs org

This will help orient people when using our git with their datasets, making the process less abstract to them. It will also help people feel confident that git annex sync is behaving as they expect, which I think is important because git-annex is a pain.

I believe I need to patch this if-else tree

https://github.com/neuropoly/gitea/blob/88857cfa502057404c00e88eca2ba4aeab118c70/templates/repo/view_file.tmpl#L88-L105

to add a nifti case that loads and runs the cornerstone javascript. I have a starter demo of what needs to be loaded in https://gist.github.com/kousu/2a31328d9c320393fbd603534265faa7.

Then I will need to figure out how Gitea's frontend build process works (it's webpack I think?) so I can know how to serve cornerstone locally.

Later I would also like to add a toolbar like https://viewer.ohif.org/ has. Unfortunately this is going to be some manual work -- Cornerstone doesn't come with a UI library, all that had to be built on top as a wrapper package by the OHIF Viewer (even though they are also the people funding Cornerstone), so I'll need to replicate some of that work. I don't plan to be super fancy, just pan/zoom/scroll-through-slices.

@kousu
Copy link
Member Author

kousu commented Nov 27, 2022

I'm not sure I want to integrate this into #1. For us, planning to use datalad, git-annex and niftis (and bids are all bound together. But by itself git-annex and nifti support are orthogonal features.

So maybe I'll end up publishing v1.18.9-git-annex-cornerstone. Or maybe I'll be able to move this over into the ansible deploy scripts I have for this project in the other repo.

@kousu kousu changed the title Integrate CornerstoneJS for NIfTI previews cornerstone: preview medical images online Nov 30, 2022
@kousu
Copy link
Member Author

kousu commented Nov 30, 2022

After writing this out, I don't want to move this into the nebulous collection of ansible scripts that make up neurogitea: I patched view.go to detect and generate IsNIfTI and IsDICOM values and I can't override .go files from ansible, obviously; they just examine the file extension, and that might be doable entirely in the view_file.tmpl file, but it adds a lot of complication that is much easier handled with git merge.

This can be another useful standalone feature! Like #1, one I doubt upstream will want it, but that's okay. It's even orthogonal to git-annex, my code works just as well on LFS files and regular git blob files.

@kousu
Copy link
Member Author

kousu commented Nov 30, 2022

#30 is done! Or done enough anyway!

But like #1, I'm not going to actually merge it, but instead maintain it as a feature branch indefinitely (see #31). So I'm counting this finished.

@kousu kousu closed this as completed Nov 30, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant