gur9000 / deep_mri_brain_extraction Goto Github PK
View Code? Open in Web Editor NEW3D convolutional neural network for MRI brain extraction
License: MIT License
3D convolutional neural network for MRI brain extraction
License: MIT License
In Segmentation_predictor line 132
pred[c, x::CNET_stride[0], y::CNET_stride[1], z::CNET_stride[2]] = rr[0,:,c,:,:].reshape((pred_size[0], pred_size[1], pred_size[2]))
I really want to know why the pred's value is determined by this. I mean it jumps.
And at the top of this line I notice that you only shift the data one vixel but you can get twice output. I think it is overlap. Maybe I misunderstand your paper? I am really confused.
There is some alignment/newline problem in section IV. Examples.
Correction as attachment. (I had to rename it in Readme.md.txt because the md extension was not accepted.
$ python deep3Dpredict.py -name OASIS_ISBR_LPBA40__trained_CNN.save -data TCGA-02-0046_1998.11.28_t2.nii.gz -output deep-mask.nii -gridsize 16
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Using cuDNN version 6021 on context None
Mapped name None to device cuda: GeForce GTX 1080 (0000:01:00.0)
/home/mingrui/anaconda3/envs/p2_3DUnetCNN/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
using model-parameters: OASIS_ISBR_LPBA40__trained_CNN.save
loading...
Loaded... 100.0 % (240, 1, 240, 155) ('TCGA-02-0046_1998.11.28_t2.nii.gz', None)
Total n. of examples: 1 images/volumes
Training on 0 images/volumes
Testing on 1 images/volumes
Building CNN...
Traceback (most recent call last):
File "deep3Dpredict.py", line 200, in <module>
main()
File "deep3Dpredict.py", line 194, in main
network_size_factor = float(args.CNN_width_scale))
File "deep3Dpredict.py", line 116, in predict
auto_threshold_labels = auto_threshold_labels)
File "/mnt/960EVO/workspace/Deep_MRI_brain_extraction/utils/Segmentation_trainer.py", line 232, in Build3D
dense_output_from_fragments = is_last_layer and use_fragment_pooling)
File "/mnt/960EVO/workspace/Deep_MRI_brain_extraction/NNet_Core/NN_ConvNet.py", line 350, in addConvLayer
output_stride = self.output_stride, verbose = self.verbose)
File "/mnt/960EVO/workspace/Deep_MRI_brain_extraction/NNet_Core/NN_ConvLayer_3D.py", line 271, in __init__
output_shape = list( theano.function([input], self.output.shape, mode = self.mode)(numpy.zeros((1 if input_shape[0]==None else input_shape[0],)+input_shape[1:],dtype=numpy.float32)))
File "/home/mingrui/anaconda3/envs/p2_3DUnetCNN/lib/python2.7/site-packages/theano/compile/function_module.py", line 917, in __call__
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/mingrui/anaconda3/envs/p2_3DUnetCNN/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/mingrui/anaconda3/envs/p2_3DUnetCNN/lib/python2.7/site-packages/theano/compile/function_module.py", line 903, in __call__
self.fn() if output_subset is None else\
RuntimeError: error getting worksize: CUDNN_STATUS_BAD_PARAM
Apply node that caused the error: GpuDnnConv{algo='small', inplace=True, num_groups=1}(GpuContiguous.0, GpuContiguous.0, GpuAllocEmpty{dtype='float32', context_name=None}.0, GpuDnnConvDesc{border_mode='valid', subsample=(1, 1), dilation=(1, 1), conv_mode='conv', precision='float32', num_groups=1}.0, Constant{1.0}, Constant{0.0})
Toposort index: 26
Inputs types: [GpuArrayType<None>(float32, (False, True, False, False)), GpuArrayType<None>(float32, (False, True, False, False)), GpuArrayType<None>(float32, 4D), <theano.gof.type.CDataType object at 0x7ff807861bd0>, Scalar(float32), Scalar(float32)]
Inputs shapes: [(83, 1, 83, 83), (64, 1, 4, 4), (83, 64, 80, 80), 'No shapes', (), ()]
Inputs strides: [(27556, 27556, 332, 4), (64, 64, 16, 4), (1638400, 25600, 320, 4), 'No strides', (), ()]
Inputs values: ['not shown', 'not shown', 'not shown', <capsule object NULL at 0x7ff8079ad900>, 1.0, 0.0]
Outputs clients: [[GpuReshape{5}(GpuDnnConv{algo='small', inplace=True, num_groups=1}.0, TensorConstant{[83 16 4 80 80]})]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "deep3Dpredict.py", line 200, in <module>
main()
File "deep3Dpredict.py", line 194, in main
network_size_factor = float(args.CNN_width_scale))
File "deep3Dpredict.py", line 116, in predict
auto_threshold_labels = auto_threshold_labels)
File "/mnt/960EVO/workspace/Deep_MRI_brain_extraction/utils/Segmentation_trainer.py", line 232, in Build3D
dense_output_from_fragments = is_last_layer and use_fragment_pooling)
File "/mnt/960EVO/workspace/Deep_MRI_brain_extraction/NNet_Core/NN_ConvNet.py", line 350, in addConvLayer
output_stride = self.output_stride, verbose = self.verbose)
File "/mnt/960EVO/workspace/Deep_MRI_brain_extraction/NNet_Core/NN_ConvLayer_3D.py", line 217, in __init__
filters_shape=filter_shape, signals_shape = input_shape if input_shape[0]!=None else None
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
I tried using tcia nifti data, this is the error
There is a bug in deep3Dpredict.py
:
python Deep_MRI_brain_extraction/deep3Dpredict.py -n Deep_MRI_brain_extraction/OASIS_ISBR_LPBA40__trained_CNN.save -i $target -gridsize 16
ValueError: The provided save file/directory does not contain any saved model (file ending in .save)
I tracked the error to the line candidates = findall(path_or_file)
which returns
['D', 'e', 'e', 'p', '_', 'M', 'R', 'I', '_', 'b', 'r', 'a', 'i', 'n', '_', 'e', 'x', 't', 'r', 'a', 'c', 't', 'i', 'o', 'n', '/.autofsck', 'O', 'A', 'S', 'I', 'S', '_', 'I', 'S', 'B', 'R', '_', 'L', 'P', 'B', 'A', '4', '0', '_', '_', 't', 'r', 'a', 'i', 'n', 'e', 'd', '_', 'C', 'N', 'N', ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.