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

Load image sequence - format not supported #225

Open
ghost opened this issue Feb 15, 2024 · 7 comments
Open

Load image sequence - format not supported #225

ghost opened this issue Feb 15, 2024 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 15, 2024

Hello, it seems like tif format image slices are supported based on #30. I have 15 image slices in .tif format and would like to load it in Unity, but it shows "Found no image files of supported formats." Any help would be appreciated :)

image

@mlavik1
Copy link
Owner

mlavik1 commented Feb 15, 2024

Hi! So there are two image sequence importers

  • The default one: Works on all platforms - TIFF not supported
  • SimpleITK: Works on Windows, Linux, Mac - TIFF support

From your screenshot it looks like you're not using SimpleITK. Could you enable it and try again maybe?
Documentation on how to enable SimpleITK: https://github.com/mlavik1/UnityVolumeRendering/blob/master/Documentation/SimpleITK/SimpleITK.md

@ghost
Copy link
Author

ghost commented Feb 15, 2024

Thank you for your quick reply. I checked the option to enable simpleTK and also switched the platform to PC, Mac, and Linux standalone in Unity, but it's still showing me the same error. Here are some more infor:
Unity version: 2019.4.23
TIFF data: EmbryoCE.zip from https://scif.io/images/
image
image

@mlavik1
Copy link
Owner

mlavik1 commented Feb 15, 2024

Nice catch @yangx789 !
Apparently SimpleITK's importer was never used for image sequences (and it couldnt, without some modifications..).
I've fixed that in this PR: https://scif.io/images/

However, I noticed: This seems to be a 4D dataset. Is it a time series?
We currently don't support that, but we could probably load the first time frame at least.. I did an attempt at that in that PR. Feel free to try out my branch: simpleitk-imgseq

This is how it looks (data values are inverted, so I had to invert the TF:
image
Do you have any images of it rendered in another application, that I could use as a reference?

@ghost
Copy link
Author

ghost commented Feb 20, 2024

Thank you @mlavik1 The new branch works for me. Yep, it seems like that is a time-series dataset. There's another brain MRI dataset at this site: https://people.math.sc.edu/Burkardt/data/tif/tif.html They have 26 png brain slices that are available to download, and I've attached the zipped files here.
mri_brain.zip

image

@ghost ghost closed this as completed Feb 20, 2024
@ghost ghost reopened this Feb 20, 2024
@ghost
Copy link
Author

ghost commented Feb 20, 2024

I get another question regarding image sequence importer. I was wondering how does the X, Y, Z spacing dimension was calculated :)

@mlavik1
Copy link
Owner

mlavik1 commented Feb 22, 2024

@yangx789 great to hear it worked!
I'll merge my PR once I've fixed one of the hacks I had to do there..
And thanks for the dataset! I'll have a look at that too.
Are you interesting in rendering time series btw? I've been thinking about adding support for that, so I'm interested in hearing about possible use cases.

And regarding your question: SimpleITK takes care of that. I read the size and spacing, if available. Not all image sequence formats have that info though, and will probably be uniformly spaced... Do you know if TIFF has any such info?
See releavant code here:

@mlavik1
Copy link
Owner

mlavik1 commented Feb 23, 2024

Update: I removed the hack, and added a new "import image file" option in the "Volume rendering" -> "Load dataset" menu. Now you can use that to load a single .tiff file.
The previous hack I did always loaded the first one - so now you can choose which one to import.

I'll merge this after some more testing. Then I'll see if I can find some time to implement support for time series :)

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

No branches or pull requests

1 participant