You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on supporting volumetric image processing in CellProfiler for the last few months. I've had to manufacture much of my own 3D data for validation and testing. While creating image stacks is simple enough, I wonder if some real-world 3D image data might be a useful addition to skimage.data.
I have cell data from our collaborators at the Allen Institute for Cell Science which they are happy to contribute. There are two available images of size (60, 1024, 1024, 4) and (65, 1024, 1024, 4). Not all channels are necessary for a sample image; a single-channel 3D image would be sufficient. I primarily concentrate on the membrane channel:
@mcquin Hi! Short answer - absolutely yes! We've been looking for a sample since, at least, #1923 (see the discussion there).
Could you clarify the meaning of different dimensions of (60, 1024, 1024, 4)? As I understand, there are 60 slices of 1024x1024 images. What does 4 stand for?
Correct, the image dimensions are described by (plane, x, y, channel). I think the nucleus channel is probably the most useful.
Would you like me to submit the raw image as a numpy array? Or would a cleaned up image be preferred? I am also thinking that the slices that are entirely noise (approximately 10 slices at the top and bottom) could be removed, and the image could be cropped or rescaled to 512x512 in the xy-dimensions to save space.
@soupault Great question. The image is not a true volume. The resolution in the z-dimension is much lower than the resolution in the xy-dimension. I don't have the exact voxel spacing, but I can get that information from the people who produced the image.
@mcquin Thank you very much for this contribution! It looks like the relevant points are being addressed: meta-data (as much as we can obtain) and license. Also a mention of the Allen institute in the function that loads the data would be good.
I think that it would be better to add some true volumetric 3D image, and add a function to skimage.data with the parameter to choose between true volume and sliced versions (should be easily done via numpy indexing).
My point is that for many algorithms, such as denoising, skeletonization, inpainting, 3D morphology, etc, true volume is expected, so it will be beneficial to have one. (not saying that the sliced version is of no use)
@mcquin Is there something of this kind either you or Allen Institute able to provide?
@soupault I can't provide any true volume data. This is a result of how the volume is constructed. Each plane is an image captured at a different height of the well in which the cells grow.
I agree that a true volume would be useful, but such data is not available to me. I work entirely with anisotropic volumes.
Thanks @mcquin for this! I actually think keeping multiple channels is beneficial, in terms of having a very generic high-dimensional array example.
(Also, in this project, please refer to coords as (plane, row, column, channel), to avoid confusion with Cartesian x/y (where x is typically the horizontal coordinates). We are still trying to clean up various parts of the project because we were lackadaisical about this in the early days. =P)
@soupault I think it is very valuable to have anisotropic data. Many algorithms are isotropic only by historical accident. Having an anisotropic example by default might encourage future contributors to consider this use case from the start. =)
So my vote would be to include this dataset as well as the MRI dataset suggested by @grlee77.
These datasets are indeed huge though, and I don't know that I would want them distributed with skimage by default — perhaps they can be downloaded on-demand? I've also used github-lfs in the past and quite like it, though others might rightly object to its non-standardness.
As to the metadata, how about adding a load_<img>_metadata function that returns a dictionary? We can discuss handling metadata dictionaries in various functions later. ;)
The 3D brain suggestion was intended to be in addition to the dataset mentioned by the author of this PR. Certainly there is value in having a range of example data for different use cases!
The file above is under a BSD 3-clause license. It has various "fetcher" routines that handle downloading large example datasets from a remote location to a folder in the user's home directory (~/.dipy), and then checking their md5 sums. (There is even already a fetcher there for the MNI brain atlas I mentioned previously, but as mentioned above, we would want to use a simple .npy array rather than the NIFTI neuroimaging data format to avoid introducing any new dependencies to scikit-image).
Having an anisotropic example by default might encourage future contributors to consider this use case from the start.
I hope for this future so much. :)
I have information on the resolution of the image: 0.29 x 0.065 x 0.065 um.
As to the metadata, how about adding a load_<img>_metadata function that returns a dictionary?
Great idea! I think "spacing" -> Tuple and "multichannel" -> Boolean are useful. The image dimensionality can be inferred from either of those values. For my own clarification, multichannel typically means RGB/RGBA?
I actually think keeping multiple channels is beneficial, in terms of having a very generic high-dimensional array example.
Nice! I think this data would make for an interesting example with all channels. I'll find out from our collaborators what each channel represents. This could be provided with the image metadata, or in the image documentation. I'm less concerned with data size if we're thinking about remote download.
It has various "fetcher" routines that handle downloading large example datasets from a remote location to a folder in the user's home directory (~/.dipy), and then checking their md5 sums.
This is a solid pattern.
I'm not familiar with git-lfs. I'd be concerned about storing large image data on GitHub since repositories are generally limited to 1 GB.
The 3D brain suggestion was intended to be in addition to the dataset mentioned by the author of this PR. Certainly there is value in having a range of example data for different use cases!
Yeah!! I love the breadth of the 2D examples. It would be wonderful to have just as many diverse examples of 3D data.
Great idea! I think "spacing" -> Tuple and "multichannel" -> Boolean are useful.
Yes. If we do implement meta=, I would also suggest that we introduce aliases. "spacing", "scale", "scaling", and "resolution" have been variously proposed for this purpose. For kwargs we had to unify but for meta we can include common synonyms.
For my own clarification, multichannel typically means RGB/RGBA?
Typically, yes, but we want to aim to be general here also. It can also mean other colorspaces (such as Lab), or multispectral data (as in many microscopy applications). So I very much like having a four channel example image. =)
@grlee77 and @matthew-brett, who work with Nifti files, would perhaps be able to comment on the kinds of metadata they find useful in neuroimaging. Can we transfer that experience to the question of which types of image metadata we should care about?
Unlike the DICOM format, NIFTI does not retain a ton of metadata. Primarily it has information related to voxel dimensions and patient orientation (as defined by a 4x4 affine matrix) so that the user can accurately distinguish left from right etc. Obviously orientation info is very important clinically or when reporting research results, but not so much when using as a generic example volume in scikit-image to demonstrate denoising/segmentation/etc.
I think for scikit-image purposes, just having the "spacing"/"scaling" info and whether or not the data is "multichannel" should be sufficient.
I should also mention that a variety of data types (char, unsigned int, float, complex) can be stored in NIFTI files. For use in scikit image, rescaling the absolute intensities to floats in the range [0, 1] is probably most appropriate.
It seems like a few things will need to be in place before any 3D data can be submitted:
A decision on where to host the images.
Implementation of image fetching and local caching.
Metadata format and required fields.
I'm often 👎 on a gigantic issue thread covering several topics (but I'll admit that's largely a personal preference). Is there any need to break these components out into separate issues and continue discussion there?
We need also the permission if you are not the author. Ideally, CC0 public domain.
@sciunto My collaborators are wondering how to give this permission. Do you require a license file with the data, an email expressing permission, or something else?
Activity
soupault commentedon Feb 15, 2017
@mcquin Hi! Short answer - absolutely yes! We've been looking for a sample since, at least, #1923 (see the discussion there).
Could you clarify the meaning of different dimensions of
(60, 1024, 1024, 4)? As I understand, there are 60 slices of 1024x1024 images. What does 4 stand for?mcquin commentedon Feb 15, 2017
@soupault Fantastic!
Correct, the image dimensions are described by
(plane, x, y, channel). I think the nucleus channel is probably the most useful.Would you like me to submit the raw image as a numpy array? Or would a cleaned up image be preferred? I am also thinking that the slices that are entirely noise (approximately 10 slices at the top and bottom) could be removed, and the image could be cropped or rescaled to 512x512 in the xy-dimensions to save space.
sciunto commentedon Feb 16, 2017
That's great. I'm also +1 for the nucleus channel. Space is of course a limitation and your suggestion sounds good to me.
sciunto commentedon Feb 16, 2017
cc @jni @emmanuelle
soupault commentedon Feb 16, 2017
@mcquin is that "pure" volumetric data (i.e. is the distance between 2 adjacent planes equal to the distance between adjacent pixels in x*y)?
mcquin commentedon Feb 16, 2017
@soupault Great question. The image is not a true volume. The resolution in the z-dimension is much lower than the resolution in the xy-dimension. I don't have the exact voxel spacing, but I can get that information from the people who produced the image.
sciunto commentedon Feb 16, 2017
@mcquin We need also the permission if you are not the author. Ideally, CC0 public domain.
stefanv commentedon Feb 16, 2017
@mcquin Thank you very much for this contribution! It looks like the relevant points are being addressed: meta-data (as much as we can obtain) and license. Also a mention of the Allen institute in the function that loads the data would be good.
soupault commentedon Feb 17, 2017
I think that it would be better to add some true volumetric 3D image, and add a function to
skimage.datawith the parameter to choose between true volume and sliced versions (should be easily done via numpy indexing).My point is that for many algorithms, such as denoising, skeletonization, inpainting, 3D morphology, etc, true volume is expected, so it will be beneficial to have one. (not saying that the sliced version is of no use)
@mcquin Is there something of this kind either you or Allen Institute able to provide?
mcquin commentedon Feb 17, 2017
@soupault I can't provide any true volume data. This is a result of how the volume is constructed. Each plane is an image captured at a different height of the well in which the cells grow.
I agree that a true volume would be useful, but such data is not available to me. I work entirely with anisotropic volumes.
grlee77 commentedon Feb 17, 2017
Two other possibilities for 3D data:
1.) There are a number of 3D brain MRI datasets that are publicly available online. For example, the 1mm isotriopic resolution brain atlases at the following link are around 50-60 MB, but if only a single contrast is retained the file would be around 10-20 MB:
http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009
If there is interest in this approach I would be willing to convert one of these from the domain-specific NIFTI format to a standard numpy .npy file (e.g. by using nibabel) and make a PR.
2.) implement a digital phantom that can be defined analytically so that no dataset has to be stored. For instance, there is a 3D variant of the Shepp-Logan phantom (example Matlab implementation: https://www.mathworks.com/matlabcentral/fileexchange/9416-3d-shepp-logan-phantom ). Drawbacks are that someone would have to take time to port to python and a piecewise-constant phantom may not be realistic for some applications.
soupault commentedon Feb 19, 2017
Thanks for you comments!
I'd be be in favour adding the brain MRI scans from @grlee77, and not a synthetic data.
Regarding the sliced one from @mcquin: I do not work with such data, so I let other core devs to decide. Will support any decision.
jni commentedon Feb 20, 2017
Hi all!
Thanks @mcquin for this! I actually think keeping multiple channels is beneficial, in terms of having a very generic high-dimensional array example.
(Also, in this project, please refer to coords as (plane, row, column, channel), to avoid confusion with Cartesian x/y (where x is typically the horizontal coordinates). We are still trying to clean up various parts of the project because we were lackadaisical about this in the early days. =P)
@soupault I think it is very valuable to have anisotropic data. Many algorithms are isotropic only by historical accident. Having an anisotropic example by default might encourage future contributors to consider this use case from the start. =)
So my vote would be to include this dataset as well as the MRI dataset suggested by @grlee77.
These datasets are indeed huge though, and I don't know that I would want them distributed with skimage by default — perhaps they can be downloaded on-demand? I've also used github-lfs in the past and quite like it, though others might rightly object to its non-standardness.
As to the metadata, how about adding a
load_<img>_metadatafunction that returns a dictionary? We can discuss handling metadata dictionaries in various functions later. ;)grlee77 commentedon Feb 20, 2017
The 3D brain suggestion was intended to be in addition to the dataset mentioned by the author of this PR. Certainly there is value in having a range of example data for different use cases!
Along the lines of @jni's suggestion to download on-demand, I would point to the example of the data fetchers used by the Diffusion Imaging in Python project dipy. Specifically:
https://github.com/nipy/dipy/blob/master/dipy/data/fetcher.py
The file above is under a BSD 3-clause license. It has various "fetcher" routines that handle downloading large example datasets from a remote location to a folder in the user's home directory (~/.dipy), and then checking their md5 sums. (There is even already a fetcher there for the MNI brain atlas I mentioned previously, but as mentioned above, we would want to use a simple .npy array rather than the NIFTI neuroimaging data format to avoid introducing any new dependencies to scikit-image).
mcquin commentedon Feb 20, 2017
I hope for this future so much. :)
I have information on the resolution of the image: 0.29 x 0.065 x 0.065 um.
Great idea! I think
"spacing" -> Tupleand"multichannel" -> Booleanare useful. The image dimensionality can be inferred from either of those values. For my own clarification, multichannel typically means RGB/RGBA?Nice! I think this data would make for an interesting example with all channels. I'll find out from our collaborators what each channel represents. This could be provided with the image metadata, or in the image documentation. I'm less concerned with data size if we're thinking about remote download.
This is a solid pattern.
I'm not familiar with git-lfs. I'd be concerned about storing large image data on GitHub since repositories are generally limited to 1 GB.
Yeah!! I love the breadth of the 2D examples. It would be wonderful to have just as many diverse examples of 3D data.
jni commentedon Feb 20, 2017
Yes. If we do implement
meta=, I would also suggest that we introduce aliases. "spacing", "scale", "scaling", and "resolution" have been variously proposed for this purpose. For kwargs we had to unify but for meta we can include common synonyms.Typically, yes, but we want to aim to be general here also. It can also mean other colorspaces (such as Lab), or multispectral data (as in many microscopy applications). So I very much like having a four channel example image. =)
stefanv commentedon Feb 20, 2017
@grlee77 and @matthew-brett, who work with Nifti files, would perhaps be able to comment on the kinds of metadata they find useful in neuroimaging. Can we transfer that experience to the question of which types of image metadata we should care about?
grlee77 commentedon Feb 21, 2017
Unlike the DICOM format, NIFTI does not retain a ton of metadata. Primarily it has information related to voxel dimensions and patient orientation (as defined by a 4x4 affine matrix) so that the user can accurately distinguish left from right etc. Obviously orientation info is very important clinically or when reporting research results, but not so much when using as a generic example volume in scikit-image to demonstrate denoising/segmentation/etc.
I think for scikit-image purposes, just having the "spacing"/"scaling" info and whether or not the data is "multichannel" should be sufficient.
grlee77 commentedon Feb 21, 2017
I should also mention that a variety of data types (char, unsigned int, float, complex) can be stored in NIFTI files. For use in scikit image, rescaling the absolute intensities to floats in the range [0, 1] is probably most appropriate.
mcquin commentedon Feb 22, 2017
It seems like a few things will need to be in place before any 3D data can be submitted:
I'm often 👎 on a gigantic issue thread covering several topics (but I'll admit that's largely a personal preference). Is there any need to break these components out into separate issues and continue discussion there?
@sciunto My collaborators are wondering how to give this permission. Do you require a license file with the data, an email expressing permission, or something else?
grlee77 commentedon Feb 24, 2017
+1 on splitting to separate issues. that way this one can stay focused more narrowly on the Allen Institute dataset
sciunto commentedon Apr 9, 2017
@mcquin I think we never set such rules so far. @stefanv can confirm.
stefanv commentedon Sep 12, 2018
@mcquin Is this the same data as https://github.com/scikit-image/skimage-tutorials/blob/master/images/cells.tif, and did we ever clarify the license issues?
mcquin commentedon Sep 13, 2018
@stefanv Yep, same image. The license is CC0.