From faffb2c308883b35179090d475accbf11b570c52 Mon Sep 17 00:00:00 2001 From: jamienear Date: Thu, 2 Apr 2015 12:37:33 -0400 Subject: [PATCH] Modified the data load functions (io_loadspec_twix.m and related) so that they write a field called out.seq, which contains information about the pulse sequence. In most cases this will not be used, but in some cases (ie. in the case of data acquired using WIP529), this information can be used by the functions or example run scripts. Specifically, I modified run_megapressproc.m so that it uses this information to determine how to properly combine the water unsuppressed sub-spectra. Thank you to Georg Oeltzschner, who spotted the problem and suggested the solutiongit status --- exampleRunScripts/run_megapressproc.m | 8 +++++++- inputOutput/io_loadjmrui.m | 2 ++ inputOutput/io_loadspec_GE.m | 2 ++ inputOutput/io_loadspec_IMA.m | 1 + inputOutput/io_loadspec_data.m | 2 ++ inputOutput/io_loadspec_sdat.m | 1 + inputOutput/io_loadspec_twix.m | 12 ++++++++++++ inputOutput/io_loadspec_varian.m | 2 ++ inputOutput/io_readlcmraw.m | 1 + inputOutput/io_readlcmraw_basis.m | 1 + 10 files changed, 31 insertions(+), 1 deletion(-) diff --git a/exampleRunScripts/run_megapressproc.m b/exampleRunScripts/run_megapressproc.m index d74a820..05fb44e 100755 --- a/exampleRunScripts/run_megapressproc.m +++ b/exampleRunScripts/run_megapressproc.m @@ -408,9 +408,15 @@ out1_diff=op_combinesubspecs(out1,'diff'); out1_sum=op_combinesubspecs(out1,'summ'); + %Make final water unsuppressed data if water - outw=op_combinesubspecs(outw_ls,'summ'); + if strcmp(outw_ls.seq,'WIP529'); + outw=op_combinesubspecs(outw_ls,'diff'); + else + outw=op_combinesubspecs(outw_ls,'summ'); + end + outw=op_addphase(outw,-phase(outw.fids(1))*180/pi,0,4.65,1); else outw=0; end diff --git a/inputOutput/io_loadjmrui.m b/inputOutput/io_loadjmrui.m index 13e17c1..eef3690 100644 --- a/inputOutput/io_loadjmrui.m +++ b/inputOutput/io_loadjmrui.m @@ -50,6 +50,8 @@ out.date=date; out.dims=dims; out.Bo=Bo; +out.seq=''; +out.pointsToLeftshift=0; %Write flags out.flags.writtentostruct=1; diff --git a/inputOutput/io_loadspec_GE.m b/inputOutput/io_loadspec_GE.m index 3c59897..2a30179 100644 --- a/inputOutput/io_loadspec_GE.m +++ b/inputOutput/io_loadspec_GE.m @@ -185,6 +185,7 @@ out.rawAverages=rawAverages; out.subspecs=subspecs; out.rawSubspecs=rawSubspecs; +out.seq=''; out.pointsToLeftshift=0; @@ -225,6 +226,7 @@ out_w.rawAverages=rawAverages_w; out_w.subspecs=subspecs_w; out_w.rawSubspecs=rawSubspecs_w; +out_w.seq=''; out_w.pointsToLeftshift=0; diff --git a/inputOutput/io_loadspec_IMA.m b/inputOutput/io_loadspec_IMA.m index d566fe4..4334a5c 100644 --- a/inputOutput/io_loadspec_IMA.m +++ b/inputOutput/io_loadspec_IMA.m @@ -163,6 +163,7 @@ out.rawAverages=rawAverages; out.subspecs=subspecs; out.rawSubspecs=rawSubspecs; +out.seq=''; out.pointsToLeftshift=0; diff --git a/inputOutput/io_loadspec_data.m b/inputOutput/io_loadspec_data.m index 293595f..c5b85d0 100644 --- a/inputOutput/io_loadspec_data.m +++ b/inputOutput/io_loadspec_data.m @@ -191,6 +191,7 @@ out.rawAverages=rawAverages; out.subspecs=subspecs; out.rawSubspecs=rawSubspecs; +out.seq=''; out.pointsToLeftshift=0; @@ -231,6 +232,7 @@ out_w.rawAverages=rawAverages_w; out_w.subspecs=subspecs_w; out_w.rawSubspecs=rawSubspecs_w; +out_w.seq=''; out_w.pointsToLeftshift=0; diff --git a/inputOutput/io_loadspec_sdat.m b/inputOutput/io_loadspec_sdat.m index da1bf8a..b72098e 100644 --- a/inputOutput/io_loadspec_sdat.m +++ b/inputOutput/io_loadspec_sdat.m @@ -153,6 +153,7 @@ out.rawAverages=rawAverages; out.subspecs=subspecs; out.rawSubspecs=rawSubspecs; +out.seq=''; out.pointsToLeftshift=0; diff --git a/inputOutput/io_loadspec_twix.m b/inputOutput/io_loadspec_twix.m index 64e7632..7fb8af6 100644 --- a/inputOutput/io_loadspec_twix.m +++ b/inputOutput/io_loadspec_twix.m @@ -63,6 +63,17 @@ data=dOut.data; end +%Make a pulse sequence identifier for the header (out.seq); +if isSpecial + seq='rm_special' +elseif isWIP529 + seq='WIP529' +else + seq=''; +end + + + fids=squeeze(data); %If we are dealing with WIP 529, then we need to swap the order of the @@ -327,6 +338,7 @@ out.rawAverages=rawAverages; out.subspecs=subspecs; out.rawSubspecs=rawSubspecs; +out.seq=seq; if RaidLength==1 out.pointsToLeftshift=twix_obj.image.freeParam(1); elseif RaidLength>1 diff --git a/inputOutput/io_loadspec_varian.m b/inputOutput/io_loadspec_varian.m index 23653d2..04ed9ab 100644 --- a/inputOutput/io_loadspec_varian.m +++ b/inputOutput/io_loadspec_varian.m @@ -111,6 +111,8 @@ out.date=date; out.dims=dims; out.Bo=out.txfrq/42.577/1e6; +out.seq=''; +out.pointsToLeftshift=0; %FILLING IN THE FLAGS out.flags.writtentostruct=1; diff --git a/inputOutput/io_readlcmraw.m b/inputOutput/io_readlcmraw.m index 35a98c0..47e8293 100644 --- a/inputOutput/io_readlcmraw.m +++ b/inputOutput/io_readlcmraw.m @@ -163,6 +163,7 @@ out.txfrq=txfrq; out.date=date; +out.seq=''; out.dims.t=1; out.dims.coils=0; diff --git a/inputOutput/io_readlcmraw_basis.m b/inputOutput/io_readlcmraw_basis.m index 23db98e..7ac5679 100644 --- a/inputOutput/io_readlcmraw_basis.m +++ b/inputOutput/io_readlcmraw_basis.m @@ -91,6 +91,7 @@ out.txfrq=txfrq; out.date=date; +out.seq=''; out.dims.t=1; out.dims.coils=0;