def test_Calculator(): # ct angles = np.arange(0, 180.5, 1.) ct_series = io.ImageFileSeries( os.path.join(datadir, "cropped*_%07.3f.tiff"), identifiers = angles, decimal_mark_replacement=".", name = "CT", ) calculator = direct.DirectMinimization() t = tilt._compute(ct_series, "_tmp/test_direct/work", calculator=calculator) # print t return
def test_tilt(): dir = os.path.dirname(__file__) datadir = os.path.join(dir, "..", "..", "iMars3D_data_set", "turbine") # ct angles = np.arange(0, 181, 0.85) ct_series = io.ImageFileSeries(os.path.join(datadir, "*CT*_%.3f_*.fits"), identifiers=angles, name="CT") from imars3d.tilt.phasecorrelation import PhaseCorrelation calculator = PhaseCorrelation() t = tilt._compute(ct_series, "_tmp/test_tilt/work", calculator=calculator) print(t) assert t > -2 and t < -1 return
def test_tilt2(): dir = os.path.dirname(__file__) datadir = os.path.join(dir, "..", "..", "iMars3D_data_set", "turbine", "cleaned") # ct angles = np.arange(0, 181, 0.85) ct_series = io.ImageFileSeries( os.path.join(datadir, "smoothed*_%07.3f.tiff"), identifiers=angles, decimal_mark_replacement=".", name="CT" ) from imars3d.tilt.use_centers import Calculator calculator = Calculator(sigma=15, maxshift=200) t = tilt._compute(ct_series, "_tmp/test_tilt2/work", calculator=calculator) print(t) assert t > -1.5 and t < -0.5 return
def test_Calculator(): # ct angles = np.arange(0, 180.5, 1.) ct_series = io.ImageFileSeries( os.path.join(datadir, "cropped*_%07.3f.tiff"), identifiers=angles, decimal_mark_replacement=".", name="CT", ) calculator = direct.DirectMinimization() t = tilt._compute(ct_series, "_tmp/test_direct/work", calculator=calculator) assert np.isclose(t, 0.4) return
def test_tilt(): dir = os.path.dirname(__file__) datadir = os.path.join(dir, "..", "..", "iMars3D_data_set", "turbine") # ct angles = np.arange(0, 181, .85) ct_series = io.ImageFileSeries( os.path.join(datadir, "*CT*_%.3f_*.fits"), identifiers=angles, name="CT", ) from imars3d.tilt.phasecorrelation import PhaseCorrelation calculator = PhaseCorrelation() t = tilt._compute(ct_series, "_tmp/test_tilt/work", calculator=calculator) print(t) assert t > -2 and t < -1 return
def test_tilt2(): dir = os.path.dirname(__file__) datadir = os.path.join(dir, "..", "..", "iMars3D_data_set", "turbine", "cleaned") # ct angles = np.arange(0, 181, .85) ct_series = io.ImageFileSeries( os.path.join(datadir, "smoothed*_%07.3f.tiff"), identifiers=angles, decimal_mark_replacement=".", name="CT", ) from imars3d.tilt.use_centers import Calculator calculator = Calculator(sigma=15, maxshift=200) t = tilt._compute(ct_series, "_tmp/test_tilt2/work", calculator=calculator) print(t) assert t > -1.5 and t < -.5 return
#!/usr/bin/env python import os, glob, numpy as np from imars3d import tilt from imars3d.io import ImageFileSeries dir = '/SNSlocal2/__autoreduce.CT-group-7197/intensity-fluctuation-correction/' files = glob.glob(os.path.join(dir, '*.tiff')) angles = [ float('.'.join(os.path.splitext(os.path.basename(f))[0].split('_')[1:])) for f in files ] angles = sorted(angles) angles = np.array(angles) ct = ImageFileSeries( '/SNSlocal2/__autoreduce.CT-group-7197/intensity-fluctuation-correction/intfluctcorrected_%07.3f.tiff', angles, decimal_mark_replacement='_', ) print ct[10] tilt._compute(ct, 'tilt', calculator=tilt.direct.DirectMinimization()) # tilt._compute(ct, 'tilt', calculator=tilt.phasecorrelation.PhaseCorrelation()) # tilt._compute(ct, 'tilt', calculator=tilt.use_centers.UseCenters(sigma=15, maxshift=200))