def test_show_reconstructed_image(self) : data = Image.open('sampledata/Shepp_logan.png') data = data.convert('L') data = numpy.array(data) data = numpy.fft.fft2(data) kspace = kSpace(data) kspace.recon() kspace.show()
def main(): #kspace = kSpace(numpy.zeros((5,5))) #kspace = kSpace(numpy.array([ # [ [1, 2, 3], [1, 2, 3], [1, 2, 3] ], # [ [1, 2, 3], [1, 2, 3], [1, 2, 3] ], # [ [1, 2, 3], [1, 2, 3], [1, 2, 3] ] ])) #kspace.IFT() #print(kspace.image) #kspace = kSpace(numpy.random.rand(512, 512, 512)) #kspace.recon() kspace2 = kSpace(numpy.random.rand(10000, 10000)) kspace2.recon()
def setUp(self) : self.kspace = kSpace(numpy.array([ [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5] ]))
def test_require_two_or_three_dimensions(self) : self.assertEqual(self.kspace.data.shape, (5, 5, 5)) with self.assertRaises(ValueError) : kspace = kSpace(numpy.zeros((1)))
def test_require_numpy_array(self) : self.assertEqual(type(self.kspace.data), numpy.ndarray) with self.assertRaises(TypeError) : kspace = kSpace([[1, 2], [1, 2]])
def setUp(self) : self.kspace = kSpace(numpy.zeros((5, 5, 5)))
def setUp(self) : self.kspace = kSpace(numpy.random.rand(256,256,256))
def setUp(self) : self.kspace = kSpace(numpy.array([ [ [1, 2, 3], [1, 2, 3], [1, 2, 3] ], [ [1, 2, 3], [1, 2, 3], [1, 2, 3] ], [ [1, 2, 3], [1, 2, 3], [1, 2, 3] ] ]))