Skip to content

Commit

Permalink
Merge branch 'master' into mrview_gotovolume
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpietsch authored Dec 6, 2016
2 parents 119d6fb + 86501b4 commit 2c878d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions scripts/mathpershell → scripts/dwishellmath
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ concatenated in a 4-D image, where the 4th axis contains e.g. the per-shell
mean in order of increasing b-value.
USAGE:
$ mathpershell <in.mif> <operation> <out.mif>
$ dwishellmath <in.mif> <operation> <out.mif>
For example:
$ mathpershell dwi.mif mean dc.mif
$ dwishellmath dwi.mif mean dc.mif
will output the mean diffusion-weighted volume per shell.
AVAILABLE OPERATIONS:
Expand All @@ -21,12 +21,12 @@ HELP_PAGE
exit 1
fi

c=1
for b in `mrinfo $1 -shells`;
tmpfiles=""
for b in $(mrinfo "$1" -shells);
do
dwiextract -shell $b $1 - -quiet | mrmath -axis 3 - $2 tmp-$c.mif -force -quiet
((c++))
echo "Extracting $2 of the b=$b shell."
tmpfiles="$tmpfiles "$(dwiextract -shell $b "$1" - -quiet | mrmath -axis 3 - $2 - -quiet)
done
mrcat -axis 3 tmp-*.mif $3 -quiet
rm tmp-*.mif
mrcat -axis 3 $tmpfiles "$3" -quiet


2 changes: 1 addition & 1 deletion src/mesh/vox2mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ namespace MR
// Calculate the precise position of this vertex, based on the
// image intensities in the two relevant voxels
const float alpha = (threshold - in_vertex_values[vertex_indices[0]]) / (in_vertex_values[vertex_indices[1]] - in_vertex_values[vertex_indices[0]]);
const Vertex pos = vertex_positions[0].cast<default_type>() + ((1.0f - alpha) * (vertex_positions[1] - vertex_positions[0]).cast<default_type>());
const Vertex pos = vertex_positions[0].cast<default_type>() + (alpha * (vertex_positions[1] - vertex_positions[0]).cast<default_type>());
vertices.push_back (pos);
} else {
edge_to_output_vertex[edge_index] = existing_zero->second;
Expand Down

0 comments on commit 2c878d6

Please sign in to comment.