diff --git a/doc/02_0_Build_Your_Own_Systems.rst b/doc/02_0_Build_Your_Own_Systems.rst index c4b34ee..b1c8fce 100644 --- a/doc/02_0_Build_Your_Own_Systems.rst +++ b/doc/02_0_Build_Your_Own_Systems.rst @@ -17,6 +17,7 @@ Build Your Own Image Guided Surgery System 3. Get B.A.R.D. :: + git clone https://github.com/SciKit-Surgery/scikit-surgerybard.git or navigate to https://github.com/SciKit-Surgery/scikit-surgerybard @@ -24,29 +25,35 @@ and use the download button navigate to the scikit-surgerybard directory and run :: + pip install . You may need to add :: + pip install --user if you don't have administrative permissions. **Another method to get BARD and all its dependant packages is the following** :: + git clone https://github.com/SciKit-Surgery/scikit-surgerybard.git Change directory to the newly created `scikit-surgerybard` by :: + cd scikit-surgerybard Run the tox commands :: + tox If tox run successfully, For Mac and Linux, activate the virtual environment using command :: + source .tox/py36/bin/activate If all goes well the prompt should be preceded by (py36). @@ -54,6 +61,7 @@ If all goes well the prompt should be preceded by (py36). For Windows, activate the virtual environment using command :: + .tox\py36\Scripts\activate If all goes well the prompt should be preceded by (py36). diff --git a/doc/02_1_Calibrate_Your_Camera.rst b/doc/02_1_Calibrate_Your_Camera.rst index 01b8955..95b0f36 100644 --- a/doc/02_1_Calibrate_Your_Camera.rst +++ b/doc/02_1_Calibrate_Your_Camera.rst @@ -30,6 +30,7 @@ or write a script to make one. Take 5-20 pictures of chessboard using: :: + python bardVideoCalibration.py -c config/video_calib_chessboard.json Hit the 'c' key to capture an image. Press the 'q' key to quite the application. @@ -53,6 +54,7 @@ Use the '-s' option to specify a directory to save to, and the For example: :: + python bardVideoCalibration.py -c config/video_calib_chessboard.json -s tests/output -p myresults Then, each time the program recalibrates, the results will be saved to the 'tests/output' folder, with the filename prefix 'myresults'. diff --git a/doc/02_2_Tracking_With_AuRcoTags.rst b/doc/02_2_Tracking_With_AuRcoTags.rst index 4e4b42c..dd30c63 100644 --- a/doc/02_2_Tracking_With_AuRcoTags.rst +++ b/doc/02_2_Tracking_With_AuRcoTags.rst @@ -14,6 +14,7 @@ OpenCV. 1. Try running the following, and check that the USB camera can track the reference marker :: + python sksurgerybard.py --config config/example_config.json @@ -36,7 +37,8 @@ a registration to be performed once. Here we have glued the marker to the phanto so model2reference should not change. Now try running -:: +:: + python sksurgerybard.py --config config/reference_with_model.json Move the webcam so that the reference markers are visible, and you should see diff --git a/doc/02_3_Make_Your_Own_Pointer.rst b/doc/02_3_Make_Your_Own_Pointer.rst index 0266bb8..c914e4c 100644 --- a/doc/02_3_Make_Your_Own_Pointer.rst +++ b/doc/02_3_Make_Your_Own_Pointer.rst @@ -18,6 +18,7 @@ can be reliably located in both the model (e.g. CT scan) and patient (i.e. physi Within the data directory there are files based on a CT scan of the pelvis phantom. :: + ls data/PelvisPhantom CT_Fiduicial_Markers.txt FullPelvis.vtk @@ -36,6 +37,7 @@ pointer, using the "pointer" markers, a pen, some cardboard and some sort of adh Now run this: :: + python sksurgerybard.py --config config/pointer_markers.json Move the pointer around in front of the camera. You should be able to see that @@ -49,6 +51,7 @@ move either the pointer tip or the tracking system (webcam). When you have a directory of pointer matrices you can run this; :: + python bardPivotCalibration.py --help python bardPivotCalibration.py --input pointer_positions/bard_pointer_matrices @@ -63,6 +66,7 @@ less pointer poses. Now edit config/pointer_markers.json to include the the pointer_tag_to_tip transform, within the pointerData entry: :: + "pointerData": { "pointer_tag_file": "data/pointer.txt", "pointer_tag_to_tip": "data/pointer_tip.txt" @@ -70,6 +74,7 @@ Now edit config/pointer_markers.json to include the the pointer_tag_to_tip trans Now run; :: + python sksurgerybard.py --config config/pointer_markers.json When you place the pointer in front of the camera, you should now see an additional sphere diff --git a/doc/02_4_Register_And_Ovelay.rst b/doc/02_4_Register_And_Ovelay.rst index 502dd6e..0852bbf 100644 --- a/doc/02_4_Register_And_Ovelay.rst +++ b/doc/02_4_Register_And_Ovelay.rst @@ -10,12 +10,14 @@ Create a plain text-file containing the coordinates of the prostate phantom fidu Compute the registration of CT points in CT_Fiduicial_Markers.txt to your world points, run this; :: + python bardProcrustes.py -f world.txt -m data/PelvisPhantom/CT_Fiduicial_Markers.txt So here -f stands for "fixed" points, also called "target" points in the literature, and -m stands for "moving" points, also called "source" points in the literature. This will output a rotation, a translation, and Fiducial Registration Error. Cut and paste the rotation and translation into a CT_to_world.txt file as :: + R11 R12 R13 T1 R21 R22 R23 T2 R31 R31 R33 T3 @@ -25,6 +27,7 @@ and edit config/reference_with_model.json to use this file instead of data/id.tx Rerun BARD using this configuration file, using: :: + python sksurgerybard.py --config config/reference_with_model.json and see what happens.