def test_Export_terminal(self): import niprov niprov.discover("testdata") pth = os.path.abspath("testdata/dicom/T1.dcm") provenance = niprov.ProvenanceContext().get().byLocation(pth) niprov.print_(provenance)
def test_Discover(self): import niprov niprov.discover("testdata") img = niprov.ProvenanceContext().get().byLocation(os.path.abspath("testdata/dicom/T1.dcm")) self.assertEqual(img.provenance["dimensions"], [80, 80, 10]) img = niprov.ProvenanceContext().get().byLocation(os.path.abspath("testdata/eeg/stub.cnt")) self.assertEqual(img.provenance["subject"], "Jane Doe")
def test_Log(self): import niprov niprov.discover('testdata') newfile = os.path.abspath('temp/smoothed.test') self.touch(newfile) niprov.log(newfile, 'test', os.path.abspath('testdata/eeg/stub.cnt')) img = niprov.ProvenanceContext().get().byLocation(newfile) self.assertEqual(img.provenance['subject'], 'Jane Doe') self.assertEqual(img.provenance['size'], os.path.getsize(newfile))
def test_Discover(self): import niprov niprov.discover('testdata') img = niprov.ProvenanceContext().get().byLocation( os.path.abspath('testdata/dicom/T1.dcm')) self.assertEqual(img.provenance['dimensions'], [80, 80, 10]) img = niprov.ProvenanceContext().get().byLocation( os.path.abspath('testdata/eeg/stub.cnt')) self.assertEqual(img.provenance['subject'], 'Jane Doe')
def test_Narrative_file(self): import niprov niprov.discover('testdata') pth = os.path.abspath('testdata/dicom/T1.dcm') provenance = niprov.ProvenanceContext().get().byLocation(pth) text = niprov.export(provenance, 'direct', 'narrated') self.assertEqual(text, ( "This is a T1 image. It was recorded August 5, " "2014. The participant's name is 05aug14test. It is 158KB in size. " ))
def test_Log(self): import niprov niprov.discover("testdata") newfile = os.path.abspath("temp/smoothed.test") self.touch(newfile) niprov.log(newfile, "test", os.path.abspath("testdata/eeg/stub.cnt")) img = niprov.ProvenanceContext().get().byLocation(newfile) self.assertEqual(img.provenance["subject"], "Jane Doe") self.assertEqual(img.provenance["size"], os.path.getsize(newfile))
def test_Narrative_file(self): import niprov niprov.discover("testdata") pth = os.path.abspath("testdata/dicom/T1.dcm") provenance = niprov.ProvenanceContext().get().byLocation(pth) text = niprov.export(provenance, "direct", "narrated") self.assertEqual( text, ( "This is a T1 image. It was recorded August 5, " "2014. The participant's name is 05aug14test. It is 158KB in size. " ), )
def test_bySubject(self): import niprov niprov.discover('testdata') provenance = niprov.ProvenanceContext().get().bySubject('05aug14test') niprov.print_(provenance)
def test_Export_terminal(self): import niprov niprov.discover('testdata') pth = os.path.abspath('testdata/dicom/T1.dcm') provenance = niprov.ProvenanceContext().get().byLocation(pth) niprov.print_(provenance)
def test_bySubject(self): import niprov niprov.discover("testdata") provenance = niprov.ProvenanceContext().get().bySubject("05aug14test") niprov.print_(provenance)