Skip to content

Commit

Permalink
added prelim version of matrix sqrt stuff (not working yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
brf2 committed Mar 22, 2021
1 parent f89a578 commit 954724c
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lta_convert/lta_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ static bool parseCommandLine(int argc, char *argv[], Parameters & P);

const char *Progname = NULL;

static int do_sqrt = 0 ;

LTA * shallowCopyLTA(const LTA * lta)
{
LTA * ltatmp = LTAalloc(1,NULL);
Expand Down Expand Up @@ -711,7 +713,22 @@ int main(int argc, char *argv[])
LTAprint(fo, lta);
fclose(fo);
}


if (do_sqrt)
{
MATRIX *m_L = lta->xforms[0].m_L, *m_V, *m_U ;
VECTOR *v_z ;

v_z = VectorAlloc(m_L->cols, MATRIX_REAL);
m_V = MatrixAlloc(m_L->rows, m_L->rows, MATRIX_REAL);
m_U = MatrixSVD(m_L, v_z, m_V);
MatrixPrint(stdout, m_L) ;
MatrixPrint(stdout, v_z) ;
MatrixPrint(stdout, m_V) ;
MatrixPrint(stdout, m_U) ;

}

if (P.fslout!="")
{
writeFSL(P.fslout,lta);
Expand Down Expand Up @@ -802,6 +819,11 @@ static int parseNextCommand(int argc, char *argv[], Parameters & P)
nargs = 1;
cout << "--s: " << P.subject << " subject name" << endl;
}
else if (!strcmp(option, "SQRT"))
{
do_sqrt = 1 ;
cout << "--sqrt: True " << endl;
}
else if (!strcmp(option, "INNIFTYREG"))
{
P.transin = string(argv[1]);
Expand Down

0 comments on commit 954724c

Please sign in to comment.