Skip to content

Commit d063bfc

Browse files
authored
Standardize yml (#11)
* Standardize make.jl * Standardize yml * Add _typos * Use github url * Show k-space row sampling * Fix comment
1 parent 47c8c50 commit d063bfc

File tree

6 files changed

+57
-19
lines changed

6 files changed

+57
-19
lines changed

.github/workflows/Documentation.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: Documentation
22

33
on:
44
pull_request:
5+
paths-ignore:
6+
- 'README.md'
57
push:
8+
paths-ignore:
9+
- 'README.md'
610
branches:
711
- 'main'
812
- 'release-'
@@ -12,12 +16,12 @@ jobs:
1216
build:
1317
runs-on: ubuntu-latest
1418
steps:
15-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1620
- uses: julia-actions/setup-julia@latest
1721
with:
1822
version: '1'
19-
- name: Cache artifacts
20-
uses: actions/cache@v3
23+
- name: CacheArtifacts
24+
uses: actions/cache@v4
2125
env:
2226
cache-name: cache-artifacts
2327
with:
@@ -27,13 +31,13 @@ jobs:
2731
${{ runner.os }}-test-${{ env.cache-name }}-
2832
${{ runner.os }}-test-
2933
${{ runner.os }}-
30-
- name: Install dependencies
34+
- name: InstallDependencies
3135
run: |
3236
julia --project=docs/ -e '
33-
ENV["JULIA_PKG_SERVER"] = ""
34-
using Pkg
35-
Pkg.develop(PackageSpec(path=pwd()))
36-
Pkg.instantiate()'
37+
ENV["JULIA_PKG_SERVER"] = ""
38+
using Pkg
39+
Pkg.develop(PackageSpec(path=pwd()))
40+
Pkg.instantiate()'
3741
- name: BuildAndDeploy
3842
env:
3943
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#Authentication:-GITHUB_TOKEN

.github/workflows/SpellCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Spell Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typos-check:
7+
name: Spell Check with Typos
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions Repository
11+
uses: actions/checkout@v4
12+
- name: Check spelling
13+
uses: crate-ci/typos@master

.github/workflows/clean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout gh-pages branch
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515
with:
1616
ref: gh-pages
1717
- name: Delete preview and history + push changes

_typos.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[default]
2+
extend-ignore-identifiers-re = [
3+
"iy",
4+
"pn",
5+
]

docs/lit/mri/5-l-plus-s.jl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ please cite that paper.
2727
# Packages needed here.
2828

2929
## using Unitful: s
30-
using Plots; default(markerstrokecolor=:auto, label="")
30+
using Plots; cgrad, default(markerstrokecolor=:auto, label="")
3131
using MIRT: Afft, Asense, embed
3232
using MIRT: pogm_restart, poweriter
3333
using MIRTjim: jim, prompt
@@ -90,15 +90,16 @@ based on the
9090

9191
# ## Read data
9292
if !@isdefined(data)
93-
url = "https://web.eecs.umich.edu/~fessler/irt/reproduce/19/lin-19-edp/data/"
93+
#src url = "https://web.eecs.umich.edu/~fessler/irt/reproduce/19/lin-19-edp/data/"
94+
url = "https://github.com/JeffFessler/MIRTdata/raw/main/mri/lin-19-edp/"
9495
dataurl = url * "cardiac_perf_R8.mat"
9596
data = matread(Downloads.download(dataurl))
9697
xinfurl = url * "Xinf.mat"
9798
Xinf = matread(Downloads.download(xinfurl))["Xinf"]["perf"] # (128,128,40)
9899
end;
99100

100101
# Show converged image as a preview:
101-
jim(Xinf, L"\mathrm{Converged\ image\ } X_∞")
102+
pinf = jim(Xinf, L"\mathrm{Converged\ image\ sequence } X_∞")
102103

103104
# Organize k-space data:
104105
if !@isdefined(ydata0)
@@ -117,9 +118,22 @@ if !@isdefined(samp)
117118
end
118119
kx = -(nx÷2):(nx÷2-1)
119120
ky = -(ny÷2):(ny÷2-1)
120-
jim(kx, ky, samp, "Sampling patterns for $nt frames"; xlabel=L"k_x", ylabel=L"k_y")
121+
psamp = jim(kx, ky, samp, "Sampling patterns for $nt frames";
122+
xlabel=L"k_x", ylabel=L"k_y")
121123
end
122124

125+
#=
126+
Are all k-space rows are sampled in one of the 40 frames?
127+
Sadly no.
128+
The 10 blue rows shown below are never sampled.
129+
A better sampling pattern design
130+
could have avoided this issue.
131+
=#
132+
samp_sum = sum(samp, dims=3)
133+
color = cgrad([:blue, :black, :white], [0, 1/2nt, 1])
134+
pssum = jim(kx, ky, samp_sum; xlabel="kx", ylabel="ky",
135+
color, clim=(0,nt), title="Number of sampled frames out of $nt")
136+
123137
# Prepare coil sensitivity maps
124138
if !@isdefined(smaps)
125139
smaps_raw = data["b1"] # raw coil sensitivity maps
@@ -130,7 +144,7 @@ if !@isdefined(smaps)
130144
smaps = smaps_raw ./ ssos_raw
131145
ssos = ssos_fun(smaps)
132146
@assert all((1), ssos)
133-
jim(smaps, "Normalized |coil maps| for $nc coils")
147+
pmap = jim(smaps, "Normalized |coil maps| for $nc coils")
134148
end
135149

136150

@@ -156,7 +170,7 @@ because Xinf was reconstructed
156170
using this regularizer!
157171
=#
158172
tmp = TF * Xinf
159-
jim(tmp, "|Temporal FFT of Xinf|")
173+
ptfft = jim(tmp, "|Temporal FFT of Xinf|")
160174

161175

162176
#=
@@ -211,7 +225,7 @@ end
211225

212226
# Check scale factor of Xinf. (It should be ≈1.)
213227
tmp = A * Xinf
214-
scale = dot(tmp, ydata) / norm(tmp)^2 # 1.009 ≈ 1
228+
scale0 = dot(tmp, ydata) / norm(tmp)^2 # 1.009 ≈ 1
215229

216230
# Crude initial image
217231
L0 = A' * ydata # adjoint (zero-filled)
@@ -221,7 +235,7 @@ L0 = A' * ydata # adjoint (zero-filled)
221235
S0 = zeros(ComplexF32, nx, ny, nt)
222236
X0 = cat(L0, S0, dims=ndims(L0)+1) # (nx, ny, nt, 2) = (128, 128, 40, 2)
223237
M0 = AII * X0 # L0 + S0
224-
jim(M0, "|Initial L+S via zero-filled recon|")
238+
pm0 = jim(M0, "|Initial L+S via zero-filled recon|")
225239

226240

227241
#=

docs/make.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
execute = isempty(ARGS) || ARGS[1] == "run"
22

3-
org, reps = :JuliaImageRecon, "Examples"
3+
org, reps = :JuliaImageRecon, :Examples
4+
eval(:(using $reps))
45
import Documenter
56
import Literate
67

@@ -20,6 +21,7 @@ nbviewer_root_url =
2021
binder_root_url =
2122
"https://mybinder.org/v2/gh/$base/gh-pages?filepath=generated"
2223

24+
repo = eval(:($reps))
2325
# preprocessing
2426
inc1 = "include(\"../../inc/reproduce.jl\")"
2527

@@ -77,7 +79,6 @@ Documenter.makedocs(;
7779
authors = "Jeff Fessler and contributors",
7880
sitename = "Examples",
7981
format,
80-
strict = true, # fail on "warnings"
8182
pages = [
8283
"Home" => "index.md",
8384
"MRI" => pages("mri"),
@@ -92,6 +93,7 @@ if isci
9293
versions = nothing,
9394
forcepush = true,
9495
push_preview = true,
96+
# see https://$org.github.io/$repo.jl/previews/PR##
9597
)
9698
else
9799
@warn "may need to: rm -r src/generated/"

0 commit comments

Comments
 (0)