Image-X-Institute / mri_distortion_toolkit

Characterisation and reporting of geometric distortion in MRI
https://image-x-institute.github.io/mri_distortion_toolkit/
GNU General Public License v3.0
9 stars 3 forks source link

update combine gradient harmonics so order matches gradient order: #224

Closed bwheelz36 closed 1 year ago

bwheelz36 commented 1 year ago
        if freq_encode_direction == 'x':
            gradient_order = int(np.sqrt(self._Gx_Harmonics.shape[0]-1))
            scale = 1/self._dicom_data['gradient_strength'][0]
            self._Gx_Harmonics = combine_harmonics(self._Gx_Harmonics, self._B0_Harmonics*scale, operation=_operation,
                                                   n_order_return=gradient_order)
        elif freq_encode_direction == 'y':
            gradient_order = int(np.sqrt(self._Gy_Harmonics.shape[0] - 1))
            scale = 1 / self._dicom_data['gradient_strength'][1]
            self._Gy_Harmonics = combine_harmonics(self._Gy_Harmonics, self._B0_Harmonics*scale, operation=_operation,
                                                   n_order_return=gradient_order)
        elif freq_encode_direction == 'z':
            gradient_order = int(np.sqrt(self._Gz_Harmonics.shape[0] - 1))
            scale = 1 / self._dicom_data['gradient_strength'][2]
            self._Gz_Harmonics = combine_harmonics(self._Gz_Harmonics, self._B0_Harmonics*scale, operation=_operation,
                                                   n_order_return=gradient_order)
bwheelz36 commented 1 year ago

fixed in #226