Comments (3)
Thanks for your interest in this repo.
Image slices are expected to be 3D: 2 spacial dimensions and 1 for 3 channels.
Masks slices are 2D.
One image volume is expected to be 4D: an array of 3D image slices.
Corresponding mask volume is expected to be 3D: an array of 2D mask slices.
At the end of the dataset initialization, mask slices are expanded to 3D volumes with one channel.
# add channel dimension to masks
self.volumes = [(v, m[..., np.newaxis]) for (v, m) in self.volumes]
Variable volumes
is expected to be a list of tuples that contain 4D image volume and 4D mask volume.
The order of dimensions is: [slices, height, width, channels].
For example, an image volume with 10 slices and slices of size 200x300 has shape (10, 200, 300, 3) and corresponding mask volume has shape (10, 200, 300, 1).
I hope it helps.
from brain-segmentation-pytorch.
Thank you for the quick response and detailed explanation. I converted .nii.gz files to tiff by thinking that all the input to your code is 2D.
Do you know how can I convert .nii.gz files into .tff (3D images and 2D masks)?
from brain-segmentation-pytorch.
The model is 2D with 3-channel input but on a higher level it segments volumes.
If you have files for only one modality, you can try to copy it to have 3-channel slices or use gray2rgb
function from skimage: https://scikit-image.org/docs/dev/api/skimage.color.html#skimage.color.gray2rgb.
If you have files for three modalities, you have to register them first and then read in the same order and concatenate along the lest dimension/axis.
For masks, you can read them with imread
function from skimage with as_gray=True
: https://scikit-image.org/docs/dev/api/skimage.io.html#skimage.io.imread.
from brain-segmentation-pytorch.
Related Issues (20)
- Reproducibility issue HOT 5
- how to train on my dataset HOT 5
- Training on a custom dataset HOT 1
- in_channels parameter change causes size mismatch HOT 5
- Retraining on own dataset HOT 1
- ValueError: Sample larger than population or is negative HOT 2
- Example on Colab not segmenting the tumor HOT 13
- A puzzle about the code HOT 1
- How can I run the docker container if my GPU isn't nvidia
- Very large images on my dataset
- Run on the test data HOT 3
- Can I run the code on test folder without the masks??
- google colab
- how can I apply other loss functions
- IoU of the model
- Negative loss value HOT 3
- After UNet Inference, how to overlay / superimpose the different size predicted masks to the original image size?
- dice
- Error
- manifest for nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 not found: manifest unknown: manifest unknown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brain-segmentation-pytorch.