Skip to content

Commit

Permalink
added UNET++ and conv downscaling
Browse files Browse the repository at this point in the history
  • Loading branch information
mfroeling committed Aug 15, 2024
1 parent db4793e commit 4b5f66b
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 223 deletions.
10 changes: 6 additions & 4 deletions QMRITools/Kernel/MuscleBidsTools.wl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ BidsDcmToNiiI[fol_, outI_, logFile_]:=Block[{out},
If[EmptyDirectoryQ[out],
(*perform conversion*)
(*----*)AddToLog["Starting the conversion", 1, True];
DcmToNii[FileNameJoin[{Directory[],#}]&/@{fol,out}, MonitorCalc->False];
DcmToNii[FileNameJoin[{Directory[],#}]&/@{fol,out}, MonitorCalc->False, UseVersion->"23"];
(*----*)AddToLog["Folder was converted", 1],
(*----*)AddToLog["Folder was skipped since output folder already exists", 1];
];
Expand Down Expand Up @@ -922,7 +922,7 @@ MuscleBidsProcessI[foli_, folo_, datType_, logFile_, verCheck_]:=Block[{
t2stari, watfr, fatfr, wat, fat , inph, outph, b0, t2star, r2star, phi, itt, res, outTypes, preProc,
nfilep, resi, data, grad, val, diffvox, mask, den, sig, snr, snr0, reg, valU, mean, fiti, s0i, fri,
adci, pD, tens, s0, out, l1, l2, l3, md, fa, rd, t2vox, t2w, t2f, b1, n, angle, ex, ref, thk,
phii, phbpi, phbp, ta, filt
phii, phbpi, phbp, ta, filt, field
},

(*get the context for exporting*)
Expand Down Expand Up @@ -985,7 +985,8 @@ MuscleBidsProcessI[foli_, folo_, datType_, logFile_, verCheck_]:=Block[{

(*import the data*)
json = ImportJSON[jfile];
echos = json["EchoTime"];
{echos, field} = json /@ {"EchoTime", "MagneticFieldStrength"};

{{real, imag}, dvox} = Transpose[ImportNii/@nfiles];
dvox = First@dvox;

Expand Down Expand Up @@ -1016,7 +1017,8 @@ MuscleBidsProcessI[foli_, folo_, datType_, logFile_, verCheck_]:=Block[{
(*fit with DB fat model*)
{{watfr, fatfr}, {wat, fat, dbond}, {inph, outph}, {{b0, phbp, phi, phbpt}, {t2star, r2star}}, itt, res} = DixonReconstruct[
{real, imag}, echos, {b0i, t2stari, phii, phbpi},
DixonPhases -> {True, True, True, True, True}, DixonFixT2 -> False,
DixonPhases -> {True, True, True, True, True},
DixonFixT2 -> False, DixonFieldStrength -> field,
DixonAmplitudes -> "CallDB", DixonTollerance->1];

{wat, fat} = Abs[{wat, fat}];
Expand Down
2 changes: 1 addition & 1 deletion QMRITools/Kernel/NiftiTools.wl
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ DcmToNii[{infol_?StringQ, outfol_?StringQ}, opt:OptionsPattern[]] := Module[{
command = Switch[$OperatingSystem,
"Windows",
First@FileNameSplit[dcm2niif]<>"\ncd "<>dcm2niif<>"\n"<>dcm2niix<>" -f %s_%t_%m_%n_%p -z "<>
compress<>" -m y -v y -o \""<>folout<>"\" \""<> filfolin<>"\" > \""<>log<>"\nexit\n"
compress<>" -b o -m n -v y -o \""<>folout<>"\" \""<> filfolin<>"\" > \""<>log<>"\nexit\n"
,
"Unix",
dcm2nii<>" -f %s_%t_%m_%n_%p -z "<>
Expand Down
2 changes: 1 addition & 1 deletion QMRITools/Kernel/QMRITools.wl
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ Get["Developer`"];

(*Protect definitions*)
Protect/@{QMRITools`$InstalledVersion, QMRITools`$SubPackages, QMRITools`$Contexts, QMRITools`$ContextsFunctions};
Unprotect/@{"QMRITools`ElastixTools`$debugElastix", "QMRITools`$Log"};
Unprotect/@{"QMRITools`ElastixTools`$debugElastix", "QMRITools`SegmentationTools`$debugUnet", "QMRITools`$Log"};
Loading

0 comments on commit 4b5f66b

Please sign in to comment.