Trace applied transforms

Sometimes we would like to see which transform was applied to a certain batch during training. This can be done in TorchIO using torchio.utils.history_collate() for the data loader. The transforms history can be saved during training to check what was applied.

  • ToCanonical, Gamma, Blur, Flip, RescaleIntensity, Sagittal, Coronal, Axial
  • ToCanonical, Gamma, RescaleIntensity, Sagittal, Coronal, Axial
  • ToCanonical, RescaleIntensity, Sagittal, Coronal, Axial
  • ToCanonical, Gamma, Flip, RescaleIntensity, Sagittal, Coronal, Axial

Out:

Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/t1.nii.gz to /home/docs/.cache/torchio/fpg/t1.nii.gz

0it [00:00, ?it/s]
  0%|          | 0/10860389 [00:00<?, ?it/s]
 63%|######2   | 6791168/10860389 [00:00<00:00, 67911420.94it/s]
10862592it [00:00, 19754476.34it/s]
Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/t2.nii.gz to /home/docs/.cache/torchio/fpg/t2.nii.gz

0it [00:00, ?it/s]
  0%|          | 0/2200252 [00:00<?, ?it/s]
2203648it [00:00, 3435810.35it/s]
Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/fmri.nrrd to /home/docs/.cache/torchio/fpg/fmri.nrrd

0it [00:00, ?it/s]
  0%|          | 0/23837057 [00:00<?, ?it/s]
 24%|##3       | 5685248/23837057 [00:00<00:00, 56830719.50it/s]
 78%|#######8  | 18620416/23837057 [00:00<00:00, 99468933.14it/s]
23838720it [00:00, 40974199.11it/s]
Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/dmri.nrrd to /home/docs/.cache/torchio/fpg/dmri.nrrd

0it [00:00, ?it/s]
  0%|          | 0/10170962 [00:00<?, ?it/s]
 60%|######    | 6135808/10170962 [00:00<00:00, 61341758.48it/s]
10174464it [00:00, 14040153.90it/s]
Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/t1_seg_gif.nii.gz to /home/docs/.cache/torchio/fpg/t1_seg_gif.nii.gz

0it [00:00, ?it/s]
  0%|          | 0/772405 [00:00<?, ?it/s]
778240it [00:00, 1623954.81it/s]
Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/t1_to_mni.tfm to /home/docs/.cache/torchio/fpg/t1_to_mni.tfm

0it [00:00, ?it/s]
  0%|          | 0/329 [00:00<?, ?it/s]
8192it [00:00, 21235.25it/s]
Downloading https://github.com/fepegar/torchio-data/raw/master/data/fernando/t1_to_mni_affine.h5 to /home/docs/.cache/torchio/fpg/t1_to_mni_affine.h5

0it [00:00, ?it/s]
  0%|          | 0/8392 [00:00<?, ?it/s]
16384it [00:00, 43070.24it/s]
Applied transforms:
[ToCanonical(),
 Gamma(gamma={'t1': [0.8018916845321655], 't2': [0.8908793330192566], 'fmri': [1.0837715864181519, 0.9940736889839172, 1.2685402631759644, 0.9737280607223511, 1.0826196670532227, 0.9133245944976807, 0.9427354335784912, 0.750808596611023, 0.8198083639144897, 0.8836740851402283, 1.0111750364303589, 1.125920057296753, 1.197225570678711, 0.8159661889076233, 0.8775346279144287, 1.1151235103607178, 1.2828913927078247, 0.9401272535324097, 1.2516885995864868, 0.9527955055236816, 1.0322535037994385, 1.3121182918548584, 0.7570688128471375, 0.8279012441635132, 0.9268629550933838, 0.8896386027336121, 1.2958933115005493, 0.8232841491699219, 0.8710117340087891, 0.810914933681488, 0.7550522685050964, 0.8393545150756836, 1.2941827774047852, 1.1432390213012695, 1.1565041542053223, 1.0159026384353638, 0.8574391603469849, 1.0520654916763306, 0.7557017803192139, 0.8051152229309082, 0.8567072749137878, 1.208380937576294, 1.1923145055770874, 0.8754225969314575, 0.989233672618866, 1.2115108966827393, 1.347485065460205, 1.126442790031433, 1.0413603782653809, 1.2228031158447266, 0.8380808234214783, 1.057495355606079, 0.7924771308898926, 0.8122672438621521, 0.856436550617218, 1.1453862190246582, 1.1282278299331665, 0.837188720703125, 1.094866156578064, 1.1790294647216797, 0.9628427028656006, 1.011520266532898, 1.0719842910766602, 1.2045583724975586, 1.3338350057601929, 0.7935909628868103, 0.8958870768547058, 1.1251349449157715, 1.2821838855743408, 1.2983083724975586, 1.3030492067337036, 1.0615227222442627, 0.7703773379325867, 1.0279821157455444, 0.8288785815238953, 0.7560964822769165, 1.3054499626159668, 1.2562209367752075, 0.7413678169250488, 1.057758092880249, 0.9507178068161011, 0.9518304467201233, 0.8716850876808167, 1.1222851276397705, 0.8372010588645935, 1.1162528991699219, 1.163825511932373, 1.2395662069320679, 1.1187068223953247, 0.74310302734375, 0.8231564164161682, 1.1615955829620361, 1.0648036003112793, 0.7913418412208557, 0.8413513898849487, 1.3260767459869385, 1.2240259647369385, 0.8773866295814514, 0.9272747039794922, 0.7514283061027527, 0.9946222901344299, 0.7977837920188904, 0.793416440486908, 0.9836059808731079, 1.0460734367370605, 0.884388267993927, 1.1948411464691162, 0.8331332206726074, 1.312864065170288, 1.228249430656433, 0.7764796018600464, 0.9280540347099304, 1.0136288404464722, 1.0447423458099365, 1.073744773864746, 1.1249386072158813, 1.0181324481964111, 0.86383056640625, 1.1525267362594604, 0.7499305605888367, 0.8370997905731201, 0.9276517033576965, 0.8640419244766235, 0.9003695249557495, 0.7820109724998474, 0.9381789565086365, 1.066227674484253, 0.8224729299545288, 0.9847220778465271, 1.239558458328247, 0.9696306586265564, 1.0083725452423096, 0.9744513630867004, 1.0625953674316406, 1.2101590633392334, 1.328663945198059, 1.2098746299743652, 1.3295280933380127, 0.9785372018814087, 0.763763964176178, 0.8674276471138, 1.2266312837600708, 0.9980571269989014, 0.8614709973335266, 0.7946181893348694, 0.7552128434181213, 0.7763106822967529, 0.9409633874893188, 1.178829312324524, 1.17608642578125, 0.7487654089927673, 1.205789566040039, 0.7907662391662598, 0.9385462999343872, 0.8854655027389526, 0.9438532590866089, 0.942798376083374, 0.7639866471290588, 0.7717987895011902, 0.9541409611701965, 1.0038871765136719, 0.8725960850715637, 1.1196428537368774, 0.7633661031723022, 0.9799574017524719, 1.3019014596939087, 0.8848230242729187, 1.3111451864242554, 1.1147677898406982, 0.7628160715103149, 1.2090189456939697, 0.9659740328788757, 0.8746582269668579, 1.2711169719696045, 0.7847198247909546, 1.0327152013778687, 0.9391213059425354, 1.2389122247695923, 1.087349772453308, 1.1550592184066772, 1.1117637157440186, 0.9303984045982361, 0.9388574361801147, 0.7809653878211975, 1.1765109300613403, 1.2689546346664429, 1.2278534173965454, 0.8092774152755737, 1.013469934463501, 0.8093852996826172, 0.8477705717086792, 0.8396151661872864, 1.1079633235931396, 0.836294949054718, 0.9934762120246887, 1.0127004384994507, 1.2133522033691406, 0.7970992922782898, 0.8138707876205444, 0.8401301503181458, 1.2336534261703491, 0.8977716565132141, 1.2879433631896973, 1.1145851612091064, 1.038718581199646, 0.997769296169281, 0.9424197673797607, 1.0383572578430176, 0.9337902665138245, 0.997894287109375, 1.0390199422836304, 0.7908384799957275, 0.8544994592666626, 1.274109959602356, 0.7839077115058899, 0.9786885380744934, 1.3455079793930054, 1.1144613027572632, 1.0085301399230957, 0.7710646986961365], 'dmri': [1.1602243185043335, 0.8076033592224121, 0.918366014957428, 0.9042450189590454, 0.9565461874008179, 1.0032868385314941, 1.2807453870773315, 1.0381617546081543, 1.3082729578018188, 1.2014315128326416, 0.8272368907928467, 1.1440232992172241, 0.808908998966217, 0.8806037306785583, 1.0922467708587646, 1.1041299104690552, 1.2524083852767944, 0.907941997051239, 1.0004804134368896, 1.1670125722885132]}),
 RescaleIntensity(out_min_max=(-1, 1), percentiles=(0, 100), masking_method=None)]

