Skip to content

Commit 7298208

Browse files
authored
Merge pull request #6 from rg2/devel
Development leading up to next release
2 parents dca7ba9 + 53b92da commit 7298208

13 files changed

+530
-88
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (APPLE)
2828
endif ()
2929

3030
# Version format is YYYY.MM.DD for a release and YYYY.MM.DD.1 for devel after the release
31-
project(xreg VERSION 2020.09.26.1)
31+
project(xreg VERSION 2020.12.13.0)
3232

3333
set (CMAKE_CXX_STANDARD "11" CACHE STRING "C++ Standard (needs at least 11)")
3434
mark_as_advanced(CMAKE_CXX_STANDARD)

README.md

Lines changed: 8 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Although the following capabilities currently only exist in an internal version
5151
## Building
5252
A standard CMake configure/generate process is used.
5353
It is recommended to generate Ninja build files for fast compilation.
54-
Example scripts for building all dependencies and the xReg repository are provided for [POSIX systems](example_build_script) (e.g. MacOS and Linux) and [Windows](example_build_script_win.cmd).
54+
Example scripts for building all dependencies and the xReg repository are provided for POSIX systems (e.g. MacOS and Linux) [here](example_build_script) and [here](example_build_script_2), and also for [Windows](example_build_script_win.cmd).
5555
The [docker](docker) directory demonstrates how Docker may be used to build the software.
5656

