Exemple #1
0
def main():

    file_name = '/local/dataraid/databank/dataExchange/microCT/Elettra.h5'
    file_name_out = 'tmp/projection_'

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                data_type='h5',
                                                projections_start=0,
                                                projections_end=16)

    # Save data
    mydata = ex.Export()
    mydata.xtomo_tiff(data=data, output_file=file_name_out, axis=0)

    file_name = '/local/dataraid/databank/dataExchange/microCT/Elettra.h5'
    file_name_out = 'tmp/sinogram_'

    # Load data
    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                data_type='h5',
                                                slices_start=0,
                                                slices_end=16)

    # Save data
    mydata = ex.Export()
    mydata.xtomo_tiff(data=data, output_file=file_name_out, axis=1)
def main():

    file_name = '/local/dataraid/databank/CHESS/Dummy001_.tif'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/CHESS_01.h5'
    sample_name = 'Dummy'

    projections_start = 1
    projections_end = 181
    white_start = 0
    white_end = 10
    white_step = 1
    dark_start = 0
    dark_end = 10
    dark_step = 1

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        sample_name=sample_name,
        projections_digits=4,
        projections_zeros=True,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
def main():

    file_name = '/local/dataraid/databank/APS_13_BM/NC/Dorthe_F_.nc'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/APS_13_BM_netCDF.h5'

    white_start = 1
    white_end = 4
    white_step = 2
    projections_start = 2
    projections_end = 3
    projections_step = 1

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_step=projections_step,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        projections_digits=3,
        data_type='nc',
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
def main():

    file_name = '/local/dataraid/databank/TXM_26_ID/20130731_004_Stripe_Solder_Sample_Tip1_TomoScript_181imgs_p1s_b1.txrm'
    # white is saturated ....
    white_file_name = '/local/dataraid/databank/TXM_26_ID/20130731_001_Background_Reference_20imgs_p5s_b1.xrm'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/APS_26_ID_xradia.h5'

    sample_name = '20130731_004_Stripe_Solder_Sample_Tip1'

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        white_file_name=white_file_name,
        data_type='xradia',
        log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections',
                          sample_name=sample_name)
Exemple #5
0
def main():

    file_name = '/local/dataraid/databank/ESRF/scan.edf'
    dark_file_name = '/local/dataraid/databank/ESRF/dark.edf'
    white_file_name = '/local/dataraid/databank/ESRF/flat.edf'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/ESRF_test_06.h5'

    sample_name = 'esrf'

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 300
    slices_end = 304

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        white_file_name=white_file_name,
        dark_file_name=dark_file_name,
        sample_name=sample_name,
        slices_start=slices_start,
        slices_end=slices_end,
        data_type='edf',
        log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
def main():
    # read a series of tiff

    # oster: pj: from 0 -> 1440; bf from 0 -> 19; df from 0 -> 19
    file_name = '/local/dataraid/databank/PetraIII/2011_KW16_oster/oster02_0001/scan_0002/ccd/pco01/ccd_.tif'
    dark_file_name = '/local/dataraid/databank/PetraIII/2011_KW16_oster/oster02_0001/scan_0000/ccd/pco01/ccd_.tif'
    white_file_name = '/local/dataraid/databank/PetraIII/2011_KW16_oster/oster02_0001/scan_0001/ccd/pco01/ccd_.tif'

    projections_start = 0
    projections_end = 1441
    white_start = 0
    white_end = 20
    white_step = 1
    dark_start = 0
    dark_end = 20
    dark_step = 1

    # to reconstruct slices from slices_start to slices_end
    # if omitted all data set is recontructed
    slices_start = 1000
    slices_end = 1004

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        slices_start=slices_start,
        slices_end=slices_end,
        #projections_angle_range=360,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        dark_step=dark_step,
        projections_digits=4,
        projections_zeros=True,
        log='INFO')

    # TomoPy xtomo object creation and pipeline of methods.
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    #d.phase_retrieval(pixel_size=0.9e-4, dist=6.9, energy=15.25)
    #d.correct_drift()
    d.center = 1872.87890625
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data=d.data_recon,
                      output_file='tmp/PetraIII_tiff_2_tomoPy_',
                      axis=0)