Composed transform to reproduce history:
Compose([ToCanonical(), Gamma(gamma={'t1': [0.8018916845321655], 't2': [0.8908793330192566], 'fmri': [1.0837715864181519, 0.9940736889839172, 1.2685402631759644, 0.9737280607223511, 1.0826196670532227, 0.9133245944976807, 0.9427354335784912, 0.750808596611023, 0.8198083639144897, 0.8836740851402283, 1.0111750364303589, 1.125920057296753, 1.197225570678711, 0.8159661889076233, 0.8775346279144287, 1.1151235103607178, 1.2828913927078247, 0.9401272535324097, 1.2516885995864868, 0.9527955055236816, 1.0322535037994385, 1.3121182918548584, 0.7570688128471375, 0.8279012441635132, 0.9268629550933838, 0.8896386027336121, 1.2958933115005493, 0.8232841491699219, 0.8710117340087891, 0.810914933681488, 0.7550522685050964, 0.8393545150756836, 1.2941827774047852, 1.1432390213012695, 1.1565041542053223, 1.0159026384353638, 0.8574391603469849, 1.0520654916763306, 0.7557017803192139, 0.8051152229309082, 0.8567072749137878, 1.208380937576294, 1.1923145055770874, 0.8754225969314575, 0.989233672618866, 1.2115108966827393, 1.347485065460205, 1.126442790031433, 1.0413603782653809, 1.2228031158447266, 0.8380808234214783, 1.057495355606079, 0.7924771308898926, 0.8122672438621521, 0.856436550617218, 1.1453862190246582, 1.1282278299331665, 0.837188720703125, 1.094866156578064, 1.1790294647216797, 0.9628427028656006, 1.011520266532898, 1.0719842910766602, 1.2045583724975586, 1.3338350057601929, 0.7935909628868103, 0.8958870768547058, 1.1251349449157715, 1.2821838855743408, 1.2983083724975586, 1.3030492067337036, 1.0615227222442627, 0.7703773379325867, 1.0279821157455444, 0.8288785815238953, 0.7560964822769165, 1.3054499626159668, 1.2562209367752075, 0.7413678169250488, 1.057758092880249, 0.9507178068161011, 0.9518304467201233, 0.8716850876808167, 1.1222851276397705, 0.8372010588645935, 1.1162528991699219, 1.163825511932373, 1.2395662069320679, 1.1187068223953247, 0.74310302734375, 0.8231564164161682, 1.1615955829620361, 1.0648036003112793, 0.7913418412208557, 0.8413513898849487, 1.3260767459869385, 1.2240259647369385, 0.8773866295814514, 0.9272747039794922, 0.7514283061027527, 0.9946222901344299, 0.7977837920188904, 0.793416440486908, 0.9836059808731079, 1.0460734367370605, 0.884388267993927, 1.1948411464691162, 0.8331332206726074, 1.312864065170288, 1.228249430656433, 0.7764796018600464, 0.9280540347099304, 1.0136288404464722, 1.0447423458099365, 1.073744773864746, 1.1249386072158813, 1.0181324481964111, 0.86383056640625, 1.1525267362594604, 0.7499305605888367, 0.8370997905731201, 0.9276517033576965, 0.8640419244766235, 0.9003695249557495, 0.7820109724998474, 0.9381789565086365, 1.066227674484253, 0.8224729299545288, 0.9847220778465271, 1.239558458328247, 0.9696306586265564, 1.0083725452423096, 0.9744513630867004, 1.0625953674316406, 1.2101590633392334, 1.328663945198059, 1.2098746299743652, 1.3295280933380127, 0.9785372018814087, 0.763763964176178, 0.8674276471138, 1.2266312837600708, 0.9980571269989014, 0.8614709973335266, 0.7946181893348694, 0.7552128434181213, 0.7763106822967529, 0.9409633874893188, 1.178829312324524, 1.17608642578125, 0.7487654089927673, 1.205789566040039, 0.7907662391662598, 0.9385462999343872, 0.8854655027389526, 0.9438532590866089, 0.942798376083374, 0.7639866471290588, 0.7717987895011902, 0.9541409611701965, 1.0038871765136719, 0.8725960850715637, 1.1196428537368774, 0.7633661031723022, 0.9799574017524719, 1.3019014596939087, 0.8848230242729187, 1.3111451864242554, 1.1147677898406982, 0.7628160715103149, 1.2090189456939697, 0.9659740328788757, 0.8746582269668579, 1.2711169719696045, 0.7847198247909546, 1.0327152013778687, 0.9391213059425354, 1.2389122247695923, 1.087349772453308, 1.1550592184066772, 1.1117637157440186, 0.9303984045982361, 0.9388574361801147, 0.7809653878211975, 1.1765109300613403, 1.2689546346664429, 1.2278534173965454, 0.8092774152755737, 1.013469934463501, 0.8093852996826172, 0.8477705717086792, 0.8396151661872864, 1.1079633235931396, 0.836294949054718, 0.9934762120246887, 1.0127004384994507, 1.2133522033691406, 0.7970992922782898, 0.8138707876205444, 0.8401301503181458, 1.2336534261703491, 0.8977716565132141, 1.2879433631896973, 1.1145851612091064, 1.038718581199646, 0.997769296169281, 0.9424197673797607, 1.0383572578430176, 0.9337902665138245, 0.997894287109375, 1.0390199422836304, 0.7908384799957275, 0.8544994592666626, 1.274109959602356, 0.7839077115058899, 0.9786885380744934, 1.3455079793930054, 1.1144613027572632, 1.0085301399230957, 0.7710646986961365], 'dmri': [1.1602243185043335, 0.8076033592224121, 0.918366014957428, 0.9042450189590454, 0.9565461874008179, 1.0032868385314941, 1.2807453870773315, 1.0381617546081543, 1.3082729578018188, 1.2014315128326416, 0.8272368907928467, 1.1440232992172241, 0.808908998966217, 0.8806037306785583, 1.0922467708587646, 1.1041299104690552, 1.2524083852767944, 0.907941997051239, 1.0004804134368896, 1.1670125722885132]}), RescaleIntensity(out_min_max=(-1, 1), percentiles=(0, 100), masking_method=None)])

