Skip to content

Commit 81cf362

Browse files
Merge pull request #3 from divital-coder/main
Fixing Docs deployment, added API reference
2 parents e7d1d31 + ebeeaf3 commit 81cf362

File tree

6 files changed

+4
-143
lines changed

6 files changed

+4
-143
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
1111
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
1212
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
1313
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
14+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
15+
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
1416
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
1517
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
1618
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"

docs/make.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ makedocs(;
1717
"Get Started" => "manual/get_started.md",
1818
"Code" => "manual/code_example.md"
1919
],
20-
"Developers' documentation" => [
21-
"Image Registration" => "devs/image_registration.md"
22-
],
2320
"api" => "api.md"
2421
],
2522
)

docs/src/api.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Here goes information about integrating the MedImages API with your backend
2-
3-
````markdown
41
# API Reference
52

63
## Configuration

docs/src/devs/image_registration.md

Whitespace-only changes.

docs/src/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@ GitHubAnalytics.jl generates a variety of visualizations and reports:
116116
© 2025 Divyansh Goyal | GitHubAnalytics.jl Documentation
117117
</div>
118118
119-
</div>
119+
</div>
120+
````

docs/src/manual/get_started.md

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +0,0 @@
1-
## Image Orientation Guidelines
2-
3-
MedImages.jl is optimized for images in **LPS (Left-Posterior-Superior)** orientation for consistent processing and analysis. If your medical images are in a different orientation, we recommend converting them to LPS before using MedImages.jl.
4-
5-
### Quick Orientation Converter
6-
7-
To help you convert your images to LPS orientation, we provide a convenient script that handles both NIfTI files and DICOM series.
8-
9-
#### Setup Instructions
10-
11-
**Note:** Ensure you are not in a virtual environment and have Python 3 installed on your system.
12-
13-
##### For Windows and macOS
14-
```julia
15-
using Pkg
16-
Pkg.add("PyCall")
17-
Pkg.add("ArgParse")
18-
19-
using Downloads
20-
Downloads.download("https://gist.githubusercontent.com/divital-coder/6d2dc6868ee5f8427cf719f54213227d/raw/a3b50aa734c662e0a4e57be6e29f69fc22921d03/reorient_to_lps.jl", "./reorient_to_lps.jl")
21-
python_path = Sys.which("python")
22-
if isnothing(python_path)
23-
error("Python not found in PATH, please install python or add it to your PATH")
24-
else
25-
ENV["PYTHON"] = python_path
26-
end
27-
run(`pip install SimpleITK`)
28-
Pkg.build("PyCall")
29-
```
30-
31-
##### For Arch Linux
32-
```julia
33-
using Pkg
34-
Pkg.add("PyCall")
35-
Pkg.add("ArgParse")
36-
37-
using Downloads
38-
Downloads.download("https://gist.githubusercontent.com/divital-coder/6d2dc6868ee5f8427cf719f54213227d/raw/a3b50aa734c662e0a4e57be6e29f69fc22921d03/reorient_to_lps.jl", "./reorient_to_lps.jl")
39-
python_path = Sys.which("python")
40-
if isnothing(python_path)
41-
error("Python not found in PATH, please install python or add it to your PATH")
42-
else
43-
ENV["PYTHON"] = python_path
44-
end
45-
run(`yay -S python-simpleitk`)
46-
Pkg.build("PyCall")
47-
```
48-
49-
#### Usage Examples
50-
51-
##### Convert a NIfTI File
52-
```bash
53-
julia reorient_to_lps.jl input_image.nii.gz output_lps.nii.gz
54-
```
55-
56-
##### Convert a DICOM Series
57-
```bash
58-
julia reorient_to_lps.jl /path/to/dicom/folder/ output_lps.nii.gz
59-
```
60-
61-
##### Additional Options
62-
```bash
63-
# Enable verbose output
64-
julia reorient_to_lps.jl brain.nii.gz brain_lps.nii.gz --verbose
65-
66-
# Force overwrite existing files
67-
julia reorient_to_lps.jl brain.nii.gz brain_lps.nii.gz --force
68-
```
69-
70-
### Converting Back to DICOM Format
71-
72-
**Important:** The orientation converter outputs NIfTI files only. If you need your processed images back in DICOM format, you can use the [`ITKIOWrapper.jl`](https://github.com/JuliaHealth/ITKIOWrapper.jl) package for conversion.
73-
74-
#### Installing ITKIOWrapper.jl
75-
76-
```julia
77-
using Pkg
78-
Pkg.add("ITKIOWrapper")
79-
```
80-
81-
#### Converting NIfTI to DICOM Series
82-
83-
After processing your LPS-oriented NIfTI file with MedImages.jl, convert it back to DICOM:
84-
85-
```julia
86-
using ITKIOWrapper
87-
88-
# Convert processed NIfTI back to DICOM series
89-
# This creates a directory with DICOM files
90-
dicom_nifti_conversion("processed_lps_image.nii.gz", "./output_dicom_series", true)
91-
```
92-
93-
#### Complete Workflow Example
94-
95-
Here's a typical workflow for DICOM users:
96-
97-
```julia
98-
using MedImages, ITKIOWrapper
99-
100-
# 1. Convert original DICOM to LPS-oriented NIfTI (using the orientation script)
101-
# julia reorient_to_lps.jl /path/to/original/dicom/ lps_oriented.nii.gz
102-
103-
# 2. Process with MedImages.jl
104-
medimage = MedImages.load_image("lps_oriented.nii.gz")
105-
# ... perform your analysis and modifications ...
106-
107-
# 3. Save processed image (if modified)
108-
# save_image(modified_medimage, "processed_image.nii.gz")
109-
110-
# 4. Convert back to DICOM series if needed
111-
dicom_nifti_conversion("processed_image.nii.gz", "./final_dicom_series", true)
112-
```
113-
114-
#### Advanced DICOM Conversion Options
115-
116-
For more control over the DICOM output, you can also create images programmatically:
117-
118-
```julia
119-
using ITKIOWrapper
120-
121-
# Load your processed NIfTI image
122-
img = load_image("processed_lps_image.nii.gz")
123-
metadata = load_spatial_metadata(img)
124-
voxel_data = load_voxel_data(img, metadata)
125-
126-
# Save as DICOM series with full control
127-
save_image(voxel_data, metadata, "./custom_dicom_output", true)
128-
```
129-
130-
### Summary
131-
132-
1. **Input DICOM** → Convert to LPS NIfTI using the orientation script
133-
2. **Process** → Use MedImages.jl for analysis and modifications
134-
3. **Output DICOM** → Use ITKIOWrapper.jl to convert back to DICOM format
135-
136-
Once your images are in LPS orientation, you can use them seamlessly with MedImages.jl for optimal performance and compatibility, and easily convert between NIfTI and DICOM formats as needed for your workflow.

0 commit comments

Comments
 (0)