def main():
    # read a series of tiff
    file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/SAMPLE_T_.tif'
    dark_file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/DF__BEFORE_.tif'
    white_file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/BG__BEFORE_.tif'

    sample_name = 'Teeth'

    projections_start = 0
    projections_end = 1801
    white_start = 0
    white_end = 10
    white_step = 1
    dark_start = 0
    dark_end = 10
    dark_step = 1

    # to reconstruct slices from slices_start to slices_end
    # if omitted all data set is recontructed
    slices_start = 290    
    slices_end = 294    

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                       projections_start = projections_start,
                                                       projections_end = projections_end,
                                                       slices_start = slices_start,
                                                       slices_end = slices_end,
                                                       white_file_name = white_file_name,
                                                       white_start = white_start,
                                                       white_end = white_end,
                                                       white_step = white_step,
                                                       dark_file_name = dark_file_name,
                                                       dark_start = dark_start,
                                                       dark_end = dark_end,
                                                       dark_step = dark_step,
                                                       projections_digits = 4,
                                                       white_digits = 2,
                                                       dark_digits = 2,
                                                       projections_zeros = True,
                                                       log='INFO'
                                                    )    

    # TomoPy xtomo object creation and pipeline of methods.  
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    #d.phase_retrieval()
    #d.correct_drift()
    d.center=1184.0
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data = d.data_recon, output_file = 'tmp/Australian_tiff_2_tomoPy_', axis=0)
def main():

    file_name = '/local/dataraid/databank/SLS_2011/Ashley/3e_final_2_.tif'
    log_file = '/local/dataraid/databank/SLS_2011/Ashley/3e_final_2_.log'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/Ashley_SLS.h5'

    #Read SLS log file data
    file = open(log_file, 'r')

    for line in file:
        if 'Number of darks' in line:
            NumberOfDarks = re.findall(r'\d+', line)
        if 'Number of flats' in line:
            NumberOfFlats = re.findall(r'\d+', line)
        if 'Number of projections' in line:
            NumberOfProjections = re.findall(r'\d+', line)
        if 'Number of inter-flats' in line:
            NumberOfInterFlats = re.findall(r'\d+', line)
        if 'Inner scan flag' in line:
            InnerScanFlag = re.findall(r'\d+', line)
        if 'Flat frequency' in line:
            FlatFrequency = re.findall(r'\d+', line)
        if 'Rot Y min' in line:
            RotYmin = re.findall(r'\d+.\d+', line)
        if 'Rot Y max' in line:
            RotYmax = re.findall(r'\d+.\d+', line)
        if 'Angular step' in line:
            AngularStep = re.findall(r'\d+.\d+', line)
    file.close()

    dark_start = 1
    dark_end = int(NumberOfDarks[0]) + 1
    white_start = dark_end
    white_end = white_start + int(NumberOfFlats[0])
    projections_start = white_end
    projections_end = projections_start + int(NumberOfProjections[0])

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_digits=4,
        white_start=white_start,
        white_end=white_end,
        dark_start=dark_start,
        dark_end=dark_end,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #9
0
def main():

    file_name = '/local/dataraid/databank/Elettra/Volcanic_rock/tomo_.tif'
    dark_file_name = '/local/dataraid/databank/Elettra/Volcanic_rock/dark_.tif'
    white_file_name = '/local/dataraid/databank/Elettra/Volcanic_rock/flat_.tif'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/Elettra_test.h5'

    projections_start = 1
    projections_end = 1441
    white_start = 1
    white_end = 11
    white_step = 1
    dark_start = 1
    dark_end = 11
    dark_step = 1

    sample_name = 'Volcanic_rock'

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 150
    slices_end = 154

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_digits=4,
        slices_start=slices_start,
        slices_end=slices_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        dark_step=dark_step,
        data_type='compressed_tiff',  # comment this line if regular tiff
        projections_zeros=True,
        white_zeros=False,
        dark_zeros=False,
        sample_name=sample_name,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #10
