Example #1
0
    space.add_subject(detector)

    collimator = SiemensSymbiaTSeriesLEHR(
        coordinates=(detector.coordinates[0], detector.coordinates[1], detector.size[2] + 0.5),
        size=detector.size[:2]
        )
    space.add_subject(collimator)

    source = efg3(
        coordinates=phantom.coordinates,
        activity=300*10**6,
        )

    materials = Materials(materials, max_energy=source.energy)

    materials.table = np.array([7, 7, 7, 10, 32, 82])

    for angle in angles:
        phantom.rotate((0., angle, 0.))
        source.rotate((0., angle, 0.))
        
        modeling = Modeling(
            space,
            source,
            materials,
            stop_time=0.1,
            particles_number=10**6,
            flow_number=2,
            file_name=f'efg3_full_angle {round(angle*180/np.pi, 1)} deg.hdf',
            subject=detector
            )
Example #2
0
def main():
    angles = np.linspace(-np.pi/4, 3*np.pi/4, 32)
    projection_time = 15
    pause_time = 1.

    materials = {
        'Compounds and mixtures/Air, Dry (near sea level)':         0,
        'Compounds and mixtures/Lung':                              1,
        'Compounds and mixtures/Tissue, Soft (ICRU-44)':            2,
        'Compounds and mixtures/B-100 Bone-Equivalent Plastic':     3,
        'Compounds and mixtures/Sodium Iodide':                     4,
        'Elemental media/Pb':                                       5,
    }

    space = Space(
        size=(51.2, 40., 60.),
        material=0
        )

    detector = SiemensSymbiaTSeries3_8(
        coordinates=(0., 0., 0),
        size=space.size[:2]
        )

    collimator = SiemensSymbiaTSeriesLEHR(
        coordinates=(detector.coordinates[0], detector.coordinates[1], detector.size[2] + 0.5),
        size=detector.size[:2]
        )

    phantom = ae3cut(
        coordinates=(collimator.coordinates[0], collimator.coordinates[1], collimator.size[2]),
        )

    source = SourceManager().efg3cut(
        coordinates=phantom.coordinates,
        activity=300*10**6,
        )

    space.add_subject(phantom)    
    space.add_subject(detector)
    space.add_subject(collimator)

    materials = Materials(materials, max_energy=source.energy)

    materials.table = np.array([7, 7, 7, 10, 32, 82])

    for angle in angles:
        phantom.rotate((0., angle, 0.))
        source.rotate((0., angle, 0.))
        
        modeling = Modeling(
            space,
            source,
            materials,
            stop_time=source.timer + projection_time,
            particles_number=10**8,
            flow_number=8,
            file_name=f'efg3cut/{round(np.rad2deg(angle), 1)} deg.hdf',
            iteraction_buffer=10**4,
            subject=detector
            )
        
        modeling.start()
        modeling.join()
        source.set_state(source.timer + pause_time)