lfz / DSB2017

The solution of team 'grt123' in DSB2017
MIT License
1.24k stars 418 forks source link

sitk.ReadImage(filename) is broken. #4

Closed Bonsen closed 7 years ago

Bonsen commented 7 years ago

in prepare.py: if name=='main': full_prep(step1=True,step2=True) is ok. prepare_luna() is ok.

When it ran preprocess_luna(), line 199: Mask,origin,spacing,isflip = load_itk_image(os.path.join(luna_segment,name+'.mhd'))

in load_itk_image(), line 61: itkimage = sitk.ReadImage(filename)

I get: starting preprocessing luna MetaImage: Read: Cannot open data file Traceback (most recent call last): File "prepare.py", line 377, in preprocess_luna() File "prepare.py", line 286, in preprocessluna =pool.map(partial_savenpy_luna,range(1)) File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map return self.map_async(func, iterable, chunksize).get() File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get raise self._value RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK-build/ITK/Modules/IO/Meta/src/itkMetaImageIO.cxx:483: itk::ERROR: MetaImageIO(0x6df4d60): File cannot be read: /luna16/data/original_lung_masks/734.mhd for reading. Reason: Success

Bonsen commented 7 years ago

I set the config wrong...

GaoShanwen commented 5 years ago

@BonsenHai , I meet the same problem,and had been seen the #5 Issue ,but find it isn't the reason.Can you tell me how do you solve it or the details of your wrong config.Thanks very much!

GaoShanwen commented 5 years ago

@Bonsen I find the only difference with you is the file in luna_segment's folder,I have not the file named ",zraw", Can you tell me where the file created? this is what you write in the #5 'luna_segment':'/home/luna16/seg-lungs-LUNA16/', ///like: // inflating: 1.3.6.1.4.1.14519.5.2.1.6279.6001.162845309248822193437735868939.mhd // inflating: 1.3.6.1.4.1.14519.5.2.1.6279.6001.162845309248822193437735868939.zraw

GaoShanwen commented 5 years ago

ok,thank you ,I slove this problem by copying .raw file,and rename it.