Composed transform to invert applied transforms when possible:
/home/docs/checkouts/readthedocs.org/user_builds/torchio/checkouts/latest/torchio/transforms/augmentation/composition.py:65: RuntimeWarning: Skipping ToCanonical as it is not invertible
  warnings.warn(message, RuntimeWarning)
/home/docs/checkouts/readthedocs.org/user_builds/torchio/checkouts/latest/torchio/transforms/augmentation/composition.py:65: RuntimeWarning: Skipping RescaleIntensity as it is not invertible
  warnings.warn(message, RuntimeWarning)
Compose([Gamma(gamma={'t1': [0.8018916845321655], 't2': [0.8908793330192566], 'fmri': [1.0837715864181519, 0.9940736889839172, 1.2685402631759644, 0.9737280607223511, 1.0826196670532227, 0.9133245944976807, 0.9427354335784912, 0.750808596611023, 0.8198083639144897, 0.8836740851402283, 1.0111750364303589, 1.125920057296753, 1.197225570678711, 0.8159661889076233, 0.8775346279144287, 1.1151235103607178, 1.2828913927078247, 0.9401272535324097, 1.2516885995864868, 0.9527955055236816, 1.0322535037994385, 1.3121182918548584, 0.7570688128471375, 0.8279012441635132, 0.9268629550933838, 0.8896386027336121, 1.2958933115005493, 0.8232841491699219, 0.8710117340087891, 0.810914933681488, 0.7550522685050964, 0.8393545150756836, 1.2941827774047852, 1.1432390213012695, 1.1565041542053223, 1.0159026384353638, 0.8574391603469849, 1.0520654916763306, 0.7557017803192139, 0.8051152229309082, 0.8567072749137878, 1.208380937576294, 1.1923145055770874, 0.8754225969314575, 0.989233672618866, 1.2115108966827393, 1.347485065460205, 1.126442790031433, 1.0413603782653809, 1.2228031158447266, 0.8380808234214783, 1.057495355606079, 0.7924771308898926, 0.8122672438621521, 0.856436550617218, 1.1453862190246582, 1.1282278299331665, 0.837188720703125, 1.094866156578064, 1.1790294647216797, 0.9628427028656006, 1.011520266532898, 1.0719842910766602, 1.2045583724975586, 1.3338350057601929, 0.7935909628868103, 0.8958870768547058, 1.1251349449157715, 1.2821838855743408, 1.2983083724975586, 1.3030492067337036, 1.0615227222442627, 0.7703773379325867, 1.0279821157455444, 0.8288785815238953, 0.7560964822769165, 1.3054499626159668, 1.2562209367752075, 0.7413678169250488, 1.057758092880249, 0.9507178068161011, 0.9518304467201233, 0.8716850876808167, 1.1222851276397705, 0.8372010588645935, 1.1162528991699219, 1.163825511932373, 1.2395662069320679, 1.1187068223953247, 0.74310302734375, 0.8231564164161682, 1.1615955829620361, 1.0648036003112793, 0.7913418412208557, 0.8413513898849487, 1.3260767459869385, 1.2240259647369385, 0.8773866295814514, 0.9272747039794922, 0.7514283061027527, 0.9946222901344299, 0.7977837920188904, 0.793416440486908, 0.9836059808731079, 1.0460734367370605, 0.884388267993927, 1.1948411464691162, 0.8331332206726074, 1.312864065170288, 1.228249430656433, 0.7764796018600464, 0.9280540347099304, 1.0136288404464722, 1.0447423458099365, 1.073744773864746, 1.1249386072158813, 1.0181324481964111, 0.86383056640625, 1.1525267362594604, 0.7499305605888367, 0.8370997905731201, 0.9276517033576965, 0.8640419244766235, 0.9003695249557495, 0.7820109724998474, 0.9381789565086365, 1.066227674484253, 0.8224729299545288, 0.9847220778465271, 1.239558458328247, 0.9696306586265564, 1.0083725452423096, 0.9744513630867004, 1.0625953674316406, 1.2101590633392334, 1.328663945198059, 1.2098746299743652, 1.3295280933380127, 0.9785372018814087, 0.763763964176178, 0.8674276471138, 1.2266312837600708, 0.9980571269989014, 0.8614709973335266, 0.7946181893348694, 0.7552128434181213, 0.7763106822967529, 0.9409633874893188, 1.178829312324524, 1.17608642578125, 0.7487654089927673, 1.205789566040039, 0.7907662391662598, 0.9385462999343872, 0.8854655027389526, 0.9438532590866089, 0.942798376083374, 0.7639866471290588, 0.7717987895011902, 0.9541409611701965, 1.0038871765136719, 0.8725960850715637, 1.1196428537368774, 0.7633661031723022, 0.9799574017524719, 1.3019014596939087, 0.8848230242729187, 1.3111451864242554, 1.1147677898406982, 0.7628160715103149, 1.2090189456939697, 0.9659740328788757, 0.8746582269668579, 1.2711169719696045, 0.7847198247909546, 1.0327152013778687, 0.9391213059425354, 1.2389122247695923, 1.087349772453308, 1.1550592184066772, 1.1117637157440186, 0.9303984045982361, 0.9388574361801147, 0.7809653878211975, 1.1765109300613403, 1.2689546346664429, 1.2278534173965454, 0.8092774152755737, 1.013469934463501, 0.8093852996826172, 0.8477705717086792, 0.8396151661872864, 1.1079633235931396, 0.836294949054718, 0.9934762120246887, 1.0127004384994507, 1.2133522033691406, 0.7970992922782898, 0.8138707876205444, 0.8401301503181458, 1.2336534261703491, 0.8977716565132141, 1.2879433631896973, 1.1145851612091064, 1.038718581199646, 0.997769296169281, 0.9424197673797607, 1.0383572578430176, 0.9337902665138245, 0.997894287109375, 1.0390199422836304, 0.7908384799957275, 0.8544994592666626, 1.274109959602356, 0.7839077115058899, 0.9786885380744934, 1.3455079793930054, 1.1144613027572632, 1.0085301399230957, 0.7710646986961365], 'dmri': [1.1602243185043335, 0.8076033592224121, 0.918366014957428, 0.9042450189590454, 0.9565461874008179, 1.0032868385314941, 1.2807453870773315, 1.0381617546081543, 1.3082729578018188, 1.2014315128326416, 0.8272368907928467, 1.1440232992172241, 0.808908998966217, 0.8806037306785583, 1.0922467708587646, 1.1041299104690552, 1.2524083852767944, 0.907941997051239, 1.0004804134368896, 1.1670125722885132]}, invert=True)])

