def test_orientation(self): xform = self.image.orientation_xform.tomatrix() oname = analyze.canonical_orient(xform) msg = 'coronal expected, got %s'%oname assert oname == 'coronal', msg ana = analyze.readImage(os.path.join(self.pwd, 'MRI_forSEF')) xform = ana.orientation_xform.tomatrix() oname = analyze.canonical_orient(xform) msg = 'radiological expected, got %s'%oname assert oname == 'radiological', msg FlipSlices(flipud=True).run(ana) xform = ana.orientation_xform.tomatrix() oname = analyze.canonical_orient(xform) msg = 'transverse exepcted, got %s'%oname assert oname == 'transverse', msg FlipSlices(fliplr=True).run(ana) xform = ana.orientation_xform.tomatrix() oname = analyze.canonical_orient(xform) msg = 'unknown transform expected, got %s'%oname assert oname == '', msg
def setUp(self): self.pwd = os.path.split(__file__)[0] fname = os.path.join(self.pwd, 'gems') self.image = analyze.readImage(fname)