5757
### Dependencies
@@ -72,82 +72,13 @@ The [docker](docker) directory demonstrates how Docker may be used to build the
7272
* Included with MacOS
7373
* Optional: [ffmpeg](https://ffmpeg.org) is used for writing videos when it is found in the system path. The OpenCV video writer is used if ffmpeg is not available.
7474

75+
## Testing
76+
Functional testing is available in the form of a [python script](tests/wiki_cmds.py) that runs the commands found on the [wiki walkthrough](https://github.com/rg2/xreg/wiki#walkthrough).
77+
Results of the commands need to be examined by the user and determined to be successful or failures.
78+
All necessary data is downloaded automatically.
79+
When the appropriate visualization programs are available on the system, the script also automatically loads the output data for inspection.
80+
7581
## License and Attribution
7682
The software is available for use under the [MIT License](LICENSE).
7783

78-
If you have found this software useful in your work, we kindly ask that you cite the most appropriate references below:
79-
```
80-
Grupp, Robert B., et al. "Pose estimation of periacetabular osteotomy fragments with intraoperative X-ray navigation." IEEE Transactions on Biomedical Engineering 67.2 (2019): 441-452.
81-
----------------------------------------------------------------------
82-
@article{grupp2019pose,
83-
title={Pose estimation of periacetabular osteotomy fragments with intraoperative {X}-ray navigation},
84-
author={Grupp, Robert B and Hegeman, Rachel A and Murphy, Ryan J and Alexander, Clayton P and Otake, Yoshito and McArthur, Benjamin A and Armand, Mehran and Taylor, Russell H},
85-
journal={IEEE Transactions on Biomedical Engineering},
86-
volume={67},
87-
number={2},
88-
pages={441--452},
89-
year={2019},
90-
publisher={IEEE}
91-
}
92-
```
93-
```
94-
Grupp, Robert B., Mehran Armand, and Russell H. Taylor. "Patch-based image similarity for intraoperative 2D/3D pelvis registration during periacetabular osteotomy." OR 2.0 Context-Aware Operating Theaters, Computer Assisted Robotic Endoscopy, Clinical Image-Based Procedures, and Skin Image Analysis. Springer, Cham, 2018. 153-163.
95-
----------------------------------------------------------------------
96-
@incollection{grupp2018patch,
97-
title={Patch-based image similarity for intraoperative {2D}/{3D} pelvis registration during periacetabular osteotomy},
98-
author={Grupp, Robert B and Armand, Mehran and Taylor, Russell H},
99-
booktitle={OR 2.0 Context-Aware Operating Theaters, Computer Assisted Robotic Endoscopy, Clinical Image-Based Procedures, and Skin Image Analysis},
100-
pages={153--163},
101-
year={2018},
102-
publisher={Springer}
103-
}
104-
```
105-
```
106-
Grupp, Robert B., et al. "Automatic annotation of hip anatomy in fluoroscopy for robust and efficient 2D/3D registration." International Journal of Computer Assisted Radiology and Surgery (2020): 1-11.
107-
----------------------------------------------------------------------
108-
@article{grupp2020automatic,
109-
title={Automatic annotation of hip anatomy in fluoroscopy for robust and efficient {2D}/{3D} registration},
110-
author={Grupp, Robert B and Unberath, Mathias and Gao, Cong and Hegeman, Rachel A and Murphy, Ryan J and Alexander, Clayton P and Otake, Yoshito and McArthur, Benjamin A and Armand, Mehran and Taylor, Russell H},
111-
journal={International Journal of Computer Assisted Radiology and Surgery},
112-
pages={1--11},
113-
publisher={Springer}
114-
}
115-
```
116-
```
117-
Grupp, Robert, et al. "Fast and automatic periacetabular osteotomy fragment pose estimation using intraoperatively implanted fiducials and single-view fluoroscopy." Physics in Medicine & Biology (2020).
118-
----------------------------------------------------------------------
119-
@article{grupp2020fast,
120-
title={Fast and automatic periacetabular osteotomy fragment pose estimation using intraoperatively implanted fiducials and single-view fluoroscopy},
121-
author={Grupp, Robert and Murphy, Ryan and Hegeman, Rachel and Alexander, Clayton and Unberath, Mathias and Otake, Yoshito and McArthur, Benjamin and Armand, Mehran and Taylor, Russell H},
122-
journal={Physics in Medicine \& Biology},
123-
year={2020},
124-
publisher={IOP Publishing}
125-
}
126-
```
127-
```
128-
Grupp, R., et al. "Pelvis surface estimation from partial CT for computer-aided pelvic osteotomies." Orthopaedic Proceedings. Vol. 98. No. SUPP_5. The British Editorial Society of Bone & Joint Surgery, 2016.
129-
----------------------------------------------------------------------
130-
@inproceedings{grupp2016pelvis,
131-
title={Pelvis surface estimation from partial {CT} for computer-aided pelvic osteotomies},
132-
author={Grupp, R and Otake, Y and Murphy, R and Parvizi, J and Armand, M and Taylor, R},
133-
booktitle={Orthopaedic Proceedings},
134-
volume={98},
135-
number={SUPP\_5},
136-
pages={55--55},
137-
year={2016},
138-
organization={The British Editorial Society of Bone \& Joint Surgery}
139-
}
140-
```
141-
```
142-
Grupp, Robert B., et al. "Smooth extrapolation of unknown anatomy via statistical shape models." Medical Imaging 2015: Image-Guided Procedures, Robotic Interventions, and Modeling. Vol. 9415. International Society for Optics and Photonics, 2015.
143-
----------------------------------------------------------------------
144-
@inproceedings{grupp2015smooth,
145-
title={Smooth extrapolation of unknown anatomy via statistical shape models},
146-
author={Grupp, Robert B and Chiang, H and Otake, Yoshito and Murphy, Ryan J and Gordon, Chad R and Armand, Mehran and Taylor, Russell H},
147-
booktitle={Medical Imaging 2015: Image-Guided Procedures, Robotic Interventions, and Modeling},
148-
volume={9415},
149-
pages={941524},
150-
year={2015},
151-
organization={International Society for Optics and Photonics}
152-
}
153-
```
84+
If you have found this software useful in your work, we kindly ask that you cite the most appropriate references listed [here](https://github.com/rg2/xreg/wiki/Licensing-and-Attribution).

dist/build_all_docker.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# MIT License
2+
#
3+
# Copyright (c) 2020 Robert Grupp
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
import os.path
24+
import sys
25+
26+
import subprocess as sp
27+
28+
def build_dev_base(os_name, os_version, xreg_git_dir):
29+
sp.check_call('docker build -t xreg-dev-base-{0}-{1} --build-arg os_name={0} --build-arg os_version={1} -f {2}/docker/Dockerfile.{0}_dev_base {2}'.format(os_name, os_version, xreg_git_dir), shell=True)
30+
31+
def build_deps(os_name, os_version, xreg_git_dir):
32+
sp.check_call('docker build -t xreg-deps-{0}-{1} --build-arg os_name={0} --build-arg os_version={1} -f {2}/docker/Dockerfile.xreg-deps {2}'.format(os_name, os_version, xreg_git_dir), shell=True)
33+
34+
def build_xreg(os_name, os_version, xreg_git_dir):
35+
sp.check_call('docker build -t xreg-{0}-{1} --build-arg os_name={0} --build-arg os_version={1} -f {2}/docker/Dockerfile.xreg {2}'.format(os_name, os_version, xreg_git_dir), shell=True)
36+
37+
def build_xreg_dist(os_name, os_version, xreg_git_dir, xreg_dist_str):
38+
dist_img_name = 'xreg-dist-{0}-{1}'.format(os_name, os_version)
39+
40+
sp.check_call('docker build -t {4} --build-arg os_name={0} --build-arg os_version={1} --build-arg xreg_dist_str={3} -f {2}/docker/Dockerfile.xreg-dist-bin {2}'.format(os_name, os_version, xreg_git_dir, xreg_dist_str, dist_img_name), shell=True)
41+
42+
cont_id = sp.check_output('docker create {}'.format(dist_img_name), shell=True).decode().strip()
43+
44+
dist_file_name = '{}-{}-{}.tar.gz'.format(xreg_dist_str, os_name, os_version)
45+
46+
sp.check_output('docker cp {}:/{} .'.format(cont_id, dist_file_name), shell=True)
47+
48+
sp.check_call('docker rm {}'.format(cont_id), shell=True)
49+
50+
if __name__ == '__main__':
51+
if len(sys.argv) < 2:
52+
sys.stderr.write('Usage: {} <xreg src dir> [<xreg ver string>]\n'.format(os.path.basename(sys.argv[0])))
53+
sys.stderr.flush()
54+
sys.exit(1)
55+
56+
xreg_src_dir = sys.argv[1]
57+
58+
xreg_dist_prefix = 'xreg'
59+
60+
if len(sys.argv) > 2:
61+
xreg_dist_prefix = '{}-{}'.format(xreg_dist_prefix, sys.argv[2])
62+
63+
# os name --> list of os version
64+
configs_to_build = { 'ubuntu' : [ '16.04', '18.04', '20.04' ], 'centos' : [ '7' ] }
65+
66+
for os_name, os_versions in configs_to_build.items():
67+
for os_ver in os_versions:
68+
build_dev_base(os_name, os_ver, xreg_src_dir)
69+
build_deps(os_name, os_ver, xreg_src_dir)
70+
build_xreg(os_name, os_ver, xreg_src_dir)
71+
72+
build_xreg_dist(os_name, os_ver, xreg_src_dir, xreg_dist_prefix)
73+
74+

dist/dist_readme/README.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| xReg: Modeling and Registration Software for Surgery |
44
| |
55
| Executable Programs |
6-
| v2020.09.26.0 |
6+
| v2020.12.13.0 |
77
| |
88
| Robert Grupp (grupp@jhu.edu) |
99
+------------------------------------------------------+
@@ -40,7 +40,8 @@ This software is provided under the terms of the MIT license and a copy of the l
4040
found in the "LICENSE" file.
4141

4242
If you have found this software useful in your work, we kindly ask that you cite the most
43-
appropriate references below:
43+
appropriate references listed below. If you are unsure which work to cite, please see this wiki
44+
page for guidance: https://github.com/rg2/xreg/wiki/Licensing-and-Attribution.
4445

4546

4647
Grupp, Robert B., et al. "Pose estimation of periacetabular osteotomy fragments with intraoperative X-ray navigation." IEEE Transactions on Biomedical Engineering 67.2 (2019): 441-452.

dist/make_linux_dist.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
import glob
2828
import subprocess as sp
2929

30+
kDEBUG = False
31+
32+
def dbg_print(s):
33+
if kDEBUG:
34+
print(s)
35+
3036
def get_lib_deps(exe_path):
3137
ldd_lines = sp.check_output('ldd {}'.format(exe_path), shell=True).decode().splitlines()
3238

@@ -35,6 +41,9 @@ def get_lib_deps(exe_path):
3541
for l in ldd_lines:
3642
toks = l.split('=>')
3743
if len(toks) > 1:
44+
if toks[1].strip() == 'not found':
45+
raise ValueError('dep. not found for: {}'.format(toks[0].strip()))
46+
3847
lib_path = toks[1][:toks[1].find('(0x')].strip()
3948

4049
if lib_path:
@@ -63,11 +72,20 @@ def update_rpath(exe_path):
6372
xreg_exes = glob.glob('{}/bin/xreg-*'.format(xreg_install_prefix))
6473

6574
for exe in xreg_exes:
75+
dbg_print('copying exe: {}'.format(exe))
6676
shutil.copy(exe, dst_bin_path)
67-
77+
78+
dbg_print(' checking deps...')
6879
for dep_src_path in get_lib_deps(exe):
69-
if not os.path.exists('{}/{}'.format(dst_lib_path,os.path.basename(dep_src_path))):
80+
lib_name = os.path.basename(dep_src_path)
81+
82+
dbg_print(' {}'.format(lib_name))
83+
if not os.path.exists('{}/{}'.format(dst_lib_path, lib_name)):
84+
dbg_print(' copying...')
7085
shutil.copy(dep_src_path, dst_lib_path)
86+
87+
update_rpath('{}/{}'.format(dst_lib_path, lib_name))
7188

89+
dbg_print(' updating RPATH...')
7290
update_rpath('{}/{}'.format(dst_bin_path, os.path.basename(exe)))
7391

0 commit comments

Comments
 (0)