Skip to content

Commit

Permalink
add Artifacts.toml directly in example
Browse files Browse the repository at this point in the history
  • Loading branch information
aTrotier committed Nov 8, 2024
1 parent 37c73f5 commit 1b098b0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
18 changes: 15 additions & 3 deletions docs/lit/examples/advanced_reco.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@ using LazyArtifacts # loading data
using SEQ_BRUKER_a_MP2RAGE_CS_360
using CairoMakie # plotting

artifact_data = """
[MP2RAGE_data]
git-tree-sha1 = "04cd4c29bb9e2aeb5384fbc70a9af0e1a37ca369"
lazy = true
[[MP2RAGE_data.download]]
sha256 = "1f1b703c79db66ba6ef620651eca431cb0319d87f1eafa53826cb11a93afe4a8"
url = "https://zenodo.org/records/14051522/files/data.tar.gz"
"""
# ## Download the datasets
artifact_toml = "../../../../Artifacts.toml"
_hash = artifact_hash("MP2RAGE_data", artifact_toml)

temp_artifact_toml = tempname()
open(temp_artifact_toml, "w") do file
write(file, artifact_data)
end
_hash = artifact_hash("MP2RAGE_data", temp_artifact_toml)
datadir = artifact_path(_hash)

@info "The test data is located at $datadir."

# If you want to perform your own reconstruction, you can change the following line in order to point to another a bruker dataset
Expand Down
19 changes: 16 additions & 3 deletions docs/lit/examples/simple_reco.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,22 @@ using SEQ_BRUKER_a_MP2RAGE_CS_360
using CairoMakie # plotting

# ## Download the datasets
artifact_toml = "../../../../Artifacts.toml"
_hash = artifact_hash("MP2RAGE_data", artifact_toml)

artifact_data = """
[MP2RAGE_data]
git-tree-sha1 = "04cd4c29bb9e2aeb5384fbc70a9af0e1a37ca369"
lazy = true
[[MP2RAGE_data.download]]
sha256 = "1f1b703c79db66ba6ef620651eca431cb0319d87f1eafa53826cb11a93afe4a8"
url = "https://zenodo.org/records/14051522/files/data.tar.gz"
"""

# Write the data to a temporary file
temp_artifact_toml = tempname()
open(temp_artifact_toml, "w") do file
write(file, artifact_data)
end
_hash = artifact_hash("MP2RAGE_data", temp_artifact_toml)
datadir = artifact_path(_hash)

@info "The test data is located at $datadir."
Expand Down

0 comments on commit 1b098b0

Please sign in to comment.