Exemplo n.º 1
0
 def testCorrectTwoShellOk(self):
     dann = Dry()
     model2s = dann.train_model(bval2s)
     dann.fwe(dwis2s, model2s, bval2s, testingdir)
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "merged1/tissue_volume_fraction.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "merged1/fwe_dwi.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "merged2/tissue_volume_fraction.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "merged2/fwe_dwi.nii.gz")))
Exemplo n.º 2
0
 def testCorrectOneShellOk(self):
     dann = Dry()
     model1s = dann.train_model(bval1s)
     dann.fwe(dwis1s, model1s, bval1s, testingdir)
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "test1/tissue_volume_fraction.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "test1/fwe_dwi.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "test2/tissue_volume_fraction.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "test2/fwe_dwi.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "test3/tissue_volume_fraction.nii.gz")))
     self.assertTrue(os.path.isfile(os.path.join(testingdir, "test3/fwe_dwi.nii.gz")))
Exemplo n.º 3
0
 def testCorrectEmptyOutputFolder(self):
     dann = Dry()
     model = dann.train_model(bval1s)
     dann.fwe(dwis1s, model, bval1s)
     self.assertTrue(os.path.isfile("test1/tissue_volume_fraction.nii.gz"))
     self.assertTrue(os.path.isfile("test1/fwe_dwi.nii.gz"))
     self.assertTrue(os.path.isfile("test2/tissue_volume_fraction.nii.gz"))
     self.assertTrue(os.path.isfile("test2/fwe_dwi.nii.gz"))
     self.assertTrue(os.path.isfile("test3/tissue_volume_fraction.nii.gz"))
     self.assertTrue(os.path.isfile("test3/fwe_dwi.nii.gz"))
Exemplo n.º 4
0
 def testCorrectDifferentBval(self):
     dann = Dry()
     model = dann.train_model(bval1s)
     with self.assertRaises(ValueError):
         dann.fwe(dwis1s, model, bval2s, testingdir)
Exemplo n.º 5
0
 def testCorrectEmptyBval(self):
     dann = Dry()
     model = dann.train_model(bval1s)
     with self.assertRaises(ValueError):
         dann.fwe(dwis1s, model, None, testingdir)
Exemplo n.º 6
0
 def testCorrectEmptyModel(self):
     dann = Dry()
     with self.assertRaises(ValueError):
         dann.fwe(dwis1s, None, bval1s, testingdir)
Exemplo n.º 7
0
 def testCorrectEmtpyDwi(self):
     dann = Dry()
     model = dann.train_model(bval1s)
     with self.assertRaises(ValueError):
         dann.fwe(None, model, bval1s, testingdir)
Exemplo n.º 8
0
from dry.dry import Dry

if __name__ == "__main__":
    bfile = 'dry/data/one-shell/test_ok.bvals'
    dwi = ['dry/data/one-shell/test1.nii.gz',
           'dry/data/one-shell/test2.nii.gz',
           'dry/data/one-shell/test3.nii.gz']
    dann = Dry()
    model1s = dann.train_model(bfile)
    dann.fwe(dwi, model1s, bfile, output_folder='dry/data')

    bfile = 'dry/data/two-shell/merged.bval'
    dwi = ['dry/data/two-shell/merged1.nii.gz',
           'dry/data/two-shell/merged2.nii.gz']
    dann = Dry()
    model2s = dann.train_model(bfile)
    dann.fwe(dwi, model2s, bfile, output_folder='dry/data')