This repository is used for segmenting torso organs from mouse micro-CT images.
Please follow the instructions to install 3D-CAFFE.
Notes: Don't forget to build Pycaffe interfaces.
make pycaffe && make install # after modify the config file of CAFFE
The code is developed using python 2.7. Python dependencies are required as follow.
-
SimpleITK
pip install SimpleITK
-
NumPy
pip install numpy
-
H5Py
pip install h5py
-
CAFFE reads the h5 file to train the network. You need to convert origin formats (e.g. .nii/.nii.gz/.mhd, etc.) to h5 files. We provide a python script
cov_format.py
to convert the format of the files. -
You need to create a file name list of the dataset named
data.list
. It should look like this:./id1.h5 ./id2.h5 ./id3.h5 ...
- Put the dataset in the folder.
- Modify the
data.list
path in the filetrain.prototxt
. - Train the model.
cd MouseCTSegmentation
sh train.sh
Notes: You can specify the numbers of GPU runs in the file train.sh.
- Segment the images using the model. We also provide pre-trained models in the folder
model
. You can modify the variablecaffe_model
in the fileseg.py
to use them.
python seg.py
Please contact hanascend@foxmail.com if you have any questions.