Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
 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] ]))
Ejemplo n.º 4
0
 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)))
Ejemplo n.º 5
0
 def test_require_numpy_array(self) :
     self.assertEqual(type(self.kspace.data), numpy.ndarray)
     with self.assertRaises(TypeError) :
         kspace = kSpace([[1, 2], [1, 2]])
Ejemplo n.º 6
0
 def setUp(self) :
     self.kspace = kSpace(numpy.zeros((5, 5, 5)))
Ejemplo n.º 7
0
 def setUp(self) :
     self.kspace = kSpace(numpy.random.rand(256,256,256))
Ejemplo n.º 8
0
 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] ] ]))