0
def main():

    file_name = '/local/dataraid/databank/SLS_2011/Hornby_SLS/Hornby_b.tif'
    log_file = '/local/dataraid/databank/SLS_2011/Hornby_SLS/Hornby.log'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/SLS.h5'

    #Read SLS log file data
    file = open(log_file, 'r')
    for line in file:
        linelist = line.split()
        if len(linelist) > 1:
            if (linelist[0] == "Number" and linelist[2] == "darks"):
                number_of_darks = int(linelist[4])
            elif (linelist[0] == "Number" and linelist[2] == "flats"):
                number_of_flats = int(linelist[4])
            elif (linelist[0] == "Number" and linelist[2] == "projections"):
                number_of_projections = int(linelist[4])
            elif (linelist[0] == "Rot" and linelist[2] == "min"):
                rotation_min = float(linelist[6])
            elif (linelist[0] == "Rot" and linelist[2] == "max"):
                rotation_max = float(linelist[6])
            elif (linelist[0] == "Angular" and linelist[1] == "step"):
                angular_step = float(linelist[4])
    file.close()

    dark_start = 1
    dark_end = number_of_darks + 1
    white_start = dark_end
    white_end = white_start + number_of_flats
    projections_start = white_end
    projections_end = projections_start + number_of_projections

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_digits=4,
        white_start=white_start,
        white_end=white_end,
        dark_start=dark_start,
        dark_end=dark_end,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #11
0
def main():

    file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/SAMPLE_T_.tif'
    dark_file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/DF__AFTER_.tif'
    white_file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/BG__BEFORE_.tif'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/Australian_test.h5'
    sample_name = 'Teeth'

    projections_start = 0
    projections_end = 1801
    white_start = 0
    white_end = 10
    white_step = 1
    dark_start = 0
    dark_end = 10
    dark_step = 1

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 290
    slices_end = 294

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        slices_start=slices_start,
        slices_end=slices_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        dark_step=dark_step,
        sample_name=sample_name,
        projections_digits=4,
        white_digits=2,
        dark_digits=2,
        projections_zeros=True,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #12
0
def main():
    # read a series of SPE
    file_name = '/local/dataraid/databank/APS_13_BM/SPE/run2_soln1_2_.SPE'

    white_start = 1
    white_end = 8
    white_step = 2
    projections_start = 2
    projections_end = 7
    projections_step = 2

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 100
    slices_end = 104

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_step=projections_step,
        slices_start=slices_start,
        slices_end=slices_end,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        projections_zeros=False,
        white_zeros=False,
        dark_zeros=False,
        projections_digits=1,
        data_type='spe',
        log='INFO')

    # TomoPy xtomo object creation and pipeline of methods.
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    #d.phase_retrieval()
    #d.correct_drift()
    d.center = 705
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data=d.data_recon,
                      output_file='tmp/APS_13_BM_spe_2_tomoPy_',
                      axis=0)
def main():
    # only used to locate the wavelenght.dpt and angle.dpt files   
    raw_tiff_base_name = "/local/dataraid/databank/dataExchange/microCT/SRC/raw/FPA_16_18_18_TOMO_243_Fiber_2500_50_50_"    
    
    hdf5_base_name = "/local/dataraid/databank/dataExchange/microCT/SRC/dx/FPA_16_18_18_TOMO_243_Fiber_2500_50_50_"    
    
    log_file = raw_tiff_base_name + "wavelength.dpt"
    angle_file = raw_tiff_base_name + "angle.dpt"
    
    dir_name = os.path.dirname(hdf5_base_name)
    sample_name_prefix = os.path.basename(hdf5_base_name)
    
    print dir_name
    print sample_name_prefix

    file = open(log_file, 'r')
    for line in file:
        linelist=line.split(",")

        hdf5_file_name = hdf5_base_name+linelist[0]+"cm-1.h5"
        sample_name = hdf5_base_name+linelist[0]+"cm-1"
    
        # set to read slices between slices_start and slices_end
        # if omitted all data set will be converted   
        slices_start = 30    
        slices_end = 36    

        # to create a data exchange file use convert_SRC.py module,
        data, white, dark, theta = tomopy.xtomo_reader(hdf5_file_name,
                                                    slices_start=slices_start,
                                                    slices_end=slices_end)

        # TomoPy xtomo object creation and pipeline of methods.  
        d = tomopy.xtomo_dataset(log='debug')
        d.dataset(data, white, dark, theta)
        d.normalize()
        d.correct_drift()
        #d.optimize_center()
        #d.phase_retrieval()
        #d.correct_drift()
        d.center=64
        d.gridrec()

        # Write to stack of TIFFs.
        rec_name = dir_name + "/rec/" + sample_name_prefix + linelist[0] + "cm-1"

        # Write to stack of TIFFs.
        mydata = ex.Export()
        mydata.xtomo_tiff(data = d.data_recon, output_file = rec_name, axis=0)

    file.close()
