diff --git a/Project.toml b/Project.toml index fd44f44..be07537 100644 --- a/Project.toml +++ b/Project.toml @@ -18,7 +18,3 @@ julia = "1.6" [extensions] RomeoApp = ["MriResearchTools", "ArgParse"] - -[weakdeps] -ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" -MriResearchTools = "557dad86-b9bd-4533-8525-1a39684d020f" diff --git a/README.md b/README.md index 6276297..29dad33 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,27 @@ A compiled command line tool is available under [ROMEO](https://github.com/korbi ### Usage - command line +#### Option 1: Install as Julia Pkg App (Recommended for Julia 1.9+) + +```bash +julia -e 'using Pkg; Pkg.add("ROMEO", app=true)' +``` + +After installation, you can run ROMEO directly from the command line (make sure `~/.julia/bin` is in your PATH): + +```bash +$ romeo phase.nii -m mag.nii -t [2.1,4.2,6.3] -o results +``` + +See [App Installation Guide](docs/app_installation.md) for more details. + +#### Option 2: Using romeo.jl Script + Install Julia 1.9 or newer (https://julialang.org) Copy the file [romeo.jl](https://github.com/korbinian90/ROMEO.jl/blob/master/romeo.jl) from this repository to a convenient location. An alias for `romeo` as `julia /romeo.jl` might be useful. ```bash - $ julia /romeo.jl phase.nii -m mag.nii -t [2.1,4.2,6.3] -o results +$ julia /romeo.jl phase.nii -m mag.nii -t [2.1,4.2,6.3] -o results ``` On the first run, the dependencies will be installed automatically. diff --git a/bin/romeo b/bin/romeo new file mode 100755 index 0000000..8a2ea9c --- /dev/null +++ b/bin/romeo @@ -0,0 +1,13 @@ +#!/usr/bin/env julia + +# ROMEO command line entry point +# This script is the entry point for the ROMEO Pkg app + +# Load the extension dependencies first to trigger extension loading +import MriResearchTools +import ArgParse + +# Now load ROMEO which will load the RomeoApp extension +using ROMEO + +exit(unwrapping_main(ARGS)) diff --git a/docs/app_installation.md b/docs/app_installation.md new file mode 100644 index 0000000..5fdca33 --- /dev/null +++ b/docs/app_installation.md @@ -0,0 +1,63 @@ +# Installing ROMEO as a Julia App + +ROMEO can be installed as a Julia Pkg app, which provides convenient command-line access to the `unwrapping_main` function. + +## Installation + +### Using Julia 1.9 or later: + +```julia +using Pkg +Pkg.add("ROMEO", app=true) +``` + +Or from the Pkg REPL (press `]` in Julia): + +``` +pkg> app add ROMEO +``` + +This will install the `romeo` command-line tool to `~/.julia/bin/romeo`. Make sure `~/.julia/bin` is in your system PATH for easy access. + +## Usage + +After installation, you can run ROMEO from the command line: + +```bash +romeo --help +romeo --phase phase.nii.gz --magnitude mag.nii.gz --output unwrapped.nii.gz +``` + +## Updating + +To update the app: + +```julia +using Pkg +Pkg.update("ROMEO") +``` + +Or: + +``` +pkg> app update ROMEO +``` + +## Uninstallation + +To remove the app: + +```julia +using Pkg +Pkg.rm("ROMEO", app=true) +``` + +Or: + +``` +pkg> app rm ROMEO +``` + +## Alternative: Direct Script Usage + +If you prefer not to use the app installation, you can still use the provided `romeo.jl` script as described in the main README.