BrkRaw / brkraw

BrkRaw: A comprehensive tool to access raw Bruker Biospin MRI data
https://brkraw.github.io
GNU General Public License v3.0
45 stars 29 forks source link

PV6 Supine vs Prone does not change conversion #33

Open gdevenyi opened 3 years ago

gdevenyi commented 3 years ago

I have been collecting validation datasets for conversion and run into a conversion bug, which was handled properly in 0.3.4, and is wrong in HEAD.

I have a phantom brain in the scanner, physically in the orientation "Head First Prone". I have collected two scans, with PV6 configured as Quadruped, and one scan "Head First Prone" and another "Head First Supine".

brkraw info properly reports the difference in the data:

$ brkraw info 20200814_164540_CIC_PLANTEST_008_PV6_1_1/
Paravision 6.0.1
----------------
UserAccount:    foujer
Date:           2020-08-14
Researcher:     CIC_PLANTEST_008_PV6
Subject ID:     CIC_PLANTEST_008_PV6
Session ID:     CIC_PLANTEST_008_PV6
Study ID:       1
Date of Birth:  14 Aug 2020
Sex:            unknown
Weight:         0.001 kg
Subject Type:   Quadruped
Position:       Prone           Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   Bruker:FLASH::1_Localizer_multi_slice::
        [ TR: 15 ms, TE: 3 ms, pixelBW: 212.30 Hz, FlipAngle: 10 degree]
    [01] dim: 2D, matrix_size: 192 x 192 x 15, fov_size: 25 x 25 (unit:mm)
         spatial_resol: 0.130 x 0.130 x 2.000 (unit:mm), temporal_resol: 129600.000 (unit:msec)
[002]   Bruker:FLASH::T1_FLASH_3D::
        [ TR: 10 ms, TE: 4 ms, pixelBW: 300.48 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 96 x 96 x 96, fov_size: 20 x 20 x 20 (unit:mm)
         spatial_resol: 0.208 x 0.208 x 0.208 (unit:mm), temporal_resol: 92160.000 (unit:msec)
$ brkraw info 20200814_170107_CIC_PLANTEST_008_PV6_1_2/
Paravision 6.0.1
----------------
UserAccount:    foujer
Date:           2020-08-14
Researcher:     CIC_PLANTEST_008_PV6
Subject ID:     CIC_PLANTEST_008_PV6
Session ID:     CIC_PLANTEST_008_PV6_HFS
Study ID:       2
Date of Birth:  14 Aug 2020
Sex:            unknown
Weight:         0.001 kg
Subject Type:   Quadruped
Position:       Supine          Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   Bruker:FLASH::1_Localizer::
        [ TR: 100 ms, TE: 2.50 ms, pixelBW: 256.99 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 3, fov_size: 30 x 30 (unit:mm)
         spatial_resol: 0.117 x 0.117 x 2.000 (unit:mm), temporal_resol: 12800.000 (unit:msec)
[002]   Bruker:FLASH::T1_FLASH_3D::
        [ TR: 10 ms, TE: 4 ms, pixelBW: 300.48 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 96 x 96 x 96, fov_size: 20 x 20 x 20 (unit:mm)
         spatial_resol: 0.208 x 0.208 x 0.208 (unit:mm), temporal_resol: 92160.000 (unit:msec)
[003]   Bruker:FLASH::T1_FLASH_3D::
        [ TR: 10 ms, TE: 4 ms, pixelBW: 300.48 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 96 x 96 x 96, fov_size: 20 x 20 x 20 (unit:mm)
         spatial_resol: 0.208 x 0.208 x 0.208 (unit:mm), temporal_resol: 92160.000 (unit:msec)

However, after conversion, both the datasets are in the same orientation: image

Left: correct orientation Middle: incorrect orientation, should be rotated

The last commit to touch this code was: https://github.com/BrkRaw/bruker/commit/eaa6db06fd6114922670840b35c0dff041cf4e61

In 0.3.4, it looks like subj_position is ignored for PV6 and applied to PV5, where as in master, it is applied unconditionally.

gdevenyi commented 3 years ago

It looks like perhaps the existing affine from bruker is actually correct and the additional corrections added were due to confusion regarding the exact orientation of previous phantom test data?

gdevenyi commented 3 years ago

Confirmed with PV5 as well, that just skipping the correction orientation by adding pass here: https://github.com/BrkRaw/bruker/blob/master/brkraw/lib/orient.py#L24

Results in correct orientations for the Supine/Prone positions.

I will hold off on making any changes yet, as I want to collect all orientations and "subject types" in both PV5 and PV6 in a single session with the phantom universally in the "Head First Prone" position. I think perhaps we may be able to do away with most of this code.

dvm-shlee commented 3 years ago

@gdevenyi Sorry for the delay regarding the update of this software. I tried to make the final orientation to be oriented on subject whether the animal positioned supine or prone. So if the resulted orientation is always the same. I think it is correct.

Please let me know if I mis-catch your point. Thanks!

gdevenyi commented 3 years ago

Sorry for the delay, please see email to your github listed email for a orientation dataset to sort this out.