Exemple #14
0
def main():
    # read a series of tiff
    file_name = '/local/dataraid/databank/Anka/radios/image_.tif'
    dark_file_name = '/local/dataraid/databank/Anka/darks/image_.tif'
    white_file_name = '/local/dataraid/databank/Anka/flats/image_.tif'

    projections_start = 0
    projections_end = 3167
    white_start = 0
    white_end = 100
    dark_start = 0
    dark_end = 100

    sample_name = 'Anka'

    # to reconstruct slices from slices_start to slices_end
    # if omitted all data set is recontructed    
    slices_start = 800    
    slices_end = 804    

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                       projections_start = projections_start,
                                                       projections_end = projections_end,
                                                       slices_start = slices_start,
                                                       slices_end = slices_end,
                                                       white_file_name = white_file_name,
                                                       white_start = white_start,
                                                       white_end = white_end,
                                                       dark_file_name = dark_file_name,
                                                       dark_start = dark_start,
                                                       dark_end = dark_end,
                                                       projections_digits = 5,
                                                       log='INFO'
                                                       )

    # TomoPy xtomo object creation and pipeline of methods.  
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    #d.phase_retrieval()
    #d.correct_drift()
    d.center=993.825
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data = d.data_recon, output_file = 'tmp/Anka_tiff_2_tomoPy_', axis=0)
def main():

    file_name = '/local/dataraid/databank/VirginiaTech/test_sample_Diplo_4/Diplodocus_1_200mm_4_.tif'
    dark_file_name = '/local/dataraid/databank/VirginiaTech/test_sample_Diplo_4/Diplodocus_1_200mm_4postDark_.tif'
    white_file_name = '/local/dataraid/databank/VirginiaTech/test_sample_Diplo_4/Diplodocus_1_200mm_4postFlat_.tif'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/VirginiaTech_test.h5'
    sample_name = 'Diplodocus_1_200mm_'

    projections_start = 1  # projection 0 is dark so we skip it
    projections_end = 1500
    white_start = 0
    white_end = 10
    white_step = 1
    dark_start = 0
    dark_end = 10
    dark_step = 1

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 600
    slices_end = 604

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        slices_start=slices_start,
        slices_end=slices_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        dark_step=dark_step,
        sample_name=sample_name,
        projections_digits=5,
        projections_zeros=True,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #16
0
def main():
    # read a series of netCDF
    file_name = '/local/dataraid/databank/APS_13_BM/NC/Dorthe_F_.nc'

    white_start = 1
    white_end = 4
    white_step = 2
    projections_start = 2
    projections_end = 3
    projections_step = 1

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 300
    slices_end = 304

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_step=projections_step,
        slices_start=slices_start,
        slices_end=slices_end,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        projections_digits=3,
        data_type='nc',
        log='INFO')

    # TomoPy xtomo object creation and pipeline of methods.
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    #d.phase_retrieval()
    #d.correct_drift()
    d.center = 484.5
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data=d.data_recon,
                      output_file='tmp/APS_13_BM_netCDF_2_tomoPy_',
                      axis=0)
