Skip to content

Commit

Permalink
Merge pull request #738 from HJZollner/develop
Browse files Browse the repository at this point in the history
[BUG FIX] - MEGA-PRESS XA31 files extra dim issues - OspreyLoad - Ale…
  • Loading branch information
HJZollner authored May 19, 2024
2 parents c2b168a + 707a0ea commit 35aa1ab
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions libraries/FID-A/inputOutput/io_loadspec_twix.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,9 @@
twix_obj.image.softwareVersion = 've';
version=twix_obj.image.softwareVersion;
end
if contains(twix_obj.hdr.Dicom.SoftwareVersions, 'XA30')
twix_obj.image.softwareVersion = 'XA30';
version=twix_obj.image.softwareVersion;
end
if contains(twix_obj.hdr.Dicom.SoftwareVersions, 'XA50') % scnh
twix_obj.image.softwareVersion = 'XA50'; % scnh
version=twix_obj.image.softwareVersion; % scnh
end % scnh
if contains(twix_obj.hdr.Dicom.SoftwareVersions, 'XA61')
twix_obj.image.softwareVersion = 'XA61';
if contains(twix_obj.hdr.Dicom.SoftwareVersions, 'XA')
index = strfind(twix_obj.hdr.Dicom.SoftwareVersions,'XA');
twix_obj.image.softwareVersion = twix_obj.hdr.Dicom.SoftwareVersions(index:index+3);
version=twix_obj.image.softwareVersion;
end

Expand Down Expand Up @@ -165,8 +158,8 @@
%25 Oct 2018: Due to a recent change, the VE version of Jamie Near's MEGA-PRESS
%sequence also falls into this category.
if isSpecial ||... %Catches Ralf Mekle's and CIBM version of the SPECIAL sequence
((strcmp(version,'vd') || strcmp(version,'ve') || strcmp(version,'XA30')) && isjnSpecial) ||... %and the VD/VE versions of Jamie Near's SPECIAL sequence
((strcmp(version,'vd') || strcmp(version,'ve') || strcmp(version,'XA30')) && isjnMP); %and the VD/VE versions of Jamie Near's MEGA-PRESS sequence
((strcmp(version,'vd') || strcmp(version,'ve') || contains(version,'XA')) && isjnSpecial) ||... %and the VD/VE versions of Jamie Near's SPECIAL sequence
((strcmp(version,'vd') || strcmp(version,'ve') || contains(version,'XA')) && isjnMP); %and the VD/VE versions of Jamie Near's MEGA-PRESS sequence
squeezedData=squeeze(dOut.data);
if twix_obj.image.NCol>1 && twix_obj.image.NCha>1
data(:,:,:,1)=squeezedData(:,:,[1:2:end-1]);
Expand Down Expand Up @@ -211,7 +204,7 @@

%noticed that in the Siemens PRESS and STEAM sequences, there is sometimes
%an extra dimension containing unwanted reference scans or something. Remove them here.
if isSiemens && (strcmp(version,'vd') || strcmp(version,'ve') || strcmp(version,'XA30')) && strcmp(sqzDims{end},'Phs')
if isSiemens && (strcmp(version,'vd') || strcmp(version,'ve') || contains(version,'XA')) && strcmp(sqzDims{end},'Phs')
sqzDims=sqzDims(1:end-1);
sqzSize=sqzSize(1:end-1);
if ndims(fids)==4
Expand Down Expand Up @@ -279,7 +272,7 @@
end

% Extract voxel dimensions
if (strcmp(version,'vd') || strcmp(version,'vb') || strcmp(version,'XA30') || strcmp(version,'XA50') || strcmp(version,'XA61')) % scnh
if (strcmp(version,'vd') || strcmp(version,'vb') || contains(version,'XA'))
TwixHeader.VoI_RoFOV = twix_obj.hdr.Config.VoI_RoFOV; % Voxel size in readout direction [mm]
TwixHeader.VoI_PeFOV = twix_obj.hdr.Config.VoI_PeFOV; % Voxel size in phase encoding direction [mm]
TwixHeader.VoIThickness = twix_obj.hdr.Config.VoI_SliceThickness; % Voxel size in slice selection direction [mm]
Expand Down Expand Up @@ -356,7 +349,7 @@
end

%Now index the dimension of the averages
if strcmp(version,'vd') || strcmp(version,'ve') || strcmp(version,'XA30') || strcmp(version,'XA50') || strcmp(version,'XA61') % scnh
if strcmp(version,'vd') || strcmp(version,'ve') || contains(version,'XA')
if isMinn_eja || isMinn_dkd || isConnectom
dims.averages=find(strcmp(sqzDims,'Set'));
else
Expand Down Expand Up @@ -668,7 +661,7 @@
if isWIP529 || isWIP859
leftshift = twix_obj.image.cutOff(1,1);
elseif isSiemens && (~(isMinn_eja || isMinn_dkd) && ~isConnectom)
if ~strcmp(version,'ve') && ~strcmp(version,'XA30')
if ~strcmp(version,'ve') && ~contains(version,'XA')
leftshift = twix_obj.image.freeParam(1);
else
leftshift = twix_obj.image.iceParam(5,1);
Expand Down

0 comments on commit 35aa1ab

Please sign in to comment.