Skip to content

Commit

Permalink
fixed a bug introduced yesterday causing the resulting PLY mesh files…
Browse files Browse the repository at this point in the history
… to have the wrong magnification. Now the coordinates in the PLY files are scaled by the voxel width so that the resulting coordinates have inits of physical distance (instead of voxels). This was the behavior in earlier versions of VISFD before I introduced the bug. This fix should restore that behavior.
  • Loading branch information
jewettaij committed Jul 17, 2021
1 parent 18f8c5f commit 9992869
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ visfd

## Volumetric Image toolkit for Simple Feature Detection

This is a general C++ template library for 3D image processing
("[visfd.hpp](./lib/visfd/visfd.hpp)")
This is a C++ template library for general 3D image processing
("[visfd.hpp](./lib/visfd/visfd.hpp)"),
as well as reading & writing image files using the the MRC file format
("[mrc_simple.hpp](./lib/mrc_simple/mrc_simple.hpp)").
It is also a collection of stand-alone programs
Expand All @@ -26,14 +26,15 @@ Multiprocessor support is implemented using


## *Alternatives to VISFD*
Some of the features of VISFD are also available
from popular python libraries, including:
Comprehensive libraries for 3-D image processing in python can be found at
[scikit-image](https://scikit-image.org)
and
[scipy.ndimage](https://docs.scipy.org/doc/scipy/reference/ndimage.html).
*(MRC files can be read in python using the
*(MRC files can be read into python arrays using the
[mrcfile](https://mrcfile.readthedocs.io/en/latest/readme.html#basic-usage)
module.)*
module.)
But these python libraries currently lack some of VISFD's features for
detecting curve and surface geometry, and closed surface segmentation.


## programs included with this repository:
Expand Down
4 changes: 2 additions & 2 deletions bin/filter_mrc/filter_mrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ using namespace std;


string g_program_name("filter_mrc");
string g_version_string("0.29.3");
string g_date_string("2021-7-16");
string g_version_string("0.29.4");
string g_date_string("2021-7-17");



Expand Down
3 changes: 3 additions & 0 deletions bin/filter_mrc/handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,9 @@ HandleTV(const Settings &settings,
(xyz[1] < 0.0) || (image_size[1] < xyz[1]) ||
(xyz[2] < 0.0) || (image_size[2] < xyz[2]))
continue; // if not, ignore this point
for (int d = 0; d < 3; d++)
// We want to export coordinates in units of physical distance
xyz[d] *= voxel_width[d];
coords.push_back(xyz); // add it to the point cloud
// Note that eivects[0][] and aaaafDirection[] are both
// vectors that store the surface normal.
Expand Down
19 changes: 9 additions & 10 deletions doc/doc_filter_mrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,9 @@ These transforms have not been optimized for speed.
[difference-of-gaussians](#https://en.wikipedia.org/wiki/Difference_of_Gaussians)
filter to remove low frequencies from an image. To do that use the
[-dog a b](#-dog) argument, setting a=0, and setting b to
a distance which is similar to the size of the large objects
(or gradients) that you want removed from the image.*
a distance which is similar to a distance which is smaller than
the size of the large objects that you want removed from the image
(in physical distance units, not in voxels).*


### -erosion-gauss thickness
Expand Down Expand Up @@ -2031,15 +2032,13 @@ When *-dog* is used,
and
*b_x = b_y = b_z = b*

The "-dog" argument can be used to remove low frequencies from an image.
This is useful to get rid of slowly changing brightness gradients,
and to set the average image brightness to 0.
The "-dog" argument can be used to remove low frequencies from an image. *(This
is useful for removing slowly changing brightness gradients in the background.)*
To do that use the [-dog a b](#-dog) argument, setting *a=0*, and setting *b* to
a large distance which is similar to the features in the background that you
want removed (such as slowly changing brightness variations in the background),
or the size of the image.
*(Unless the "-w 1" argument is used, the a and b parameters are in units
of physical distance, not voxels.)*
a large number (such as the width of the image).

*(Note: Unless the "-w 1" argument is used, the a and b parameters
should both be expressed in units of physical distance, not voxels.)*


### LoG filters
Expand Down

0 comments on commit 9992869

Please sign in to comment.