示例#1
0
 def from_csv(self):
     filename = askopenfilename(initialdir=self.data_folder,
                                title="CSV Sinogram",
                                filetypes=(("CSV Files", "*.csv"),
                                           ("all files", "*.*")))
     self.sinogram = sinogram.from_csv(filename)
     self.update('from_csv')
示例#2
0
def test_to_unshuff_pdf():
    result = sinogram.from_csv(SIN_CSV_FILE)
    f = os.path.join(DATA_PATH, result.meta['document_id'] + ' Sinogram.pdf')
    if os.path.isfile(f):
        os.remove(f)
    sinogram.to_unshuff_pdf(result, file_name=f)
    assert os.path.isfile(f)
示例#3
0
def test_csv_to_png():
    sinogram.to_png(sinogram.from_csv(SIN_CSV_FILE), PNG_CSV_FILE)
    assert os.path.isfile(PNG_CSV_FILE)
示例#4
0
def test_from_csv():
    result = sinogram.from_csv(SIN_CSV_FILE)
    assert result.meta['document_id'] == '00000 - ANONYMOUS, PATIENT'
    assert result.shape == (464, 64)
    assert np.all(result.data <= 1.0)
    assert np.all(result.data >= 0.0)
示例#5
0
def test_get_mod_factor():
    result = sinogram.from_csv(SIN_CSV_FILE)
    assert np.isclose(sinogram.get_mod_factor(result), 2.762391)
示例#6
0
def test_get_histogram():
    result = sinogram.from_csv(SIN_CSV_FILE)
    assert sinogram.get_histogram(result, bins=50)[0][0] == 25894