Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cluster
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
cluster
Commits
c8720e2e
Commit
c8720e2e
authored
19 years ago
by
Mark Jenkinson
Browse files
Options
Downloads
Patches
Plain Diff
Modified to use the new vox2mm functions
parent
7360f972
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cluster.cc
+3
-23
3 additions, 23 deletions
cluster.cc
with
3 additions
and
23 deletions
cluster.cc
+
3
−
23
View file @
c8720e2e
...
@@ -30,9 +30,6 @@ Option<bool> verbose(string("-v,--verbose"), false,
...
@@ -30,9 +30,6 @@ Option<bool> verbose(string("-v,--verbose"), false,
Option
<
bool
>
help
(
string
(
"-h,--help"
),
false
,
Option
<
bool
>
help
(
string
(
"-h,--help"
),
false
,
string
(
"display this message"
),
string
(
"display this message"
),
false
,
no_argument
);
false
,
no_argument
);
Option
<
bool
>
medxcoords
(
string
(
"-m,--medx"
),
false
,
string
(
"use MEDx coordinate conventions"
),
false
,
no_argument
);
Option
<
bool
>
mm
(
string
(
"--mm"
),
false
,
Option
<
bool
>
mm
(
string
(
"--mm"
),
false
,
string
(
"use mm, not voxel, coordinates"
),
string
(
"use mm, not voxel, coordinates"
),
false
,
no_argument
);
false
,
no_argument
);
...
@@ -123,15 +120,6 @@ void copyconvert(const vector<triple<T> >& oldcoords,
...
@@ -123,15 +120,6 @@ void copyconvert(const vector<triple<T> >& oldcoords,
}
}
template
<
class
T
,
class
S
>
void
medx2voxcoord
(
vector
<
triple
<
T
>
>&
coords
,
const
volume
<
S
>&
vol
)
{
int
ymax
=
vol
.
ysize
();
for
(
unsigned
int
n
=
0
;
n
<
coords
.
size
();
n
++
)
{
coords
[
n
].
y
=
(
T
)
(
ymax
-
1
)
-
coords
[
n
].
y
;
}
}
template
<
class
S
>
template
<
class
S
>
void
vox2mmcoord
(
vector
<
triple
<
float
>
>&
coords
,
void
vox2mmcoord
(
vector
<
triple
<
float
>
>&
coords
,
...
@@ -143,7 +131,7 @@ void vox2mmcoord(vector<triple<float> >& coords,
...
@@ -143,7 +131,7 @@ void vox2mmcoord(vector<triple<float> >& coords,
cc
(
1
)
=
coords
[
n
].
x
;
cc
(
1
)
=
coords
[
n
].
x
;
cc
(
2
)
=
coords
[
n
].
y
;
cc
(
2
)
=
coords
[
n
].
y
;
cc
(
3
)
=
coords
[
n
].
z
;
cc
(
3
)
=
coords
[
n
].
z
;
cc
=
vol
.
sfor
m_mat
()
*
cc
;
cc
=
vol
.
vox2m
m_mat
()
*
cc
;
coords
[
n
].
x
=
cc
(
1
);
coords
[
n
].
x
=
cc
(
1
);
coords
[
n
].
y
=
cc
(
2
);
coords
[
n
].
y
=
cc
(
2
);
coords
[
n
].
z
=
cc
(
3
);
coords
[
n
].
z
=
cc
(
3
);
...
@@ -157,7 +145,7 @@ void applyvoxelxfm(vector<triple<T> >& coords, const Matrix& mat,
...
@@ -157,7 +145,7 @@ void applyvoxelxfm(vector<triple<T> >& coords, const Matrix& mat,
const
volume
<
S
>&
source
,
const
volume
<
S
>&
dest
)
const
volume
<
S
>&
source
,
const
volume
<
S
>&
dest
)
{
{
Matrix
voxmat
;
Matrix
voxmat
;
voxmat
=
dest
.
sampling_mat
().
i
()
*
mat
*
source
.
sampling_mat
(
);
voxmat
=
Vox2VoxMatrix
(
mat
,
source
,
dest
);
ColumnVector
vec
(
4
);
ColumnVector
vec
(
4
);
for
(
unsigned
int
n
=
0
;
n
<
coords
.
size
();
n
++
)
{
for
(
unsigned
int
n
=
0
;
n
<
coords
.
size
();
n
++
)
{
vec
<<
coords
[
n
].
x
<<
coords
[
n
].
y
<<
coords
[
n
].
z
<<
1.0
;
vec
<<
coords
[
n
].
x
<<
coords
[
n
].
y
<<
coords
[
n
].
z
<<
1.0
;
...
@@ -306,15 +294,10 @@ void print_results(const vector<int>& idx,
...
@@ -306,15 +294,10 @@ void print_results(const vector<int>& idx,
applyvoxelxfm
(
fcog
,
trans
,
zvol
,
stdvol
);
applyvoxelxfm
(
fcog
,
trans
,
zvol
,
stdvol
);
if
(
!
copename
.
unset
())
applyvoxelxfm
(
fcopemaxpos
,
trans
,
zvol
,
stdvol
);
if
(
!
copename
.
unset
())
applyvoxelxfm
(
fcopemaxpos
,
trans
,
zvol
,
stdvol
);
}
}
if
(
medxcoords
.
value
()
&&
(
!
mm
.
value
())
)
{
medx2voxcoord
(
fmaxpos
,
zvol
);
medx2voxcoord
(
fcog
,
zvol
);
if
(
!
copename
.
unset
())
medx2voxcoord
(
fcopemaxpos
,
cope
);
}
if
(
mm
.
value
())
{
if
(
mm
.
value
())
{
if
(
!
transformname
.
unset
()
&&
!
stdvolname
.
unset
()
)
refvol
=
&
stdvol
;
if
(
!
transformname
.
unset
()
&&
!
stdvolname
.
unset
()
)
refvol
=
&
stdvol
;
if
(
verbose
.
value
())
{
if
(
verbose
.
value
())
{
cout
<<
"Using matrix : "
<<
endl
<<
refvol
->
sfor
m_mat
()
<<
endl
;
cout
<<
"Using matrix : "
<<
endl
<<
refvol
->
vox2m
m_mat
()
<<
endl
;
}
}
vox2mmcoord
(
fmaxpos
,
*
refvol
);
vox2mmcoord
(
fmaxpos
,
*
refvol
);
vox2mmcoord
(
fcog
,
*
refvol
);
vox2mmcoord
(
fcog
,
*
refvol
);
...
@@ -413,8 +396,6 @@ void print_results(const vector<int>& idx,
...
@@ -413,8 +396,6 @@ void print_results(const vector<int>& idx,
if
(
!
transformname
.
unset
()
&&
!
stdvolname
.
unset
()
)
if
(
!
transformname
.
unset
()
&&
!
stdvolname
.
unset
()
)
applyvoxelxfm
(
lmaxlistR
,
trans
,
zvol
,
stdvol
);
applyvoxelxfm
(
lmaxlistR
,
trans
,
zvol
,
stdvol
);
if
(
medxcoords
.
value
()
&&
(
!
mm
.
value
())
)
medx2voxcoord
(
lmaxlistR
,
zvol
);
if
(
mm
.
value
())
{
if
(
mm
.
value
())
{
vox2mmcoord
(
lmaxlistR
,
*
refvol
);
vox2mmcoord
(
lmaxlistR
,
*
refvol
);
}
}
...
@@ -584,7 +565,6 @@ int main(int argc,char *argv[])
...
@@ -584,7 +565,6 @@ int main(int argc,char *argv[])
options
.
add
(
dLh
);
options
.
add
(
dLh
);
options
.
add
(
fractional
);
options
.
add
(
fractional
);
options
.
add
(
numconnected
);
options
.
add
(
numconnected
);
options
.
add
(
medxcoords
);
options
.
add
(
mm
);
options
.
add
(
mm
);
options
.
add
(
minv
);
options
.
add
(
minv
);
options
.
add
(
no_table
);
options
.
add
(
no_table
);
...
...
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