Пример #1
0
def mnc2vol(mincfile):
    f = h5py.File(mincfile)
    datatype = str(f['minc-2.0/image/0']['image'].dtype)
    rawfile = mincfile+'.raw'
    headerfile = mincfile+'.header'
    minc2volume.make_raw(mincfile, datatype, rawfile)
    minc2volume.make_header(mincfile, datatype, headerfile)
Пример #2
0
def mnc2vol(mincfile):
    if not os.path.exists(mincfile) :
        print('Warning: could not find file', mincfile)
        exit(1)

    f = h5py.File(mincfile, 'r')
    datatype = str(f['minc-2.0/image/0']['image'].dtype)
    rawfile = mincfile+'.raw'
    headerfile = mincfile+'.header'
    minc2volume.make_raw(mincfile, datatype, rawfile)
    minc2volume.make_header(mincfile, datatype, headerfile)
Пример #3
0
def mnc2vol(niftifile):
    if not os.path.exists(niftifile) :
        print('Warning: could not find file', niftifile)
        exit(1)

    datatype = nib.load(niftifile).get_data().dtype
    basename = os.getcwd()+os.sep+ splitext(os.path.basename(niftifile))[0]
    rawfile = basename +'.raw'
    headerfile = basename +'.header'
    minc2volume.make_raw(niftifile, datatype, rawfile)
    minc2volume.make_header(niftifile, datatype, headerfile)