Skip to content

Commit 6299db1

Browse files
committed
WIP: ENH: Migrate from RST to Myst Markdown
1 parent 50514d9 commit 6299db1

File tree

996 files changed

+21862
-22191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

996 files changed

+21862
-22191
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ if(BUILD_DOCUMENTATION)
240240
add_custom_target(copy_sources ALL
241241
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKSphinxExamples_SOURCE_DIR}/src" "${ITKSphinxExamples_BINARY_DIR}/src"
242242
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKSphinxExamples_SOURCE_DIR}/Documentation" "${ITKSphinxExamples_BINARY_DIR}/Documentation"
243-
COMMAND ${CMAKE_COMMAND} -E copy "${ITKSphinxExamples_SOURCE_DIR}/index.rst" "${ITKSphinxExamples_BINARY_DIR}/index.rst"
243+
COMMAND ${CMAKE_COMMAND} -E copy "${ITKSphinxExamples_SOURCE_DIR}/index.md" "${ITKSphinxExamples_BINARY_DIR}/index.md"
244244
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKSphinxExamples_SOURCE_DIR}/Formatting"
245245
"${ITKSphinxExamples_BINARY_DIR}/Formatting"
246246
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKSphinxExamples_SOURCE_DIR}/Utilities"

Documentation/Build/index.md

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
# Build, Run, Visualize
2+
3+
(run-python-examples)=
4+
5+
The Python examples do not need to be built. First, install Python from
6+
[python.org](https://www.python.org/), [Anaconda](https://www.anaconda.com/distribution), or a system package manager like
7+
Ubuntu Linux [apt](https://help.ubuntu.com/lts/serverguide/apt.html)
8+
or macOS [Homebrew](https://brew.sh/).
9+
10+
Next, install the *itk* package:
11+
12+
```
13+
python -m pip install --upgrade pip
14+
python -m pip install itk
15+
```
16+
17+
:::{figure} DownloadExampleHighlighted.png
18+
:align: center
19+
:alt: Download an example
20+
21+
Download [an example](https://itk.org/ITKExamples/src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/Documentation.html)
22+
by clicking the *Download* button.
23+
:::
24+
25+
Download the *\<ExampleName>.zip* file from the link on the top
26+
of an example's webpage. Unpack the example. For example,
27+
28+
```
29+
unzip ExampleName.zip
30+
```
31+
32+
Finally, run the example:
33+
34+
```
35+
python ExampleName/Code.py
36+
```
37+
38+
(build-individual-examples)=
39+
40+
## Build individual examples
41+
42+
Download the *\<ExampleName>.zip* file from the link on the top
43+
of the example's webpage. Unpack the example:
44+
45+
```
46+
unzip ExampleName.zip
47+
```
48+
49+
Set convenience variables:
50+
51+
```
52+
ITK_SOURCE=ExampleName
53+
ITK_BUILD=ExampleName/build
54+
```
55+
56+
Move to the build directory:
57+
58+
```
59+
cd ${ITK_BUILD}
60+
```
61+
62+
Run CMake (minimum version 3.10.2) to configure the project.
63+
64+
- If ITK Version 5.0.0 or above not installed but compiled on your
65+
system, you will need to specify the path to your ITK build:
66+
67+
```
68+
cmake -DITK_DIR=/home/luis/itk_build -S ${ITK_SOURCE} -B ${ITK_BUILD}
69+
```
70+
71+
Build the project, and run the test:
72+
73+
```
74+
cmake --build .
75+
ctest -V
76+
```
77+
78+
(building-examples)=
79+
80+
## Build all examples and the documentation
81+
82+
Set convenience variables:
83+
84+
```
85+
ITK_SOURCE=ITKEx
86+
ITK_BUILD=ITKEx-build
87+
```
88+
89+
Clone the repository:
90+
91+
```
92+
git clone --recursive https://github.com/InsightSoftwareConsortium/ITKSphinxExamples.git ${ITK_SOURCE}
93+
```
94+
95+
Make a build directory:
96+
97+
```
98+
mkdir -p ${ITK_BUILD}
99+
cd ${ITK_BUILD}
100+
```
101+
102+
Run CMake (minimum version 3.10.2) to configure the project.
103+
104+
- If ITK is not installed nor compiled, you can then make use of the superbuild functionality:
105+
106+
```
107+
cmake -DBUILD_DOCUMENTATION:BOOL=ON -S ${ITK_SOURCE}/Superbuild/ -B ${ITK_BUILD}
108+
```
109+
110+
- If ITK (Version 5.0.0 or above) is installed:
111+
112+
```
113+
cmake -DBUILD_DOCUMENTATION:BOOL=ON -S ${ITK_SOURCE} -B ${ITK_BUILD}
114+
```
115+
116+
- If ITK (Version 5.0.0 or above) is not installed but compiled on your
117+
system, you will need to specify the path to your ITK build:
118+
119+
```
120+
ITK_COMPILED_DIR=/usr/opt/itk_build
121+
cmake -DITK_DIR=${ITK_COMPILED_DIR} -DBUILD_DOCUMENTATION:BOOL=ON -S ${ITK_SOURCE_DIR} -B ${ITK_BUILD_DIR}
122+
```
123+
124+
The superbuild will download and build all required dependencies. If you are
125+
building the documentation and not using superbuild functionality, then you must
126+
have all the required dependencies installed, which are listed in the
127+
*README.rst* file located at the root of the source tree. If you just want to
128+
build the examples and not their documentation, set *BUILD_DOCUMENTATION* to
129+
*OFF* in your CMake configuration.
130+
131+
Build the project (this will generate the documentation and all examples):
132+
133+
```
134+
cmake --build .
135+
```
136+
137+
Run the tests with a superbuild:
138+
139+
```
140+
cd ${ITK_BUILD_DIR}/ITKEX-build
141+
ctest -V
142+
```
143+
144+
Run the tests without a superbuild:
145+
146+
```
147+
cd ${ITK_BUILD_DIR}
148+
ctest -V
149+
```
150+
151+
## Run an example
152+
153+
After building the examples, you can run an example by using `cd` to move to
154+
the example's directory. Then, directly run the executable.
155+
156+
Alternatively, the `ctest` command line program that comes with [CMake] can be
157+
used to drive the examples as unit test. Running:
158+
159+
```
160+
ctest
161+
```
162+
163+
in the binary tree will run all unit tests found in the current directory and
164+
below.
165+
166+
```
167+
ctest -R Binary
168+
```
169+
170+
will run all tests whose name matches the regular expression *Binary*.
171+
172+
```
173+
ctest -V
174+
```
175+
176+
will run *ctest* in verbose mode, which prints out the command executed and all
177+
of the resulting text output.
178+
179+
(visualize)=
180+
181+
## Visualize the results
182+
183+
ITK is a library limited in scope to image analysis, and it purposely does not
184+
attempt to perform image visualization. Visualizing the results of analysis is
185+
possible with a number of third-party applications. Note that these packages
186+
are specially suited for medical images, which often have anisotropic spacing
187+
and can span three or more dimensions. All applications listed are open source
188+
and cross-platform.
189+
190+
3DSlicer
191+
192+
: [3DSlicer] is an open-source software platform for the analysis and
193+
visualization of medical images and for research in image guided therapy.
194+
The platform provides functionality for segmentation, registration and
195+
three-dimensional visualization of multi-modal image data, as well as advanced
196+
image analysis algorithms for diffusion tensor imaging, functional magnetic
197+
resonance imaging and image-guided therapy. Standard image file formats are
198+
supported, and the application integrates interface capabilities to biomedical
199+
research software and image informatics frameworks.
200+
201+
:::{figure} Slicer.png
202+
:align: center
203+
:alt: 3DSlicer
204+
205+
[3DSlicer]
206+
:::
207+
208+
ImageViewer
209+
210+
: An [FLTK]-based [ImageViewer] was extracted from the [ITKApps] repository. This
211+
simple yet effective slice-based viewer works on 2D and 3D images and supports
212+
probing of data values.
213+
214+
:::{figure} ImageViewer.png
215+
:align: center
216+
:alt: ITKApps ImageViewer
217+
218+
ImageViewer
219+
:::
220+
221+
ITK-SNAP
222+
223+
: [ITK-SNAP] is segmentation application, but it is also a nice general
224+
resource for visualization of the results of analysis.
225+
226+
:::{figure} ITK-SNAP.png
227+
:align: center
228+
:alt: ITK-SNAP
229+
230+
[ITK-SNAP]
231+
:::
232+
233+
MITK
234+
235+
: [MITK] is a free open-source software system for development of interactive
236+
medical image processing software.
237+
238+
:::{figure} MITK.png
239+
:align: center
240+
:alt: MITK
241+
242+
[MITK]
243+
:::
244+
245+
Paraview
246+
247+
: [Paraview] is a full-featured scientific visualizion GUI written with [Qt]/[VTK].
248+
It has extensive parallel processing capabilities.
249+
250+
:::{figure} Paraview.png
251+
:align: center
252+
:alt: Paraview
253+
254+
[Paraview]
255+
:::
256+
257+
VV
258+
259+
: [VV] is an image viewer designed for fast and simple visualization of
260+
spatio-temporal images: 2D, 2D+t, 3D and 3D+t (or 4D) images.
261+
262+
:::{figure} VV.png
263+
:align: center
264+
:alt: VV
265+
266+
[VV]
267+
:::
268+
269+
[3dslicer]: https://www.slicer.org/
270+
[cmake]: https://cmake.org/
271+
[fltk]: https://www.fltk.org/index.php
272+
[imageviewer]: https://github.com/KitwareMedical/ImageViewer
273+
[itk-snap]: http://www.itksnap.org/pmwiki/pmwiki.php
274+
[itkapps]: https://github.com/InsightSoftwareConsortium/ITKApps
275+
[mitk]: https://www.mitk.org/wiki/MITK
276+
[paraview]: https://www.paraview.org/
277+
[qt]: https://www.qt.io/developers/
278+
[vtk]: https://vtk.org/
279+
[vv]: https://www.creatis.insa-lyon.fr/rio/vv

0 commit comments

Comments
 (0)