This reposirory is based on pytorch-3dunet implementation.
- create bigger dataset of volume
This reposirotry is builded with
Please not also that 3D-segemtantion is not available on a macOS machine, as pytorch with metal support only supports 4D arrays!
Clone this repository using the terminal:
git clone https://github.com/choROPeNt/3dseg.git
and navigate to it in your terminal.
cd 3dseg
Then run:
python -m pip install -e .
This should install the 3dseg
python package via PIP in the current active virtual enviroment. How to set up a virtual enviroment please refer to virtual enviroment section
The model is a 3D-UNet
The DiceLoss $\mathcal{L}{Dice}$ is defined as following $$\mathcal{L}{\text{Dice}} = \frac{2 \sum_i^N p_i g_i}{\sum_i^Np_i^2+\sum_i^N g_i^2}$$
linear combination of BCE and Dice loss
python ./scripts/train.py --config <CONFIG>
[b,c,d,w,h] -> [b,3*c,d,w,h]
to create a virtual enviroment named .venv
you may run
python -m venv .venv
to activate the virtual enviroment please run
- for linux and macos
source .venv/bin/activate
If you are using a macOS machine and want to access your results faster, it's reccommended to install HDF5 with MPI support.
make sure you have installed HDF5 with MPI support. Otherwise you can install it using the Homebrew formula
brew install hdf5-mpi
After a succefull installation you have to set the PATH
variables for the compiler
export CC=mpicc
export HDF5_MPI="ON"
export HDF5_DIR="/path/to/parallel/hdf5" # If this isn't found by default
If you are unsure where the location of your HDF5-MPI binary is, you can find the HDF5_DIR
with running
h5pcc -showconfig
In the case you have an
Install the python package h5py
with
% python -m pip install --no-binary=h5py --no-cache-dir h5py
the options --no-binary=h5py
and --no-cache-dir
that pip
is forced to build the package from source via wheel