Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fdt
Commits
3019e26b
Commit
3019e26b
authored
17 years ago
by
Saad Jbabdi
Browse files
Options
Downloads
Patches
Plain Diff
added directory option
parent
41729d89
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ccops.cc
+24
-19
24 additions, 19 deletions
ccops.cc
ccopsOptions.h
+7
-2
7 additions, 2 deletions
ccopsOptions.h
with
31 additions
and
21 deletions
ccops.cc
+
24
−
19
View file @
3019e26b
...
@@ -395,6 +395,10 @@ int main ( int argc, char **argv ){
...
@@ -395,6 +395,10 @@ int main ( int argc, char **argv ){
ccopsOptions
&
opts
=
ccopsOptions
::
getInstance
();
ccopsOptions
&
opts
=
ccopsOptions
::
getInstance
();
int
success
=
opts
.
parse_command_line
(
argc
,
argv
);
int
success
=
opts
.
parse_command_line
(
argc
,
argv
);
if
(
!
success
)
return
1
;
if
(
!
success
)
return
1
;
if
(
opts
.
inmatrix
.
value
()
==
""
&&
opts
.
directory
.
value
()
==
""
){
cerr
<<
"Specify either input matrix or tractography directory"
<<
endl
;
return
1
;
}
string
ip
=
opts
.
inmatrix
.
value
();
string
ip
=
opts
.
inmatrix
.
value
();
make_basename
(
ip
);
make_basename
(
ip
);
...
@@ -403,8 +407,9 @@ int main ( int argc, char **argv ){
...
@@ -403,8 +407,9 @@ int main ( int argc, char **argv ){
volume
<
int
>
coordvol
;
volume
<
int
>
coordvol
;
volume
<
int
>
tractcoordvol
;
volume
<
int
>
tractcoordvol
;
bool
coordbool
=
false
,
tractcoordbool
=
false
;
bool
coordbool
=
false
,
tractcoordbool
=
false
;
read_volume
(
myOM
,
ip
);
// read_volume(myOM,ip);
read_volume
(
myOM
,
opts
.
directory
.
value
()
+
"/"
+
opts
.
inmatrix
.
value
());
Matrix
myOMmat
(
myOM
.
xsize
(),
myOM
.
ysize
());
Matrix
myOMmat
(
myOM
.
xsize
(),
myOM
.
ysize
());
Matrix
mycoordmat
,
mytractcoordmat
;
Matrix
mycoordmat
,
mytractcoordmat
;
Matrix
newOMmat
,
newcoordmat
,
newtractcoordmat
;
Matrix
newOMmat
,
newcoordmat
,
newtractcoordmat
;
...
@@ -426,7 +431,7 @@ int main ( int argc, char **argv ){
...
@@ -426,7 +431,7 @@ int main ( int argc, char **argv ){
// write_ascii_matrix(newOMmat.t(),"preprecock");
// write_ascii_matrix(newOMmat.t(),"preprecock");
//Checking for and loading up Seed Coordinates
//Checking for and loading up Seed Coordinates
string
coordname
=
"
coords_for_"
+
ip
;
string
coordname
=
opts
.
directory
.
value
()
+
"/
coords_for_"
+
ip
;
if
(
fsl_imageexists
(
coordname
)){
if
(
fsl_imageexists
(
coordname
)){
read_volume
(
coordvol
,
coordname
);
read_volume
(
coordvol
,
coordname
);
coordbool
=
true
;
coordbool
=
true
;
...
@@ -442,7 +447,7 @@ int main ( int argc, char **argv ){
...
@@ -442,7 +447,7 @@ int main ( int argc, char **argv ){
}
}
//Checking For and Loading Up Tract coordinates
//Checking For and Loading Up Tract coordinates
string
trcoordname
=
"
tract_space_coords_for_"
+
ip
;
string
trcoordname
=
opts
.
directory
.
value
()
+
"/
tract_space_coords_for_"
+
ip
;
if
(
fsl_imageexists
(
trcoordname
)){
if
(
fsl_imageexists
(
trcoordname
)){
read_volume
(
tractcoordvol
,
trcoordname
);
read_volume
(
tractcoordvol
,
trcoordname
);
tractcoordbool
=
true
;
tractcoordbool
=
true
;
...
@@ -467,7 +472,7 @@ int main ( int argc, char **argv ){
...
@@ -467,7 +472,7 @@ int main ( int argc, char **argv ){
if
(
opts
.
excl_mask
.
value
()
!=
""
){
if
(
opts
.
excl_mask
.
value
()
!=
""
){
volume
<
int
>
lookup_tract
;
volume
<
int
>
lookup_tract
;
volume
<
int
>
excl
;
volume
<
int
>
excl
;
read_volume
(
lookup_tract
,
"
lookup_tractspace_"
+
ip
);
read_volume
(
lookup_tract
,
opts
.
directory
.
value
()
+
"/
lookup_tractspace_"
+
ip
);
string
exname
=
opts
.
excl_mask
.
value
();
string
exname
=
opts
.
excl_mask
.
value
();
make_basename
(
exname
);
make_basename
(
exname
);
read_volume
(
excl
,
exname
);
read_volume
(
excl
,
exname
);
...
@@ -555,8 +560,8 @@ int main ( int argc, char **argv ){
...
@@ -555,8 +560,8 @@ int main ( int argc, char **argv ){
}
}
}
}
save_volume
(
outCCvol
,
"
CC_"
+
base
);
save_volume
(
outCCvol
,
opts
.
directory
.
value
()
+
"/
CC_"
+
base
);
save_volume
(
outcoords
,
"
coords_for_"
+
base
);
save_volume
(
outcoords
,
opts
.
directory
.
value
()
+
"/
coords_for_"
+
base
);
}
}
else
{
else
{
...
@@ -588,16 +593,16 @@ int main ( int argc, char **argv ){
...
@@ -588,16 +593,16 @@ int main ( int argc, char **argv ){
}
}
}
}
write_ascii_matrix
(
r1
,
base
+
"r1"
);
write_ascii_matrix
(
r1
,
opts
.
directory
.
value
()
+
"/"
+
base
+
"r1"
);
write_ascii_matrix
(
y1
,
base
+
"y1"
);
write_ascii_matrix
(
y1
,
opts
.
directory
.
value
()
+
"/"
+
base
+
"y1"
);
save_volume
(
outCCvol
,
"
reord_CC_"
+
base
);
save_volume
(
outCCvol
,
opts
.
directory
.
value
()
+
"/
reord_CC_"
+
base
);
save_volume
(
outcoords
,
"
coords_for_reord_"
+
base
);
save_volume
(
outcoords
,
opts
.
directory
.
value
()
+
"/
coords_for_reord_"
+
base
);
// save clustering if kmeans used
// save clustering if kmeans used
if
(
opts
.
scheme
.
value
()
==
"kmeans"
){
if
(
opts
.
scheme
.
value
()
==
"kmeans"
){
volume
<
int
>
mask
;
volume
<
int
>
mask
;
if
(
opts
.
mask
.
value
()
==
""
)
if
(
opts
.
mask
.
value
()
==
""
)
read_volume
(
mask
,
"
fdt_paths"
);
read_volume
(
mask
,
opts
.
directory
.
value
()
+
"/
fdt_paths"
);
else
else
read_volume
(
mask
,
opts
.
mask
.
value
());
read_volume
(
mask
,
opts
.
mask
.
value
());
mask
=
0
;
mask
=
0
;
...
@@ -606,11 +611,11 @@ int main ( int argc, char **argv ){
...
@@ -606,11 +611,11 @@ int main ( int argc, char **argv ){
outcoords
(
i
,
1
,
0
),
outcoords
(
i
,
1
,
0
),
outcoords
(
i
,
2
,
0
))
=
(
int
)
y1
(
i
+
1
)
+
1
;
outcoords
(
i
,
2
,
0
))
=
(
int
)
y1
(
i
+
1
)
+
1
;
}
}
save_volume
(
mask
,
"
reord_mask_"
+
base
);
save_volume
(
mask
,
opts
.
directory
.
value
()
+
"/
reord_mask_"
+
base
);
// save tractspace clustering if specified
// save tractspace clustering if specified
volume
<
int
>
outmask
,
tractmask
;
volume
<
int
>
outmask
,
tractmask
;
read_volume
(
tractmask
,
"
lookup_tractspace_fdt_matrix2"
);
read_volume
(
tractmask
,
opts
.
directory
.
value
()
+
"/
lookup_tractspace_fdt_matrix2"
);
outmask
=
tractmask
;
outmask
=
tractmask
;
copybasicproperties
(
tractmask
,
outmask
);
copybasicproperties
(
tractmask
,
outmask
);
...
@@ -628,7 +633,7 @@ int main ( int argc, char **argv ){
...
@@ -628,7 +633,7 @@ int main ( int argc, char **argv ){
vals
.
Maximum1
(
index
);
vals
.
Maximum1
(
index
);
outmask
(
x
,
y
,
z
)
=
(
int
)
y1
(
index
);
outmask
(
x
,
y
,
z
)
=
(
int
)
y1
(
index
);
}
}
save_volume
(
outmask
,
"
tract_clustering_"
+
base
);
save_volume
(
outmask
,
opts
.
directory
.
value
()
+
"/
tract_clustering_"
+
base
);
}
}
...
@@ -650,8 +655,8 @@ int main ( int argc, char **argv ){
...
@@ -650,8 +655,8 @@ int main ( int argc, char **argv ){
return
(
-
1
);
return
(
-
1
);
}
}
write_ascii_matrix
(
r2
,
base
+
"r2"
);
write_ascii_matrix
(
r2
,
opts
.
directory
.
value
()
+
"/"
+
base
+
"r2"
);
write_ascii_matrix
(
y2
,
base
+
"y2"
);
write_ascii_matrix
(
y2
,
opts
.
directory
.
value
()
+
"/"
+
base
+
"y2"
);
volume
<
int
>
outvol
(
newOMmat
.
Nrows
(),
newOMmat
.
Ncols
(),
1
);
volume
<
int
>
outvol
(
newOMmat
.
Nrows
(),
newOMmat
.
Ncols
(),
1
);
volume
<
int
>
outtractcoords
(
newtractcoordmat
.
Nrows
(),
3
,
1
);
volume
<
int
>
outtractcoords
(
newtractcoordmat
.
Nrows
(),
3
,
1
);
...
@@ -672,8 +677,8 @@ int main ( int argc, char **argv ){
...
@@ -672,8 +677,8 @@ int main ( int argc, char **argv ){
outtractcoords
(
i
,
2
,
0
)
=
(
int
)
newtractcoordmat
(
int
(
r2
(
i
+
1
)),
3
);
outtractcoords
(
i
,
2
,
0
)
=
(
int
)
newtractcoordmat
(
int
(
r2
(
i
+
1
)),
3
);
}
}
}
}
save_volume
(
outvol
,
"
reord_"
+
base
);
save_volume
(
outvol
,
opts
.
directory
.
value
()
+
"/
reord_"
+
base
);
save_volume
(
outtractcoords
,
"
tract_space_coords_for_reord_"
+
base
);
save_volume
(
outtractcoords
,
opts
.
directory
.
value
()
+
"/
tract_space_coords_for_reord_"
+
base
);
}
}
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
ccopsOptions.h
+
7
−
2
View file @
3019e26b
...
@@ -27,6 +27,7 @@ class ccopsOptions {
...
@@ -27,6 +27,7 @@ class ccopsOptions {
Option
<
bool
>
help
;
Option
<
bool
>
help
;
Option
<
string
>
inmatrix
;
Option
<
string
>
inmatrix
;
Option
<
string
>
basename
;
Option
<
string
>
basename
;
Option
<
string
>
directory
;
Option
<
string
>
excl_mask
;
Option
<
string
>
excl_mask
;
Option
<
bool
>
reord1
;
Option
<
bool
>
reord1
;
Option
<
bool
>
reord2
;
Option
<
bool
>
reord2
;
...
@@ -60,12 +61,15 @@ class ccopsOptions {
...
@@ -60,12 +61,15 @@ class ccopsOptions {
help
(
string
(
"-h,--help"
),
false
,
help
(
string
(
"-h,--help"
),
false
,
string
(
"display this message"
),
string
(
"display this message"
),
false
,
no_argument
),
false
,
no_argument
),
inmatrix
(
string
(
"-i,--in"
),
string
(
""
),
inmatrix
(
string
(
"-i,--in"
),
string
(
"
fdt_matrix2
"
),
string
(
"input matrix"
),
string
(
"input matrix"
),
tru
e
,
requires_argument
),
fals
e
,
requires_argument
),
basename
(
string
(
"-b,--basename"
),
string
(
""
),
basename
(
string
(
"-b,--basename"
),
string
(
""
),
string
(
"Output basename"
),
string
(
"Output basename"
),
true
,
requires_argument
),
true
,
requires_argument
),
directory
(
string
(
"-d,--dir"
),
string
(
""
),
string
(
"Tractography Results Directory"
),
false
,
requires_argument
),
excl_mask
(
string
(
"-x"
),
string
(
""
),
excl_mask
(
string
(
"-x"
),
string
(
""
),
string
(
"exclusion mask (in tract space johannes)"
),
string
(
"exclusion mask (in tract space johannes)"
),
false
,
requires_argument
),
false
,
requires_argument
),
...
@@ -101,6 +105,7 @@ class ccopsOptions {
...
@@ -101,6 +105,7 @@ class ccopsOptions {
options
.
add
(
help
);
options
.
add
(
help
);
options
.
add
(
inmatrix
);
options
.
add
(
inmatrix
);
options
.
add
(
basename
);
options
.
add
(
basename
);
options
.
add
(
directory
);
options
.
add
(
excl_mask
);
options
.
add
(
excl_mask
);
options
.
add
(
reord1
);
options
.
add
(
reord1
);
options
.
add
(
reord2
);
options
.
add
(
reord2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment