示例#1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys

from niftynet import main

if __name__ == "__main__":
    sys.exit(main())
示例#2
0
    mystr = "".join(mystr[:-1] + list(DirSave_N) + list('\n'))
    mylist[indSave[0]] = mystr
    #write where model is located
    mystr = list(mylist[indModel[0]])
    mystr = "".join(mystr[:-1] + list(DirModel) + list('\n'))
    mylist[indModel[0]] = mystr
    # Write to a new config file
    f = open('config_inf.ini', 'w')
    f.write(''.join(mylist))
    f.close()

    sys.argv = [
        '', 'inference', '-a', 'net_segment', '--conf',
        os.path.join('config_inf.ini'), '--batch_size', '1'
    ]
    niftynet.main()

    #
    ## Postprocess to get individual neurons
    F1All = np.zeros([len(name), thresh.size[-1], minArea.size[-1]])
    if DirMask is not None:
        for ind in range(len(name)):
            recall, precision, F1 = matlabLib.multiple_postProcessJaccard(
                SZ,
                DirSave_N,
                DirMask,
                name[ind],
                AvgArea,
                minArea,
                thresh,
                JThresh,