Skip to content

Commit

Permalink
Run example documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jhacsonmeza committed Dec 8, 2020
1 parent d6d0e6e commit 33d034b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,20 @@ The calibration process can be carried out with the following three snippets of

* `UScalib.py`: the calibration process is carried out here. For this, we need more than one dataset. With more than one dataset we can evaluate the reproducibility and assure a good quality of the calibration. As input we need the size of the ultrasound image in pixel, in addition to the `target_pose.npy` and `cross_point.npy` generated with the last two snippets of code. The output is a `report.txt` with the calibration reproducibility measured in 5 points of the ultrasound image (4 corners and center). Finally, a file `USparams.npz` with x and y scales factors of the ultrasound image and the transformation matrix from the ultrasound image {I} to the target {T} coordinate system.

In addition to the above, `target.py` contains different functions for target detection and pose estimations. Furthermore `calibration.py` contains the `Calibration` class which handles the calibration procedure. If your calibration was done with Matlab, you can use `create_calib_params.m` to edit calibration variables to be used correctly for target pose estimation.
In addition to the above, `target.py` contains different functions for target detection and pose estimations. Furthermore `calibration.py` contains the `Calibration` class which handles the calibration procedure. If your calibration was done with Matlab, you can use `create_calib_params.m` to edit calibration variables to be used correctly for target pose estimation.

## Usage example

Some important information for the calibration can be set in the `config.yaml` file. Here, the path of calibration dataset have to be specified. Also, we need to specify the folder name for the right images, left images, and US images that are supposed to be in the dataset path. Finally, the stereo calibration parameters file name and the ultrasound image size in pixels have to be set.

* Clone this repository: `git clone https://github.com/jhacsonmeza/US-Calibration.git`
* Download the calibration [dataset example](https://drive.google.com/drive/folders/1E0zDVzpZ2zJhMnnxYgoIrWsO7RwUDwSH?usp=sharing). Note that the current parameters in `config.yaml` are adapted to this dataset.
* Run `python ProbePose.py` for target/transducer pose estimation.
* `python PointSegment.py` to segment the cross-wire points manually.
* `python UScalib.py` for estimate the freehand ultrasound parameters.

In the following image, an example of the recosntructed coordinate systems involved in the calibration is shown.

<p align="center">
<img src="figures/coordinates_systems.png" alt="coor-sys" width="600px"/>
</p>
Binary file added figures/coordinates_systems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 33d034b

Please sign in to comment.