Exemple #17
0
def main():

    file_name = '/local/dataraid/databank/Anka/radios/image_.tif'
    dark_file_name = '/local/dataraid/databank/Anka/darks/image_.tif'
    white_file_name = '/local/dataraid/databank/Anka/flats/image_.tif'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/Anka_test.h5'

    projections_start = 0
    projections_end = 3167
    white_start = 0
    white_end = 100
    dark_start = 0
    dark_end = 100

    sample_name = 'Anka'

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 800
    slices_end = 804

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        slices_start=slices_start,
        slices_end=slices_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        sample_name=sample_name,
        projections_digits=5,
        log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #18
0
def main():

    file_name = '/local/dataraid/databank/CHESS/scan1/scan1_.tiff'
    dark_file_name = '/local/dataraid/databank/CHESS/scan1/scan1_dark_.tiff'
    white_file_name = '/local/dataraid/databank/CHESS/scan1/scan1_white_.tiff'

    projections_start = 1
    projections_end = 361
    white_start = 0
    white_end = 1
    white_step = 1
    dark_start = 0
    dark_end = 1
    dark_step = 1


    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted   
    slices_start = 400    
    slices_end = 404    

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                       projections_start = projections_start,
                                                       projections_end = projections_end,
                                                       slices_start = slices_start,
                                                       slices_end = slices_end,
                                                       projections_digits = 3,
                                                       projections_zeros = True,
                                                       log='INFO'
                                                    )    

    # Xtomo object creation and pipeline of methods.  
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    #d.phase_retrieval()
    #d.correct_drift()
    d.center=1160.5
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data = d.data_recon, output_file = 'tmp/CHESS_tiff_2_tomoPy_', axis=0)
Exemple #19
0
def main():

    file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/SAMPLE_T_.tif'
    dark_file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/DF__BEFORE_.tif'
    white_file_name = '/local/dataraid/databank/AS/Mayo_tooth_AS/BG__BEFORE_.tif'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/Australian.h5'

    sample_name = 'Teeth'

    projections_start = 0
    projections_end = 1801
    white_start = 0
    white_end = 10
    white_step = 1
    dark_start = 0
    dark_end = 10
    dark_step = 1

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        dark_step=dark_step,
        projections_digits=4,
        white_digits=2,
        dark_digits=2,
        projections_zeros=True,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections',
                          sample_name=sample_name)
Exemple #20
0
def main():

    file_name = '/local/dataraid/databank/APS_13_BM/SPE/run2_soln1_2_.SPE'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/APS_13_BM_test_07.h5'

    white_start = 1
    white_end = 8
    white_step = 2
    projections_start = 2
    projections_end = 7
    projections_step = 2

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted   
    slices_start = 100    
    slices_end = 104    

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(file_name,
                                                       projections_start = projections_start,
                                                       projections_end = projections_end,
                                                       projections_step = projections_step,
                                                       slices_start = slices_start,
                                                       slices_end = slices_end,
                                                       white_start = white_start,
                                                       white_end = white_end,
                                                       white_step = white_step,
                                                       projections_zeros=False,
                                                       white_zeros=False,
                                                       dark_zeros=False,
                                                       projections_digits = 1,
                                                       data_type='spe',
                                                       log='INFO'
                                                       )
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data = data,
                          data_white = white,
                          data_dark = dark,
                          theta = theta,
                          hdf5_file_name = hdf5_file_name,
                          data_exchange_type = 'tomography_raw_projections'
                          )
def main():

    file_name = '/local/dataraid/databank/dataExchange/microCT/Elettra.h5'
    file_name_out = '/local/dataraid/databank/dataExchange/microCT/Elettra_out.h5'

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                data_type='h5',
                                                log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=file_name_out,
                          data_exchange_type='tomography_raw_projections')
