コード例 #1
0
ファイル: net_segment.py プロジェクト: junge82/NiftyNet-dev
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys

from niftynet import main

if __name__ == "__main__":
    sys.exit(main())
コード例 #2
0
ファイル: RunThresh.py プロジェクト: yooerzf/STNeuroNet
    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,