Exemplo n.º 1
0
            heart.temporal_phase_resolution, heart.average_bps,
            number_of_projections_per_interleaf))
        n_interleaf = find_best_fibo(N_readouts_target,
                                     number_of_projections_per_interleaf,
                                     fibonacci)
        phyllo = SpiralPhyllotaxisPattern(
            n_interleaf * number_of_projections_per_interleaf,
            n_interleaf,
            time_per_acquisition=time_per_readout,
            alternated_points=True)
        phyllo.separate_in_time_phases(heart.beats)
        phyllo.draw(
            title='N interleaves = {} ; {} readouts per interleaf ; Ntot = {}'.
            format(phyllo.n_interleaf, phyllo.n_points / phyllo.n_interleaf,
                   phyllo.n_points),
            alpha=0.3,
            marker_size=1,
            colour='cardiac_phase',
            filter_func=only_first_cardiac_phase,
            display=True
        )  # save='pres_18_05_2020/tres{}_beat{}_proj{}.png'.format(heart.temporal_phase_resolution,heart.average_bps,number_of_projections_per_interleaf)

# from Objects.Patterns import SpiralPhyllotaxisPattern
# from Tools.fibonacci import make_fibonacci, find_best_fibo
# from Tools.Heart import Heart

# temporal_resolutions = [0.05,0.06,0.12]
# heart_beat_lengths = [0.5,1,1.5]
# N_readouts_target = 30000
# time_per_readout = 0.006
# numbers_of_projections_per_interleaf = [4,8,12,16,32,64,1000,5000,15000]
fibonacci = [
    1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584,
    4181, 6765, 10946, 17711
]

# cardiac phases
heart = Heart(N_target * time_per_acquisition * 2, 0.05)

# articles to show n_interleaf does not change pattern, just interleave style


def only_first_cardiac_phase(point):
    return point.cardiac_phase == 0


for fibo in fibonacci:
    for add_readout_ends in [True, False]:
        N = find_best_number_of_points(N_target, fibo)
        test = SpiralPhyllotaxisPattern(
            N * fibo,
            fibo,
            time_per_acquisition=time_per_acquisition,
            alternated_points=True)
        test.separate_in_time_phases(heart.beats)
        test.draw(title='N_total = {} , {} interleaf'.format(N * fibo, fibo),
                  alpha=0.3,
                  marker_size=1,
                  colour='cardiac_phase',
                  filter_func=only_first_cardiac_phase,
                  display=True)
Exemplo n.º 3
0
from Objects.Patterns import SpiralPhyllotaxisPattern, ArchimedeanSpiralUniform, ArchimedeanSpiralNonUniform
from Tools.Heart import Heart

n_spokes = 5
n_interleaves = 8

phyllo = SpiralPhyllotaxisPattern(n_readouts_per_spoke=1,
                                  n_spokes_per_interleaf=n_spokes,
                                  n_interleaves=n_interleaves,
                                  alternated_spokes=False)
phyllo.draw(colour='first_interleaf', marker_size=10, display=True)

arch_uni = ArchimedeanSpiralUniform(n_readouts_per_spoke=1,
                                    n_spokes_per_interleaf=n_spokes,
                                    n_interleaves=n_interleaves)
arch_uni.draw(colour='first_interleaf', marker_size=10, display=True)

arch_nonuni = ArchimedeanSpiralNonUniform(n_readouts_per_spoke=1,
                                          n_spokes_per_interleaf=n_spokes,
                                          n_interleaves=n_interleaves)
arch_nonuni.draw(colour='first_interleaf', marker_size=10, display=True)

### temporal resolution
temporal_resolution = 0.06
beating_time = 2 * n_spokes * n_interleaves * temporal_resolution

heart = Heart(beating_time,
              temporal_phase_resolution=temporal_resolution,
              average_bps=1.,
              bps_rms=0.0)