Exemple #22
0
def main():

    raw_tiff_base_name = "/local/dataraid/databank/dataExchange/microCT/SRC/raw/FPA_16_18_18_TOMO_243_Fiber_2500_50_50_"    
    hdf5_base_name = "/local/dataraid/databank/dataExchange/tmp/SRC_"    
   
    log_file = raw_tiff_base_name + "wavelength.dpt"
    angle_file = raw_tiff_base_name + "angle.dpt"

    # Determine projection angle end    
    file = open(angle_file, 'r')
    lines = file.readlines()
    projections_angle_end = float(lines[0]) + float(lines[1])
    file.close()

    file = open(log_file, 'r')
    for line in file:
        linelist = line.split(",")

        file_name = raw_tiff_base_name+linelist[0]+"cm-1.dpt"
        sample_name = raw_tiff_base_name+linelist[0]+"cm-1"

        hdf5_file_name = hdf5_base_name+linelist[0]+"cm-1.h5"

        mydata = dx.Import()
        # Read series of images from a single dpt file
        data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                        data_type='dpt',
                                                        projections_angle_end = projections_angle_end,
                                                        log='INFO'
                                                        )

        mydata = ex.Export()
        # Create minimal data exchange hdf5 file
        mydata.xtomo_exchange(data = data,
                            data_white = white,
                            data_dark = dark,
                            theta = theta,
                            hdf5_file_name = hdf5_file_name,
                            sample_name = sample_name,
                            data_exchange_type = 'tomography_raw_projections'
                            )
    file.close()
Exemple #23
0
def main():

    file_name = '/local/dataraid/databank/APS_13_BM/NC/Dorthe_F_.nc'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/APS_13_BM_NC_test_02.h5'

    white_start = 1
    white_end = 4
    white_step = 2
    projections_start = 2
    projections_end = 3
    projections_step = 1

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 300
    slices_end = 304

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_step=projections_step,
        slices_start=slices_start,
        slices_end=slices_end,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        projections_digits=3,
        data_type='nc',
        sample_name='Stripe_Solder_Sample_Tip1',
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
def main():

    file_name = '/local/dataraid/databank/Anka/radios/image_.tif'
    dark_file_name = '/local/dataraid/databank/Anka/darks/image_.tif'
    white_file_name = '/local/dataraid/databank/Anka/flats/image_.tif'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/Anka.h5'

    projections_start = 0
    projections_end = 3167
    white_start = 0
    white_end = 100
    dark_start = 0
    dark_end = 100

    sample_name = 'Anka'

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        dark_file_name=dark_file_name,
        dark_start=dark_start,
        dark_end=dark_end,
        projections_digits=5,
        log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections',
                          sample_name=sample_name)
Exemple #25
0
def main():

    file_name = '/local/dataraid/2013_11/Vincent_201311/GA_exp/92_2_01/rad_0400ms_.tiff'
    white_file_name = '/local/dataraid/2013_11/Vincent_201311/GA_exp/92_2_01/ff_0350ms_.tiff'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/NSLS.h5'

    white_start = 0
    white_end = 2580
    white_step = 30
    projections_start = 0
    projections_end = 2600

    # set to convert slices between slices_start and slices_end
    # if omitted all data set will be converted
    slices_start = 800
    slices_end = 804

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        projections_digits=4,
        slices_start=slices_start,
        slices_end=slices_end,
        white_file_name=white_file_name,
        white_start=white_start,
        white_end=white_end,
        white_step=white_step,
        log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #26
0
def main():

    file_name = '/local/dataraid/databank/APS_15_ID/AluminaStick_0A_fullRunRenamed/AluminaStick_.hdf'

    projections_start = 1
    projections_end = 361

    # to reconstruct a subset of slices set slices_start and slices_end
    # if omitted the full data set is recontructed
    slices_start = 800
    slices_end = 804

    mydata = dx.Import()

    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        slices_start=slices_start,
        slices_end=slices_end,
        projections_digits=4,
        data_type='hdf5',
        log='INFO')

    # TomoPy xtomo object creation and pipeline of methods.
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    d.correct_drift()
    #d.optimize_center()
    d.phase_retrieval(pixel_size=0.9e-4, dist=8.1, energy=17)
    #d.correct_drift()
    d.center = 772.2
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data=d.data_recon,
                      output_file='tmp/AluminaStick_0A_',
                      axis=0)
