\newcommand\setrow[1]{\gdef\rowmac{#1}#1\ignorespaces}
\newcommand\clearrow{\global\let\rowmac\relax}
\clearrow
\newcolumntype{C}{>{\rowmac}c}%
\newcolumntype{L}{>{\rowmac}l}%
\newcolumntype{Z}{>{\rowmac}c<{\clearrow}}

\def\deflambda{0.01}
\def\defalignlambda{0.001}
\def\defadaptlambda{0.1}
\def\altdistlambda{0.1}
\def\defloss{kullback_leibler_divergence}
\def\defaultdir{settings-v3}

\newwrite\valfls
\immediate\openout\valfls=\jobname.valfls

\csvstyle{myCSVstyle}{%
  separator=semicolon,
  respect all,
  head to column names=true}

\ifdraft{%
  \DeclareDocumentCommand\readCSVValue{m m m}{%
    \pgfmathsetmacro{\CSVnumber}{0.9999}
  }
  \DeclareDocumentCommand\readRawValue{m m m}{%
    \pgfmathsetmacro{\CSVnumber}{0.9999}
  }%
}{%
  \DeclareDocumentCommand\readRawValue{m m m}{%
    \immediate\write\valfls{#1/#2/#3.value}%
    \def\valfile{csv-data/#1/#2/#3.value}%
    \IfFileExists{\valfile}{%
      \CatchFileDef{\arga}{\valfile}%
      \expandafter\pgfmathparse{\arga}%
      \pgfmathsetmacro{\CSVnumber}{\pgfmathresult}%
    }{%
      \pgfmathsetmacro{\CSVnumber}{-0.0001}%
    }%
  }%
  \DeclareDocumentCommand\readCSVValue{m m m}{%
    \csvreader[myCSVstyle, %
    filter strcmp={\csvcoli}{#2}]%
    {#1}{}%
    {%
      \pgfmathsetmacro{\CSVnumber}{\csname \detokenize{#3}\endcsname}%
    }%
  }%
}%

\DeclareDocumentCommand\readValue{O{time} m m m m}{%
  \readRawValue{#2/aggregates/#1_aggregations}%
  {#3}%
  {#4-#5}%
}

\DeclareDocumentCommand\printValue{O{4} m m m m}{%
  \readValue{#2}{#3}{#4}{#5}%
  \pgfmathprintnumber[fixed,precision=#1]{\CSVnumber}%
}

\DeclareDocumentCommand\printMaxValue{O{4} m m m m}{%
  \readValue[max]{#2}{#3}{#4}{#5}%
  \pgfmathprintnumber[fixed,precision=#1]{\CSVnumber}%
}

\DeclareDocumentCommand\printPercent{O{2} m m m m}{%
  \readValue{#2}{#3}{#4}{#5}%
  \pgfmathsetmacro{\CSVnumber}{100 * \CSVnumber}%
  \pgfmathprintnumber[fixed,precision=#1,fixed zerofill,]{\CSVnumber}%
}

\DeclareDocumentCommand\printMaxPercent{O{2} m m m m}{%
  \readValue[max]{#2}{#3}{#4}{#5}%
  \pgfmathsetmacro{\CSVnumber}{100 * \CSVnumber}%
  \pgfmathprintnumber[fixed,precision=#1,fixed zerofill,]{\CSVnumber}%
}

\DeclareDocumentCommand\printPercentWithStd{O{2} m m m m}{%
  \printPercent[#1]{#2}{#3}{#4}{#5} \ensuremath{\pm} \printPercent[#1]{#2}{#3}{#4}{std}%
}

\DeclareDocumentCommand\printMaxPercentWithStd{O{2} m m m m}{%
  \printMaxPercent[#1]{#2}{#3}{#4}{#5} \ensuremath{\pm} \printMaxPercent[#1]{#2}{#3}{#4}{std}%
}

\DeclareDocumentCommand\readDCValue{m m m}{%
\readCSVValue{csv-data/compare-dc.csv}%
  {#2}%
  {#1_#3}%
}

\DeclareDocumentCommand\printCompareDCPercent{O{2} m m m}{%
  \readDCValue{#2}{#3}{#4}%
  \pgfmathsetmacro{\CSVnumber}{100 * \CSVnumber}%
  \pgfmathprintnumber[fixed,precision=#1,fixed zerofill,]{\CSVnumber}%
}

\DeclareDocumentCommand\printCompareDCPercentWithStd{O{2} m m m}{%
  \printCompareDCPercent[#1]{#2}{#3}{#4} \pm \printCompareDCPercent[#1]{#2}{#3}{std}%
}


\pgfplotsset{
  every axis plot post/.append style={
    mark=none,
  },
}

\pgfplotsset{
  every axis legend/.append style={
    anchor=south east,
    at={(0.98, 0.02)},
  },
}

\DeclareDocumentCommand\addCSVplot{O{} O{} m m m}{%
  \def\valfile{csv-data/#3/aggregates/#4.csv}%
  \immediate\write\valfls{#3/aggregates/#4.csv}%
    \IfFileExists{\valfile}{%
    \addplot[#1] table [y=#5, col sep=semicolon, #2] {\valfile};%
  }{%
    \addplot[#1] {x};%
  }%
}

\DeclareDocumentCommand\addCSVplotNext{O{} O{} m m m}{%
  \def\valfile{csv-data/#3/aggregates/#4.csv}%
  \immediate\write\valfls{#3/aggregates/#4.csv}%
  \IfFileExists{\valfile}{%
    \addplot+[#1] table [y=#5, col sep=semicolon, #2] {\valfile};%
  }{%
    \addplot+[#1] {x};%
  }%
}

\makeatletter
\newsavebox{\measure@tikzpicture}
\NewEnviron{scaletikzpicturetowidth}[1]{%
  \def\tikz@width{#1}%
  \def\tikzscale{1}\begin{lrbox}{\measure@tikzpicture}%
  \BODY
  \end{lrbox}%
  \pgfmathparse{#1/\wd\measure@tikzpicture}%
  \edef\tikzscale{\pgfmathresult}%
  \BODY
}



\DeclareDocumentCommand\printstuff{m m m m}{& GM & \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC_1}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{TARG_DC_1}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{TARG_DC_1}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{TARG_DC_1}{mean}        \\
  &  & WM 
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC_2}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{TARG_DC_2}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{TARG_DC_2}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{TARG_DC_2}{mean}        \\
  & & CSF
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC_3}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{TARG_DC_3}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{TARG_DC_3}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{TARG_DC_3}{mean}        \\
&  & Mean 
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{TARG_DC}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{TARG_DC}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{TARG_DC}{mean}
}

\DeclareDocumentCommand\printstuffeval{m m m m}{& GM & \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC_1}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{EVAL_TARG_DC_1}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{EVAL_TARG_DC_1}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{EVAL_TARG_DC_1}{mean}        \\
  &  & WM 
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC_2}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{EVAL_TARG_DC_2}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{EVAL_TARG_DC_2}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{EVAL_TARG_DC_2}{mean}        \\
  & & CSF
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC_3}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{EVAL_TARG_DC_3}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{EVAL_TARG_DC_3}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{EVAL_TARG_DC_3}{mean}        \\
&  & Mean 
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{SRC_DC}{EVAL_TARG_DC}{mean} 
& \printMaxPercentWithStd{\defaultdir/#3}{TARG_DC}{EVAL_TARG_DC}{mean}          
& \printMaxPercentWithStd{\defaultdir/#4}{TARG_DC}{EVAL_TARG_DC}{mean}
}


\readValue[max]{\defaultdir/data-iseg/model-AdaptSegNet/unsup-True/src-T1/targ-T2/lambda-\defadaptlambda/loss-None/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\adaptISEG}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-False/src-T1/targ-T2/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{SRC_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\baselineISEG}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-AdaptSegNet/unsup-True/src-T1/targ-T2_FLAIR/lambda-\defadaptlambda/loss-None/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\adaptMRB}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-DDM/unsup-False/src-T1/targ-T2_FLAIR/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{SRC_DC}{TARG_DC}{mean}\pgfmathsetmacro{\baselineMRB}{\CSVnumber}%
\pgfmathsetmacro{\AdaptSegNetVSNoAdapt}{100 * min(\adaptISEG - \baselineISEG, \adaptMRB - \baselineMRB)}%

\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-False/src-T2/targ-T2/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\oracleISEG}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-DDM/unsup-False/src-T2_FLAIR/targ-T2_FLAIR/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\oracleMRB}{\CSVnumber}
\pgfmathsetmacro{\AdaptSegNetVSOracle}{100 * min(\oracleISEG - \adaptISEG, \oracleMRB - \adaptMRB)}%

\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-True/src-T1/targ-T2/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\ddmi}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-False/src-T2/targ-T2/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\oraclei}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-DDM/unsup-True/src-T1/targ-T2_FLAIR/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\ddmii}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-DDM/unsup-False/src-T2_FLAIR/targ-T2_FLAIR/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\oracleii}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-True/src-T2/targ-T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\ddmiii}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-False/src-T1/targ-T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\oracleiii}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-DDM/unsup-True/src-T2_FLAIR/targ-T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\ddmiv}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13/model-DDM/unsup-False/src-T1/targ-T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\oracleiv}{\CSVnumber}%
\pgfmathsetmacro{\DDMvsOracleMIN}{100 * min(\oraclei - \ddmi, \oracleii - \ddmii, \oracleiii - \ddmiii, \oracleiv - \ddmiv)}%
\pgfmathsetmacro{\DDMvsOracleMAX}{100 * max(\oraclei - \ddmi, \oracleii - \ddmii, \oracleiii - \ddmiii, \oracleiv - \ddmiv)}%

\readValue[max]{\defaultdir/data-iseg/model-AdaptSegNet/unsup-True/src-T1/targ-T2/lambda-\defadaptlambda/loss-None/shuf-True/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\adapti}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-AdaptSegNet/unsup-True/src-T2/targ-T1/lambda-\defadaptlambda/loss-None/shuf-True/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\adaptii}{\CSVnumber}%
\readDCValue{iseg}{avg}{mean}\pgfmathsetmacro{\baseval}{\CSVnumber}%
\pgfmathsetmacro{\AdaptSegNetVSOverlapISEG}{100 * ((\adapti + \adaptii)/2 - \baseval)}%

\readValue[max]{\defaultdir/data-iseg_aligned/model-AdaptSegNet/unsup-True/src-A_T1/targ-B_T2/lambda-\defadaptlambda/loss-None/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\adapti}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13_aligned/model-AdaptSegNet/unsup-True/src-A_T1/targ-B_T2_FLAIR/lambda-\defadaptlambda/loss-None/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\adaptii}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg_aligned/model-DDM/unsup-True/src-A_T1/targ-B_T2/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\ddmi}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13_aligned/model-DDM/unsup-True/src-A_T1/targ-B_T2_FLAIR/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\ddmii}{\CSVnumber}%
\pgfmathsetmacro{\TiAdaptSegNetVSDDMShufISEG}{100 * (\ddmi - \adapti)}%
\pgfmathsetmacro{\TiiAdaptSegNetVSDDMShufISEG}{100 * (\ddmii - \adaptii)}%

\readValue[max]{\defaultdir/data-iseg_aligned/model-AdaptSegNet/unsup-True/src-A_T2/targ-B_T1/lambda-\defadaptlambda/loss-None/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\adapti}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg_aligned/model-DDM/unsup-True/src-A_T2/targ-B_T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\ddmi}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-False/src-T2/targ-T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{SRC_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\noadapti}{\CSVnumber}%
\pgfmathsetmacro{\NoAdaptVSAdaptSegNetVSDDMShufISEG}{100*max(abs(\ddmi - \noadapti), abs(\adapti - \noadapti))}%



\readValue[max]{\defaultdir/data-mrbrains13_aligned/model-AdaptSegNet/unsup-True/src-A_T2_FLAIR/targ-B_T1/lambda-\defadaptlambda/loss-None/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\adapti}{\CSVnumber}%
\readValue[max]{\defaultdir/data-mrbrains13_aligned/model-DDM/unsup-True/src-A_T2_FLAIR/targ-B_T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-False}{TARG_DC}{TARG_DC}{mean}\pgfmathsetmacro{\ddmi}{\CSVnumber}%
\pgfmathsetmacro{\AdaptSegNetVSDDMShufMRB}{100*(\adapti - \ddmi)}%


\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-True/src-T1/targ-T2/lambda-\deflambda/loss-\defloss/shuf-True/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\shufi}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-True/src-T2/targ-T1/lambda-\deflambda/loss-\defloss/shuf-True/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\shufiii}{\CSVnumber}%
\pgfmathsetmacro{\DDMvsShufTi}{100 * (\ddmi - \shufi)}%
\pgfmathsetmacro{\DDMvsShufTii}{100 * (\ddmiii - \shufiii)}%

\readValue[max]{\defaultdir/data-iseg_aligned/model-DDM/unsup-True/src-A_T2/targ-B_T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\ddmiseg}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg/model-DDM/unsup-False/src-T2/targ-T1/lambda-\deflambda/loss-\defloss/shuf-False/eval-True}{SRC_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\unsupiseg}{\CSVnumber}%
\readValue[max]{\defaultdir/data-iseg_aligned/model-AdaptSegNet/unsup-True/src-A_T2/targ-B_T1/lambda-\defadaptlambda/loss-None/shuf-False/eval-True}{TARG_DC}{EVAL_TARG_DC}{mean}\pgfmathsetmacro{\adaptiseg}{\CSVnumber}%
\pgfmathsetmacro{\isegAllVSUnsup}{100 * max(abs(\ddmiseg - \unsupiseg), abs(\adaptiseg - \unsupiseg))}%

\ExplSyntaxOn

\DeclareDocumentCommand{\printSingleRow}{m O{} O{} O{} O{}}{%
  \clist_gclear_new:N \g_mxvallist
  \clist_gset:Nn \g_mxvallist {#2}
  \clist_gclear_new:N \g_outprefixlist
  \clist_gset:Nn \g_outprefixlist {#5}
  \clist_map_inline:nn { #1 } { &
    \clist_gpop:cNTF{g_mxvallist}{\mxvalname}%
    {\def\mymxvalname{\mxvalname}}%
    {\def\mymxvalname{TARG_DC}}
    \clist_gpop:cNTF{g_outprefixlist}{\outprefix}%
    {\def\myoutprefix{\outprefix}}%
    {\def\myoutprefix{#4}}
    \printMaxPercentWithStd{\defaultdir/##1}{\mymxvalname}{\myoutprefix TARG_DC#3}{mean}
  }
}

\DeclareDocumentCommand{\printFullRow}{m O{&} O{} O{}}{%
  GM \printSingleRow{#1}[#3][_1][][#4]
  \\
  #2 WM \printSingleRow{#1}[#3][_2][][#4]
  \\
  #2 CSF \printSingleRow{#1}[#3][_3][][#4]
  \\
  \setrow{\bfseries \boldmath}
  #2 Mean \printSingleRow{#1}[#3][][][#4]
}%

\DeclareDocumentCommand{\printFullRowEval}{m O{&} O{} O{}}{%
  GM \printSingleRow{#1}[#3][_1][EVAL_][#4]
  \\
  #2 WM \printSingleRow{#1}[#3][_2][EVAL_][#4]
  \\
  #2 CSF \printSingleRow{#1}[#3][_3][EVAL_][#4]
  \\
  \setrow{\bfseries \boldmath}
  #2 Mean \printSingleRow{#1}[#3][][EVAL_][#4]
}%

\ExplSyntaxOff

\DeclareDocumentCommand{\printFullRowWithDC}{m O{&} O{}}{%
  GM
  & $\printCompareDCPercentWithStd[1]{iseg}{1}{mean}$
  \printSingleRow{#1}[#3][_1]
  \\
  #2 WM
  & $\printCompareDCPercentWithStd[1]{iseg}{2}{mean}$
  \printSingleRow{#1}[#3][_2]
  \\
  #2 CSF
  & $\printCompareDCPercentWithStd[1]{iseg}{3}{mean}$
  \printSingleRow{#1}[#3][_3]
  \\
  #2 Mean
  & $\printCompareDCPercentWithStd[1]{iseg}{avg}{mean}$
  \printSingleRow{#1}[#3][]
}%

\DeclareDocumentCommand\printRowShuf{m m}{    GM
& $\printCompareDCPercentWithStd[1]{iseg}{1}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC_1}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{TARG_DC_1}{mean}\\
 &  & WM
& $\printCompareDCPercentWithStd[1]{iseg}{2}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC_2}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{TARG_DC_2}{mean}\\
 &  & CSF
& $\printCompareDCPercentWithStd[1]{iseg}{3}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC_3}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{TARG_DC_3}{mean}\\
 &  & Mean
& $\printCompareDCPercentWithStd[1]{iseg}{avg}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{TARG_DC}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{TARG_DC}{mean}
}


\DeclareDocumentCommand\printRowShufEval{m m}{    GM
& $\printCompareDCPercentWithStd[1]{iseg}{1}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC_1}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{EVAL_TARG_DC_1}{mean}\\
 &  & WM
& $\printCompareDCPercentWithStd[1]{iseg}{2}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC_2}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{EVAL_TARG_DC_2}{mean}\\
 &  & CSF
& $\printCompareDCPercentWithStd[1]{iseg}{3}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC_3}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{EVAL_TARG_DC_3}{mean}\\
 &  & Mean
& $\printCompareDCPercentWithStd[1]{iseg}{avg}{mean}$
& \printMaxPercentWithStd{\defaultdir/#1}{TARG_DC}{EVAL_TARG_DC}{mean}
& \printMaxPercentWithStd{\defaultdir/#2}{TARG_DC}{EVAL_TARG_DC}{mean}
}









