Error in running 3-D Brain Tumor Segmentation Using Deep Learning

9 次查看(过去 30 天)
I encounted an error while running the 3-D Brain Tumor Segmentation Using Deep Learning example.
It gives the following error
Error using matlab.io.datastore.ImageDatastore/read (line 77)
Error using ReadFcn @(x)(niftiread(x)>0) function handle for file
C:\Users\Jenni\AppData\Local\Temp\BraTS\Task01_BrainTumor\labelsTr\._BRATS_166.nii.gz.
Error using images.internal.nifti.niftiFile/getUncompressedFileName (line 130)
Cannot unzip file. tempdir needs write permissions and sufficient free space.
Error in images.internal.nifti.niftiFile (line 45)
[filename, self.TempfileCleaners, ~] =
self.getUncompressedFileName(firstFile);
Error in niftiread (line 66)
NF = images.internal.nifti.niftiFile(varargin{:});
Error in preprocessBraTSdataset>@(x)(niftiread(x)>0) (line 31)
labelReader = @(x) (niftiread(x) > 0);
Error in matlab.io.datastore.PixelLabelDatastore/readNumeric (line 854)
[L,info] = read(this.ImageDatastore);
Error in preprocessBraTSdataset (line 46)
outL = readNumeric(pxds);
Anyone knows how to fix this error? The code can be obtained here.
Thank you
  1 个评论
David Vaughan
David Vaughan 2021-1-20
This error from niftiRead occurs when there is no java machine running.
You can check this using : usejava('jvm').
The displayed error message that tmpdir needs write permissions etc is misleading.
The error occurs when trying to niftiRead() a .nii.gz file, which calls gunzip(), which calls checkFilesDirinputs(). This last function throws an error if there is no active java machine, but (for me) the message that java is required for this function is never displayed - perhaps because of the multiple try/catch layers at that point.
For me, the fix was to lauch matlab as 'matlab -nodesktop' rather than 'matlab -nojvm -nodesktop'

请先登录,再进行评论。

回答(1 个)

Shashank Gupta
Shashank Gupta 2019-9-30
Hi Jennifer,
Cannot unzip file. tempdir needs write permissions and sufficient free space
this stack of error suggest that “niftiread()” is not able to unzip “.nii.gz” file either because of the folder does not have a read/write permission or there is no sufficient space for the function to unzip the file in the CPU/GPU memory.
You can cross check this error by reading one or two “.nii” volumes through “ImageDatastore” function. If the error persists then check your administrator permission for the folder.
I hope this helps.

类别

Help CenterFile Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by