def main():

    file_name = '/local/dataraid/databank/APS_13_BM/SPE/run2_soln1_2_.SPE'

    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/APS_13_BM_spe.h5'

    white_start = 1
    white_end = 8
    white_step = 2
    projections_start = 2
    projections_end = 7
    projections_step = 2

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                       projections_start = projections_start,
                                                       projections_end = projections_end,
                                                       projections_step = projections_step,
#                                                       slices_start = slices_start,
#                                                       slices_end = slices_end,
                                                       white_start = white_start,
                                                       white_end = white_end,
                                                       white_step = white_step,
                                                       projections_zeros=False,
                                                       white_zeros=False,
                                                       dark_zeros=False,
                                                       projections_digits = 1,
                                                       data_type='spe',
                                                       log='INFO'
                                                       )
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data = data,
                          data_white = white,
                          data_dark = dark,
                          theta = theta,
                          hdf5_file_name = hdf5_file_name,
                          data_exchange_type = 'tomography_raw_projections'
                          )
def main():

    file_name = '/local/dataraid/databank/Diamond/13429_subx.nxs'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/tmp/Diamond_04.h5'

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                data_type='nxs',
                                                slices_start=1600,
                                                slices_end=1610,
                                                slices_step=1,
                                                log='INFO')

    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')
Exemple #29
0
def main():
    # read a series of tiff

    file_name = '/local/dataraid/databank/dataExchange/microCT/Sangid_ShortFiber.h5' 
    file_name = '/local/dataraid/databank/dataExchange/tmp/Elettra.h5'

    # to reconstruct slices from slices_start to slices_end
    # if omitted all data set is recontructed    
#    slices_start = 1365
#    slices_end = 1367

    slices_start = 150    
    slices_end = 154    

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.xtomo_raw(file_name,
                                                       slices_start = slices_start,
                                                       slices_end = slices_end,
                                                       data_type='h5',
                                                       log='INFO'
                                                       )
    # TomoPy xtomo object creation and pipeline of methods.  
    d = tomopy.xtomo_dataset(log='debug')
    d.dataset(data, white, dark, theta)
    d.normalize()
    #d.correct_drift()
    d.optimize_center()
    #d.phase_retrieval()
    #d.correct_drift()
    #d.center=1096.375
    d.gridrec()

    # Write to stack of TIFFs.
    mydata = ex.Export()
    mydata.xtomo_tiff(data = d.data_recon, output_file = 'tmp/Elettra_DataExchange_2_tomoPy_', axis=0)
Exemple #30
0
def main():

    # HN-MR-002-1.0kPa/  HN-MR-002-2.0kPa/  HN-MR-002-3.0kPa/
    ##    file_name = '/local/dataraid/databank/GrenobleGranularData/Tomo/HN-MR-002-1_0kPa/Radios_original/HN-MR-002-SAT_.tif'
    ##    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/HN-MR-002-SAT.h5'
    ##    sample_name = 'HN-MR-002-SAT'

    file_name = '/local/dataraid/databank/GrenobleGranularData/Tomo/HN-MR-002-2_0kPa/Radios_original/HN-MR-002-2KPA_.tif'
    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/HN-MR-002-2KPA.h5'
    sample_name = 'HN-MR-002-2KPA'

    ##    file_name = '/local/dataraid/databank/GrenobleGranularData/Tomo/HN-MR-002-3_0kPa/Radios_original/HN-MR-002-3_0KPA_.tif'
    ##    hdf5_file_name = '/local/dataraid/databank/dataExchange/microCT/HN-MR-002-3_0KPA.h5'
    ##    sample_name = 'HN-MR-002-3_0KPA'

    projections_start = 1
    projections_end = 1201

    mydata = dx.Import()
    # Read series of images
    data, white, dark, theta = mydata.series_of_images(
        file_name,
        projections_start=projections_start,
        projections_end=projections_end,
        sample_name=sample_name,
        projections_digits=5,
        projections_zeros=True,
        log='INFO')
    mydata = ex.Export()
    # Create minimal data exchange hdf5 file
    mydata.xtomo_exchange(data=data,
                          data_white=white,
                          data_dark=dark,
                          theta=theta,
                          hdf5_file_name=hdf5_file_name,
                          data_exchange_type='tomography_raw_projections')