8000 [FEATURE] - XA30 loader Siemens WIP MEGA - load_twix - gunziyhu by HJZollner · Pull Request #503 · schorschinho/osprey · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[FEATURE] - XA30 loader Siemens WIP MEGA - load_twix - gunziyhu #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fit/osp_fitMEGA.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
% Apply scaling factor to the data
dataToFit = op_takesubspec(MRSCont.processed.metab{kk},'A');
basisSetOff = MRSCont.fit.basisSet;
basisSetOff.name{1} = 'A';
basisSetOff.names{1} = 'A';
basisSetOff.fids = basisSetOff.fids(:,:,1);
basisSetOff.specs = basisSetOff.specs(:,:,1);
dataToFit = op_ampScale(dataToFit, 1/MRSCont.fit.scale{kk});
Expand Down Expand Up @@ -103,7 +103,7 @@
end

fitOpts.GAP = MRSCont.opts.fit.GAP.diff1;
basisSetDiff1.name{1} = 'diff1';
basisSetDiff1.names{1} = 'diff1';
% Call the fit function
[fitParamsDiff1, resBasisSetDiff1] = fit_runFit(dataToFit, basisSetDiff1, fitModel, fitOpts);

Expand Down
32 changes: 22 additions & 10 deletions libraries/FID-A/inputOutput/io_loadspec_twix.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@

%Check if the twix file is from a VE version
if contains(twix_obj.hdr.Dicom.SoftwareVersions, 'E11')
disp('Changed software version to VE.');
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

%find out what sequence, the data were acquired with. If this is a
%multi-raid file, then the header may contain multiple instances of
Expand Down Expand Up @@ -90,10 +93,13 @@
elseif isUniversal
if twix_obj.hdr.MeasYaps.sWipMemBlock.alFree{8} == 1
seq = 'HERMES';
else if isempty(twix_obj.hdr.MeasYaps.sWipMemBlock.alFree{8})
seq = 'MEGAPRESS';
else
else if twix_obj.hdr.MeasYaps.sWipMemBlock.alFree{8} == 3
seq = 'HERCULES';
else if isempty(twix_obj.hdr.MeasYaps.sWipMemBlock.alFree{8})
seq = 'MEGAPRESS';
else
seq = 'HERCULES';
end
end
end
elseif isMinn
Expand Down Expand Up @@ -134,8 +140,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')) && isjnSpecial) ||... %and the VD/VE versions of Jamie Near's SPECIAL sequence
((strcmp(version,'vd') || strcmp(version,'ve')) && isjnMP); %and the VD/VE versions of Jamie Near's MEGA-PRESS 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
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 @@ -180,7 +186,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(sqzDims{end},'Phs')
if isSiemens && (strcmp(version,'vd') || strcmp(version,'ve') || strcmp(version,'XA30')) && strcmp(sqzDims{end},'Phs')
sqzDims=sqzDims(1:end-1);
sqzSize=sqzSize(1:end-1);
if ndims(fids)==4
Expand Down Expand Up @@ -215,7 +221,7 @@
TR = twix_obj.hdr.MeasYaps.alTR{1}; %Franck Lamberton

% Extract voxel dimensions
if (strcmp(version,'vd') || strcmp(version,'vb'))
if (strcmp(version,'vd') || strcmp(version,'vb') || strcmp(version,'XA30'))
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 @@ -292,7 +298,7 @@
end

%Now index the dimension of the averages
if strcmp(version,'vd') || strcmp(version,'ve')
if strcmp(version,'vd') || strcmp(version,'ve') || strcmp(version,'XA30')
if isMinn || isConnectom
dims.averages=find(strcmp(sqzDims,'Set'));
else
Expand Down Expand Up @@ -338,8 +344,14 @@
else
dims.subSpecs=find(strcmp(sqzDims,'Ida'));
end
elseif isWIP529 || isMinn || ismodWIP
elseif isWIP529 || isMinn
dims.subSpecs=find(strcmp(sqzDims,'Eco'));
elseif ismodWIP
if strcmp(version,'vd') || strcmp(version,'ve')
dims.subSpecs=find(strcmp(sqzDims,'Eco'));
else
dims.subSpecs=find(strcmp(sqzDims,'Ide'));
end
elseif isWIP859
dims.subSpecs=find(strcmp(sqzDims,'Ide'));
else
Expand Down
0