Transforms applied to subjects in batch:
[[ToCanonical(),
  Gamma(gamma={'t1': [1.1450154781341553], 't2': [0.8658192157745361], 'fmri': [0.818565309047699, 0.8412802815437317, 1.1882561445236206, 1.1721880435943604, 1.2589229345321655, 1.1149581670761108, 0.9046673774719238, 0.9195834994316101, 1.0926752090454102, 1.2796804904937744, 1.0849865674972534, 0.8676701784133911, 0.8684691190719604, 0.75303715467453, 1.0669609308242798, 0.8450539708137512, 0.7653111815452576, 1.3009085655212402, 0.8229799866676331, 0.9664473533630371, 1.0897496938705444, 1.0096032619476318, 0.8172056078910828, 0.7846664786338806, 1.2701369524002075, 1.0500645637512207, 1.282597541809082, 0.9043198227882385, 1.0923885107040405, 0.9336974024772644, 0.9867472648620605, 0.8330069780349731, 1.1067860126495361, 1.0994936227798462, 0.9938305616378784, 0.9347551465034485, 0.8311633467674255, 1.2305527925491333, 0.7998530864715576, 1.1307709217071533, 0.904045045375824, 0.8652468919754028, 1.0553722381591797, 0.8556985855102539, 1.0715663433074951, 1.060684323310852, 0.8003174066543579, 1.051218032836914, 1.1363016366958618, 1.1260875463485718, 0.962940514087677, 0.7819720506668091, 0.9548068642616272, 1.1098138093948364, 0.8963152170181274, 1.120611310005188, 1.2211447954177856, 0.8550071120262146, 1.0029629468917847, 1.1320720911026, 1.023792028427124, 1.0253760814666748, 1.0381700992584229, 0.7899036407470703, 1.0238566398620605, 1.2308943271636963, 1.310402274131775, 1.1928260326385498, 1.0410199165344238, 1.1503937244415283, 0.8642061948776245, 0.779886782169342, 0.772613525390625, 1.348891258239746, 1.2097779512405396, 0.8127188086509705, 1.124538540840149, 1.2542656660079956, 1.3497028350830078, 1.2999404668807983, 1.2616572380065918, 0.9335340857505798, 0.9000701904296875, 1.2793020009994507, 1.1830713748931885, 0.8348245620727539, 1.3095782995224, 1.155979037284851, 1.1776732206344604, 0.8285874128341675, 1.0898826122283936, 0.9001725912094116, 1.264158844947815, 0.9474489688873291, 1.1238876581192017, 1.054731845855713, 1.1361443996429443, 0.9030762910842896, 1.1575102806091309, 0.8109561800956726, 1.070104718208313, 0.8162965774536133, 0.7438161969184875, 0.7859070301055908, 1.2672396898269653, 1.1762256622314453, 1.3250693082809448, 1.271676778793335, 0.7649738192558289, 0.8148678541183472, 0.9526813626289368, 0.8229748010635376, 1.231605887413025, 0.7970783114433289, 0.8638376593589783, 0.7483927011489868, 0.8433917760848999, 1.2798504829406738, 1.2784239053726196, 1.2395535707473755, 1.2606635093688965, 1.3057217597961426, 0.9260575771331787, 1.1411089897155762, 1.3064050674438477, 1.1043375730514526, 1.349727749824524, 1.168357491493225, 1.2050180435180664, 0.9003266096115112, 1.1548243761062622, 1.0350730419158936, 0.9308611154556274, 0.8444135189056396, 0.8450707197189331, 0.7938631176948547, 1.2231128215789795, 1.2377303838729858, 0.966432511806488, 0.8406282067298889, 1.2609578371047974, 1.2114847898483276, 1.0225507020950317, 0.8679331541061401, 1.3174715042114258, 1.1305251121520996, 0.7963283658027649, 1.3325905799865723, 1.2558493614196777, 0.8964190483093262, 1.183701515197754, 0.8432796001434326, 0.9540737271308899, 1.2901136875152588, 1.0124728679656982, 0.8088308572769165, 0.9045932292938232, 0.9217939376831055, 0.9437644481658936, 1.0291262865066528, 1.319758653640747, 1.016191840171814, 0.8309115171432495, 1.0154950618743896, 1.1547064781188965, 1.1604548692703247, 0.7601940035820007, 0.9477327466011047, 0.8001601696014404, 0.8798483610153198, 1.1141457557678223, 0.8081245422363281, 1.1179739236831665, 1.2899887561798096, 1.0198713541030884, 0.8187747001647949, 0.8980895280838013, 1.0677026510238647, 0.7955708503723145, 1.1607229709625244, 0.7615793943405151, 0.7494707107543945, 0.7471433877944946, 0.9409558773040771, 1.2235174179077148, 0.7528090476989746, 1.2831989526748657, 0.8869143724441528, 1.0918409824371338, 1.0137748718261719, 0.76298588514328, 1.2824838161468506, 1.1753113269805908, 1.3474295139312744, 1.1636524200439453, 0.8203528523445129, 1.284507155418396, 1.0162540674209595, 1.1528820991516113, 0.7861963510513306, 0.9173300266265869, 0.7448567748069763, 0.889720618724823, 1.0668596029281616, 0.7901372909545898, 1.100351095199585, 1.174734354019165, 1.0426783561706543, 0.8181373476982117, 0.7924737334251404, 0.9115990996360779, 1.1407517194747925, 1.3443611860275269, 1.1882821321487427, 0.966781497001648, 1.110916018486023, 0.7450388669967651, 0.7739636301994324, 1.1502535343170166, 0.8437284827232361], 'dmri': [1.1552637815475464, 0.8091429471969604, 0.8619195818901062, 0.7810573577880859, 1.1694718599319458, 0.9698939919471741, 1.2597085237503052, 1.204014778137207, 1.1805764436721802, 1.0096935033798218, 0.9114181995391846, 0.9368524551391602, 1.0406756401062012, 1.1603398323059082, 0.8104407787322998, 1.2863173484802246, 0.9679072499275208, 0.7777239084243774, 0.8501713871955872, 1.304011583328247]}),
  Blur(std={'t1': [tensor([1.7053, 1.5012, 1.5919])], 't2': [tensor([1.8465, 0.4610, 1.3158])], 'fmri': [tensor([1.4092, 0.7045, 1.3347]), tensor([0.7123, 1.6183, 0.7225]), tensor([0.6272, 1.2517, 1.3547]), tensor([0.5114, 1.0884, 1.5795]), tensor([0.9005, 1.3043, 0.7588]), tensor([1.3505, 0.2756, 0.4120]), tensor([0.4924, 1.9190, 0.7309]), tensor([0.9973, 0.5155, 1.9983]), tensor([1.9767, 0.2458, 0.1893]), tensor([0.2420, 0.9952, 0.7451]), tensor([0.3455, 0.6413, 1.1889]), tensor([0.4775, 1.2216, 0.7707]), tensor([0.5154, 1.1374, 1.8223]), tensor([0.3239, 1.0464, 0.6312]), tensor([1.9813, 0.0512, 0.0413]), tensor([1.9854, 0.3673, 1.1917]), tensor([0.9137, 0.7893, 0.7767]), tensor([1.6354, 1.0478, 0.0264]), tensor([0.4096, 0.6591, 1.5032]), tensor([0.3529, 1.9429, 0.7773]), tensor([0.8204, 1.7836, 1.5026]), tensor([1.8481, 1.5784, 0.6966]), tensor([0.3365, 0.9256, 1.8276]), tensor([0.6644, 0.0726, 1.4099]), tensor([1.9735, 0.7153, 0.1720]), tensor([0.0929, 1.2506, 0.9243]), tensor([0.4950, 1.2021, 1.3798]), tensor([1.7953, 1.7764, 0.8503]), tensor([0.1182, 0.0964, 1.9337]), tensor([1.4421, 1.4359, 0.1348]), tensor([1.9260, 1.9473, 1.9029]), tensor([0.1564, 0.6227, 0.3122]), tensor([1.9470, 0.5703, 0.5434]), tensor([1.5239, 0.5374, 0.5075]), tensor([0.9125, 0.9039, 0.2210]), tensor([1.8337, 0.5589, 1.3547]), tensor([1.8698, 1.5043, 1.1416]), tensor([1.8509, 1.1344, 0.5373]), tensor([1.9460, 1.2367, 0.0243]), tensor([0.7153, 0.3188, 1.8768]), tensor([0.8349, 0.0885, 0.9371]), tensor([1.6280, 1.2598, 1.3162]), tensor([1.0929, 1.3728, 0.7563]), tensor([0.6022, 0.0653, 0.2467]), tensor([1.4334, 0.4079, 1.1435]), tensor([1.3192, 1.0708, 0.3517]), tensor([1.9563, 0.4185, 1.8225]), tensor([0.2045, 0.7595, 1.5440]), tensor([0.5914, 1.8400, 0.3118]), tensor([0.1602, 0.5491, 1.1617]), tensor([1.9208, 0.5226, 1.3576]), tensor([0.7493, 0.7831, 1.7353]), tensor([0.2250, 1.1062, 1.9404]), tensor([0.8626, 1.7764, 0.6920]), tensor([1.8050, 0.0327, 0.8559]), tensor([0.8244, 1.3241, 1.3923]), tensor([1.7678, 0.8510, 0.9603]), tensor([1.6848, 0.7294, 1.8766]), tensor([0.3342, 0.8918, 0.9463]), tensor([1.4462, 1.6837, 0.8415]), tensor([0.1715, 1.4955, 1.2991]), tensor([1.4017, 0.3831, 1.6436]), tensor([1.9472, 1.0868, 0.0660]), tensor([1.7020, 0.2585, 1.2299]), tensor([1.1453, 0.5320, 1.3482]), tensor([0.1056, 1.2278, 0.3660]), tensor([0.8919, 1.1286, 1.8519]), tensor([0.5229, 1.6406, 0.8730]), tensor([0.5251, 0.1292, 0.0825]), tensor([1.9766, 0.7506, 1.0499]), tensor([1.2711, 1.6797, 1.8535]), tensor([1.8110, 0.2591, 0.8398]), tensor([0.4083, 0.4286, 1.2372]), tensor([1.9386, 0.1989, 1.6052]), tensor([0.4815, 0.8052, 1.7938]), tensor([0.7738, 1.0911, 0.3010]), tensor([1.8512, 0.8707, 0.2686]), tensor([1.2928, 0.2890, 0.2065]), tensor([1.0609, 1.7928, 0.7170]), tensor([1.4707, 1.8593, 1.6633]), tensor([0.4754, 0.8904, 0.6853]), tensor([0.1959, 1.0004, 1.7524]), tensor([1.8425, 1.0933, 1.2271]), tensor([0.5671, 1.7548, 0.5839]), tensor([0.3053, 1.1540, 1.5994]), tensor([0.0984, 1.9040, 1.3597]), tensor([0.2994, 0.7846, 1.8676]), tensor([0.2328, 0.7077, 1.3280]), tensor([0.1239, 1.5482, 1.5205]), tensor([1.6202, 0.3625, 1.9960]), tensor([0.4072, 1.9983, 0.0403]), tensor([0.1090, 1.6142, 1.1045]), tensor([1.0577, 0.4462, 0.5805]), tensor([0.7076, 0.0258, 1.0520]), tensor([1.1769, 0.9992, 1.3229]), tensor([1.9489, 1.2659, 0.6339]), tensor([0.5885, 0.3602, 0.3068]), tensor([0.8390, 0.8231, 1.4449]), tensor([0.5726, 1.7972, 0.2983]), tensor([1.0028, 1.8989, 1.9944]), tensor([0.4207, 1.1781, 1.1181]), tensor([0.5311, 0.6545, 1.2709]), tensor([0.3046, 1.1650, 1.4327]), tensor([0.6059, 1.8306, 0.9342]), tensor([1.4537, 1.9903, 0.6943]), tensor([1.5434, 0.7140, 0.8539]), tensor([0.8305, 0.9938, 0.6222]), tensor([1.2344, 1.0377, 1.6339]), tensor([0.7976, 1.1003, 0.6280]), tensor([0.1625, 1.4047, 1.1280]), tensor([0.5995, 0.6619, 1.2615]), tensor([0.8192, 1.6535, 1.0566]), tensor([1.3777, 1.4357, 0.7546]), tensor([1.4327, 1.7379, 1.0460]), tensor([1.1957, 1.0363, 1.6924]), tensor([0.5778, 0.4684, 1.4358]), tensor([0.1297, 1.0160, 0.5401]), tensor([1.6600, 0.0690, 1.6063]), tensor([1.9894, 1.2023, 0.9334]), tensor([1.9843, 0.5726, 0.9199]), tensor([0.5621, 0.8620, 1.2173]), tensor([1.1336e+00, 8.1113e-01, 1.5938e-04]), tensor([1.0512, 0.9704, 1.1504]), tensor([1.7663, 1.9720, 0.4067]), tensor([0.9376, 0.5993, 0.0784]), tensor([0.2723, 1.9386, 1.5831]), tensor([1.5372, 1.5557, 0.2055]), tensor([1.1050, 1.9307, 0.4419]), tensor([1.8896, 1.2628, 1.7035]), tensor([0.5716, 1.4610, 0.1135]), tensor([0.9365, 1.3336, 1.2999]), tensor([1.8368, 1.9827, 1.9098]), tensor([1.6714, 1.7031, 0.8710]), tensor([0.2240, 0.6288, 0.8877]), tensor([0.4596, 1.5112, 1.3510]), tensor([1.1614, 1.2416, 1.8785]), tensor([1.3642, 0.1231, 0.2741]), tensor([1.4407, 1.1363, 1.4877]), tensor([1.2801e-03, 7.7131e-02, 1.6132e+00]), tensor([1.6396, 0.0953, 1.3796]), tensor([0.2192, 1.7573, 1.3138]), tensor([1.9888, 0.0140, 0.0373]), tensor([1.6761, 1.8878, 1.6127]), tensor([1.6648, 0.1577, 1.7238]), tensor([0.0559, 1.2234, 0.3450]), tensor([0.6028, 1.1771, 0.6068]), tensor([0.8418, 0.0522, 0.0571]), tensor([1.3874, 0.5767, 0.3916]), tensor([0.6054, 0.1824, 0.2006]), tensor([1.5984, 1.5082, 1.1332]), tensor([0.4537, 1.3327, 1.0449]), tensor([0.2853, 1.2152, 1.9105]), tensor([0.0164, 0.0056, 1.1281]), tensor([1.7530, 0.3915, 1.2201]), tensor([1.7030, 1.3083, 1.2164]), tensor([1.9977, 1.6515, 0.4376]), tensor([1.0864, 1.5109, 1.8819]), tensor([0.0051, 1.5415, 0.7097]), tensor([0.0208, 1.2220, 0.4556]), tensor([1.1417, 0.3508, 0.2475]), tensor([0.9151, 0.6641, 1.5849]), tensor([1.0862, 1.7806, 1.1874]), tensor([0.6784, 1.6773, 1.0546]), tensor([1.1877, 0.6784, 1.0036]), tensor([0.8077, 0.9150, 0.2201]), tensor([0.9939, 0.1700, 0.7849]), tensor([1.5795, 0.3046, 0.3259]), tensor([0.7558, 0.7259, 1.1693]), tensor([1.1660, 1.5071, 0.3111]), tensor([0.9294, 1.5593, 1.8650]), tensor([0.9271, 0.4214, 1.2875]), tensor([1.5695, 0.3753, 0.4197]), tensor([1.4420, 0.9299, 0.0555]), tensor([0.4234, 1.4055, 0.6608]), tensor([1.6902, 1.7905, 1.1455]), tensor([0.9209, 0.6826, 0.9494]), tensor([1.1820, 0.2361, 0.7610]), tensor([0.1682, 1.6138, 0.3632]), tensor([1.9135, 0.7422, 0.4271]), tensor([1.4805, 1.1491, 1.6925]), tensor([1.4175, 0.0367, 1.6325]), tensor([0.8117, 0.5580, 1.6351]), tensor([1.7293, 0.1211, 0.9096]), tensor([1.8212, 1.3873, 1.8425]), tensor([0.6573, 0.4484, 1.8599]), tensor([1.4168, 1.9600, 0.5823]), tensor([0.3579, 0.8828, 0.0584]), tensor([1.3920, 1.7376, 1.2401]), tensor([0.9012, 1.4958, 0.3652]), tensor([1.9782, 0.0057, 0.0421]), tensor([0.7637, 1.8168, 1.1001]), tensor([1.3840, 0.2670, 1.3647]), tensor([0.8883, 1.4008, 1.7062]), tensor([1.4347, 0.9149, 0.9384]), tensor([0.3728, 0.6383, 1.6498]), tensor([0.5990, 1.6210, 0.6035]), tensor([0.7671, 1.0213, 0.0823]), tensor([0.9900, 0.8992, 0.9102]), tensor([0.8001, 1.7884, 1.7380]), tensor([0.3222, 1.4645, 0.2156]), tensor([0.1487, 1.3057, 1.0147]), tensor([0.5335, 0.0355, 0.6129]), tensor([1.3340, 0.0744, 0.0285]), tensor([1.1269, 0.2796, 0.1239]), tensor([0.6147, 0.8390, 0.0913]), tensor([0.3323, 1.0656, 0.0570]), tensor([0.8594, 0.3543, 0.3068]), tensor([1.3930, 0.2303, 0.2422]), tensor([1.5703, 1.1870, 1.9107]), tensor([0.7327, 0.5170, 0.9075]), tensor([1.0051, 1.7626, 0.0039]), tensor([0.9288, 1.4424, 0.4493]), tensor([0.4919, 1.4833, 0.0418]), tensor([1.2370, 0.2258, 1.4971]), tensor([0.1450, 1.6148, 0.0534]), tensor([0.1594, 1.0147, 1.7880]), tensor([0.1436, 0.5539, 1.8783]), tensor([0.8323, 1.4143, 0.0380]), tensor([0.6855, 0.4922, 1.8431]), tensor([1.4150, 0.2703, 1.1612])], 'dmri': [tensor([0.9885, 0.5891, 0.4289]), tensor([0.6682, 1.7882, 0.2831]), tensor([0.2877, 0.6915, 1.0174]), tensor([1.2722, 1.0300, 0.7593]), tensor([0.3936, 0.8206, 0.5974]), tensor([1.8079, 0.0266, 0.3621]), tensor([0.1864, 0.8172, 1.7793]), tensor([1.8765, 0.1294, 0.9567]), tensor([1.5870, 1.4408, 1.8191]), tensor([0.9723, 0.3281, 1.6615]), tensor([0.6571, 1.5178, 0.7536]), tensor([1.4251, 1.8994, 1.9299]), tensor([0.0899, 0.3385, 0.5865]), tensor([0.3623, 1.9595, 0.9117]), tensor([0.3367, 0.5550, 0.4476]), tensor([1.4080, 0.1277, 0.0676]), tensor([0.0142, 1.4305, 1.4945]), tensor([0.3789, 1.2480, 1.7382]), tensor([1.1453, 0.7884, 1.0739]), tensor([0.8928, 1.5035, 0.3210])]}),
  Flip(axes=(0,)),
  RescaleIntensity(out_min_max=(-1, 1), percentiles=(0, 100), masking_method=None)],
 [ToCanonical(),
  Gamma(gamma={'t1': [1.0724990367889404], 't2': [1.2081605195999146], 'fmri': [0.7706029415130615, 0.7793964147567749, 1.144237756729126, 1.114118218421936, 0.7563660144805908, 0.8459476232528687, 0.7599568963050842, 0.8066003918647766, 0.8734015226364136, 1.2817951440811157, 0.9420326948165894, 1.1880406141281128, 1.3296347856521606, 1.146506667137146, 0.7644771933555603, 1.162958025932312, 1.1212345361709595, 1.261775255203247, 0.7438393235206604, 1.2026227712631226, 1.2783401012420654, 0.7564571499824524, 1.0318857431411743, 1.291884422302246, 0.8039706945419312, 1.1034435033798218, 1.1417511701583862, 1.0818008184432983, 1.3475427627563477, 1.2784314155578613, 1.293544888496399, 0.9632964730262756, 1.2860991954803467, 0.756105899810791, 0.8505357503890991, 0.937850832939148, 0.9147384762763977, 1.3193094730377197, 1.152000069618225, 1.2130573987960815, 1.2263752222061157, 0.7992343306541443, 0.9658504128456116, 1.0447810888290405, 1.0811526775360107, 1.166805624961853, 0.8874775767326355, 0.9135105609893799, 1.2853388786315918, 0.9226408004760742, 0.8118883967399597, 1.2255772352218628, 1.2252521514892578, 0.9102189540863037, 0.9417871236801147, 0.8014249205589294, 0.778389573097229, 1.1194247007369995, 0.8797145485877991, 1.2697609663009644, 0.7864595651626587, 0.9593805074691772, 1.0064985752105713, 1.1667057275772095, 1.2748126983642578, 1.22527015209198, 1.141175389289856, 0.8713616728782654, 0.8071511387825012, 0.7646142244338989, 1.0149927139282227, 1.3377164602279663, 0.9446103572845459, 0.9874498844146729, 0.8041188716888428, 1.0964776277542114, 1.209485411643982, 0.7439549565315247, 0.8095824122428894, 1.2488365173339844, 1.0736128091812134, 0.981469988822937, 1.0550915002822876, 0.9554120302200317, 0.8108359575271606, 0.7555351257324219, 1.218124508857727, 0.9649480581283569, 0.8945663571357727, 0.9254875779151917, 0.8490587472915649, 0.9149782061576843, 0.7729628086090088, 1.251700520515442, 1.1303222179412842, 0.859592854976654, 0.9026738405227661, 1.1440690755844116, 0.8948567509651184, 1.082321286201477, 1.08610999584198, 0.8279123902320862, 1.0780463218688965, 1.0185247659683228, 1.299546241760254, 0.8971376419067383, 0.9257782101631165, 1.2949604988098145, 0.782719612121582, 1.0219111442565918, 1.335159420967102, 0.8741437792778015, 1.3332301378250122, 1.3049988746643066, 1.3219420909881592, 0.971778929233551, 1.3117865324020386, 0.8774670958518982, 0.9024052619934082, 1.120158076286316, 1.0654253959655762, 1.1798444986343384, 1.3298894166946411, 0.8287831544876099, 1.172593593597412, 1.1055792570114136, 1.1714829206466675, 1.1528668403625488, 0.8938466906547546, 0.788906991481781, 1.2713959217071533, 0.8427619934082031, 1.211426019668579, 0.7514181137084961, 0.9494231343269348, 1.0031846761703491, 1.053277850151062, 1.0245460271835327, 1.0991442203521729, 0.9671483635902405, 1.076237678527832, 1.3456474542617798, 0.8235626816749573, 0.9837543964385986, 0.8917968273162842, 1.3011244535446167, 1.2928019762039185, 0.9918525815010071, 0.90123450756073, 0.830805242061615, 1.2394427061080933, 0.9795528650283813, 1.3264986276626587, 1.1865839958190918, 1.300295352935791, 1.2677923440933228, 0.822873592376709, 1.0917813777923584, 0.8830286264419556, 1.1624455451965332, 0.973387598991394, 1.0263111591339111, 0.8126273155212402, 0.7648177742958069, 1.1196004152297974, 1.072203278541565, 1.026401400566101, 1.2260018587112427, 0.8822566270828247, 1.112371563911438, 0.8476999998092651, 1.064132571220398, 0.9338032007217407, 1.2337989807128906, 1.2999746799468994, 1.2976528406143188, 1.0135867595672607, 1.1935211420059204, 0.7410097718238831, 0.8386362195014954, 1.0550804138183594, 1.0016745328903198, 0.7901583909988403, 0.8756546974182129, 0.8692572116851807, 0.7428741455078125, 1.0290244817733765, 1.226921558380127, 1.1294819116592407, 0.867152988910675, 0.7592079043388367, 0.7850301861763, 1.0055803060531616, 1.2292128801345825, 0.885598361492157, 0.8493843078613281, 0.8521122932434082, 0.9743637442588806, 0.7520921230316162, 0.7674105167388916, 1.3435524702072144, 0.8666892051696777, 0.9473287463188171, 0.9228709936141968, 0.7683177590370178, 0.9484862685203552, 1.0961838960647583, 0.8853101134300232, 0.9872954487800598, 0.9985659718513489, 0.7418178915977478, 1.243605613708496, 1.274216890335083, 1.2269625663757324, 0.9061779975891113, 1.1697252988815308, 0.7549704313278198, 0.9284710884094238, 0.9408088326454163, 0.8994742035865784], 'dmri': [1.1342822313308716, 0.8722341656684875, 0.9658263921737671, 0.9170199632644653, 0.7544811964035034, 0.9516649842262268, 0.775503396987915, 1.191164255142212, 1.1739085912704468, 1.3245034217834473, 0.9041673541069031, 1.015372633934021, 1.06052827835083, 1.349137544631958, 1.31650972366333, 0.8561909198760986, 0.7747066617012024, 0.7630845308303833, 0.8654826879501343, 1.2868996858596802]}),
  RescaleIntensity(out_min_max=(-1, 1), percentiles=(0, 100), masking_method=None)],
 [ToCanonical(),
  RescaleIntensity(out_min_max=(-1, 1), percentiles=(0, 100), masking_method=None)],
 [ToCanonical(),
  Gamma(gamma={'t1': [1.3136634826660156], 't2': [0.9935333728790283], 'fmri': [1.2738008499145508, 0.7909780740737915, 1.1088109016418457, 0.8931500911712646, 0.8813992142677307, 0.939346432685852, 0.8948995471000671, 1.1786715984344482, 0.9445943236351013, 1.2554138898849487, 1.0708523988723755, 0.9547033905982971, 0.8409022688865662, 0.7597985863685608, 0.9162035584449768, 0.7574411034584045, 0.9459351897239685, 1.0049153566360474, 0.9808525443077087, 0.8629788756370544, 1.231482982635498, 1.184065580368042, 0.9287523627281189, 0.8882235884666443, 1.2075663805007935, 1.2982372045516968, 0.7598064541816711, 0.9372382760047913, 0.9725433588027954, 0.8970727920532227, 1.2918983697891235, 0.9566540718078613, 1.2896289825439453, 1.0014841556549072, 0.9679824113845825, 0.8394649624824524, 0.9050619006156921, 1.101495623588562, 1.1419087648391724, 0.9893827438354492, 1.3308966159820557, 0.8124995827674866, 1.1219004392623901, 1.310230016708374, 0.9491724967956543, 1.2689282894134521, 1.0049575567245483, 0.7987929582595825, 0.8482456803321838, 1.1181378364562988, 0.8782494068145752, 1.0748201608657837, 1.3434979915618896, 1.107277274131775, 0.9723135828971863, 1.0778695344924927, 0.8412695527076721, 0.7771857380867004, 0.7981091737747192, 0.7774540185928345, 1.0635005235671997, 1.0601760149002075, 0.8803018927574158, 0.745690107345581, 1.1764618158340454, 0.8434768915176392, 0.9511492252349854, 0.7775987982749939, 0.8442999720573425, 1.133316159248352, 0.7561480402946472, 0.8427609801292419, 1.2522213459014893, 0.85739666223526, 0.8826321363449097, 0.9192178249359131, 1.136823296546936, 0.8213623762130737, 1.0305365324020386, 1.1303426027297974, 0.9784574508666992, 1.0557438135147095, 0.7954444289207458, 1.145257830619812, 1.1186457872390747, 0.9630695581436157, 0.7803122401237488, 1.127488613128662, 1.216238021850586, 0.9488805532455444, 1.1518868207931519, 1.1176159381866455, 0.8869290947914124, 0.9793892502784729, 1.3480128049850464, 1.0014172792434692, 0.7875455617904663, 0.9783591032028198, 1.1609606742858887, 0.9067149758338928, 0.8546142578125, 1.2803499698638916, 1.1719903945922852, 0.9503092169761658, 1.0154447555541992, 0.9687692523002625, 1.0721324682235718, 1.0107189416885376, 0.8339844942092896, 1.057155966758728, 1.0078773498535156, 1.019585371017456, 0.8919668197631836, 1.0798982381820679, 0.7845901250839233, 1.0938208103179932, 1.1765283346176147, 0.9675230979919434, 0.7921218276023865, 0.9989100694656372, 1.000425934791565, 0.7716212868690491, 0.8088122010231018, 1.3198018074035645, 1.2515034675598145, 1.180881142616272, 1.2310009002685547, 1.1224219799041748, 1.1839267015457153, 1.2198116779327393, 0.9323170781135559, 0.96258145570755, 1.238516092300415, 0.9998919367790222, 0.8226652145385742, 0.7924548983573914, 1.182679533958435, 1.2820954322814941, 1.26236093044281, 1.0511929988861084, 1.230086088180542, 0.7592380046844482, 0.8056234121322632, 0.7492600679397583, 1.2734196186065674, 0.9972891211509705, 0.8709772229194641, 1.1068432331085205, 0.8937761783599854, 0.8249741196632385, 1.1226696968078613, 1.0564662218093872, 0.8066741228103638, 0.8206992149353027, 1.1510342359542847, 1.2562273740768433, 1.0247228145599365, 0.8601181507110596, 1.1558804512023926, 1.053714632987976, 0.7690157890319824, 0.8233174085617065, 1.0678668022155762, 1.2039794921875, 0.9081196784973145, 1.1561089754104614, 0.8304448127746582, 1.3325309753417969, 1.2383294105529785, 1.0578008890151978, 1.1427844762802124, 1.1100965738296509, 0.8377553820610046, 0.9973874688148499, 1.0832850933074951, 0.9345274567604065, 1.3333353996276855, 0.8907504677772522, 0.7649682760238647, 0.8669076561927795, 0.7569746971130371, 1.2804536819458008, 0.8740018606185913, 0.8097158074378967, 0.9680905938148499, 0.8169784545898438, 0.8549501895904541, 1.1652586460113525, 0.7983256578445435, 1.1519747972488403, 1.244546890258789, 0.9993273019790649, 1.1424909830093384, 0.8453136086463928, 1.2635750770568848, 1.3383432626724243, 1.073893666267395, 1.3144032955169678, 0.7423386573791504, 0.9675963521003723, 1.0614203214645386, 0.7704688310623169, 1.15718412399292, 0.8919596672058105, 0.897174596786499, 0.7881835103034973, 1.1304833889007568, 0.8038938045501709, 0.9383223652839661, 1.1425577402114868, 1.2535805702209473, 1.070191502571106, 0.8941221833229065, 0.8776655793190002, 1.1833919286727905, 1.0572395324707031, 1.2872925996780396, 1.1196048259735107, 1.2733798027038574, 0.7852582931518555], 'dmri': [1.2727481126785278, 0.8712413311004639, 0.9228345155715942, 1.0017971992492676, 0.9452937245368958, 1.0611377954483032, 1.306470274925232, 0.835900604724884, 1.0971282720565796, 0.7857541441917419, 1.0482317209243774, 1.2803627252578735, 1.2241967916488647, 1.2929271459579468, 1.1763274669647217, 0.9754850268363953, 1.0814783573150635, 0.8821824193000793, 1.2900060415267944, 1.162079930305481]}),
  Flip(axes=(0,)),
  RescaleIntensity(out_min_max=(-1, 1), percentiles=(0, 100), masking_method=None)]]

