LookupTable#
- class blochsim.estimators.LookupTable[source]#
Bases:
EstimatorRead one unknown back from a monotonic signal curve.
Linear interpolation between the two nearest atoms of a one-parameter model removes the dictionary grid spacing from the estimate. The classic use is the MP2RAGE T1 map [1].
- Parameters:
acquisition (Simulator, default=None) – The sequence being inverted, with every property that is neither unknown nor measured separately already fixed. Omit to give signals to
fit().combine (callable, default=None) – Reduces
(..., contrasts)signals to the(...)values the curve is in, for example the MP2RAGE unified image. Not needed for a single-contrast model.monotonic (bool, default=True) – Keep only the longest monotonic run of the curve.
Notes
Signals outside
spanare read as the nearer endpoint. The lookup runs where the signals are and is not streamed.References
Examples
import torch from blochsim.estimators import LookupTable from blochsim.simulators import MP2RAGESimulator protocol = dict( TI=(800.0, 2700.0), flip=(4.0, 5.0), TRspgr=6.7, TRmp2rage=6000.0, nshots=128, ) T1 = torch.arange(50.0, 5000.0, 50.0) blocks = MP2RAGESimulator(**protocol).simulate( T1=T1, inv_efficiency=0.96 ) unified = (blocks[:, 0] * blocks[:, 1]) / blocks.square().sum(-1) table = LookupTable().fit(signals=unified[:, None], parameters=T1[:, None]) print(table.points, "points spanning", [round(v, 3) for v in table.span]) print(table(torch.tensor([[0.1], [-0.2]])).flatten().tolist())
75 points spanning [-0.5, 0.49] [1086.536376953125, 1721.1234130859375]
Methods
fitFit the estimator over a sampling of the tissue it will meet.
from_coefficientsMap coefficients already in this estimator's basis.
mapEstimate the tissue parameters of a measured volume.
training_setSimulate a training set from the properties given to
fit().uncertainty_ofUncertainty of each map, as a standard deviation in the map's units.
- property fitted#
Whether the table holds a curve.
- property points#
Number of points in the table.
- property span#
Signal range
(low, high)covered by the table.