import pprint
import torch
import torchio as tio
import matplotlib.pyplot as plt

torch.manual_seed(0)

batch_size = 4
subject = tio.datasets.FPG()
subject.remove_image('seg')
subjects = 4 * [subject]

transform = tio.Compose((
    tio.ToCanonical(),
    tio.RandomGamma(p=0.75),
    tio.RandomBlur(p=0.5),
    tio.RandomFlip(),
    tio.RescaleIntensity(out_min_max=(-1, 1)),
))

dataset = tio.SubjectsDataset(subjects, transform=transform)

transformed = dataset[0]
print('Applied transforms:')  # noqa: T001
pprint.pprint(transformed.history)  # noqa: T003
print('\nComposed transform to reproduce history:')  # noqa: T001
print(transformed.get_composed_history())  # noqa: T001
print('\nComposed transform to invert applied transforms when possible:')  # noqa: T001, E501
print(transformed.get_inverse_transform(ignore_intensity=False))  # noqa: T001

loader = torch.utils.data.DataLoader(
    dataset,
    batch_size=batch_size,
    collate_fn=tio.utils.history_collate,
)

batch = tio.utils.get_first_item(loader)
print('\nTransforms applied to subjects in batch:')  # noqa: T001
pprint.pprint(batch[tio.HISTORY])  # noqa: T003

for i in range(batch_size):
    tensor = batch['t1'][tio.DATA][i]
    affine = batch['t1'][tio.AFFINE][i]
    image = tio.ScalarImage(tensor=tensor, affine=affine)
    image.plot(show=False)
    history = batch[tio.HISTORY][i]
    title = ', '.join(t.name for t in history)
    plt.suptitle(title)
    plt.tight_layout()

plt.show()

Total running time of the script: ( 0 minutes 57.206 seconds)

Gallery generated by Sphinx-Gallery