-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from hcmh/master
revision
- Loading branch information
Showing
52 changed files
with
459 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
10_noncart/heart/.gitignore → 07_phase_singularities/heart/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
reco_*/ | ||
reco/ | ||
data/* | ||
!data/unders.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
source ../../FONT.sh | ||
source opts.sh | ||
|
||
#first argument is both dir name and output name | ||
DIR="$1" | ||
cd ${DIR} | ||
|
||
Y=$(identify -format "%[fx:h]" ./r_mm_1.png) | ||
#set density. 72 means 1pt is 1 pxl | ||
DENSITY=$( echo 'scale=5; 72/192*'$Y | bc) | ||
FONTSIZE=$( echo 'scale=0; 192/6' | bc) | ||
SPACING=$( echo 'scale=0; '${Y}'/48' | bc) | ||
STRW=3 | ||
|
||
TMP=tmp | ||
mkdir ${TMP} || true | ||
cd $TMP | ||
|
||
scale_and_text() | ||
{ | ||
IF="$1" | ||
T="$2" | ||
OF="$3" | ||
convert ${IF} -stroke red -strokewidth ${STRW} -fill none -draw "translate ${circle_x},${circle_y} circle 0,0 ${circle_r},0" tmp.png | ||
convert tmp.png -density ${DENSITY} -pointsize ${FONTSIZE} -font ${FONT} label:"${T}" -gravity Center -append ${OF} | ||
rm tmp.png | ||
|
||
} | ||
|
||
|
||
scale_and_text "../r_mm_1.png" "1 map" 1m.png | ||
scale_and_text "../r_mm_2.png" "2 maps" 2m.png | ||
scale_and_text "../r_mm_1_phase.png" "1 map phase" phase.png | ||
|
||
scale_and_text ../r_mmu_2_map_0000.png "map #1" m0.png | ||
scale_and_text ../r_mmu_2_map_0001.png "map #2" m1.png | ||
montage -background white -alpha remove phase.png 1m.png 2m.png m0.png m1.png -tile 5x1 -geometry "1x1+${SPACING}+0<" tmp.png | ||
|
||
#remove whitespace around final image: | ||
convert tmp.png -density ${DENSITY} -units PixelsPerInch -crop +${SPACING}+0 +repage -crop -${SPACING}-0 +repage ../${DIR}.png | ||
|
||
cd .. | ||
rm -r ${TMP} | ||
cd .. |
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
10_noncart/heart/data/unders.hdr → 07_phase_singularities/heart/data/unders.hdr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Dimensions | ||
1 320 65 30 1 1 1 1 1 1 1 1 1 1 1 1 | ||
1 320 75 30 1 1 1 1 1 1 1 1 1 1 1 1 | ||
# Command | ||
transpose 0 1 data/tmp2 data/unders | ||
# Files | ||
>data/unders <data/tmp2 | ||
# Creator | ||
BART v0.4.01-62-gba56e21 | ||
BART v0.4.03 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
./0_prep.sh | ||
|
||
./1_reco_enlive.sh reco | ||
|
||
./2_create_figure.sh reco |
12 changes: 8 additions & 4 deletions
12
10_noncart/heart/opts.sh → 07_phase_singularities/heart/opts.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
ZOOM=3 | ||
DATA=data/grid | ||
REF=data/ref | ||
WMAX=0.4 | ||
WMAX=0.3 | ||
CFLCOMMON="-z$ZOOM -u$WMAX -FZ -x0 -y1" | ||
|
||
NEWTON=11 | ||
REDU=2 | ||
NEWTON=17 | ||
REDU=1.5 | ||
|
||
NLINV_OPTS="-a240 -b40 -i${NEWTON} -R${REDU} -S -f0.5 -pdata/psf" | ||
MAPS=2 | ||
COMP_MAPS=2 | ||
|
||
NSMPL=320 | ||
NSPK=65 | ||
OG=1.5 | ||
|
||
|
||
circle_r=$(( 12 * $ZOOM )) | ||
circle_x=$(( ( 176 - 163 ) * $ZOOM )) | ||
circle_y=$(( ( 176 - 45 ) * $ZOOM )) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
reco*/ | ||
data/* | ||
!data/single_slice.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
source ../../BART.sh | ||
|
||
if false; | ||
then | ||
cd data | ||
wget http://old.mridata.org/knees/fully_sampled/p3/e1/s1/P3.zip | ||
unzip P3.zip | ||
cd .. | ||
|
||
#extract single slice | ||
$BART fft -u -i 1 data/kspace data/tmp_fft | ||
$BART slice 0 160 data/tmp_fft data/single_slice | ||
fi | ||
|
||
$BART rss 8 data/single_slice data/tmp_rss | ||
$BART threshold -H 21 data/tmp_rss data/tmp_pat | ||
$BART pattern data/tmp_pat data/pat | ||
$BART fmac data/pat data/single_slice data/tmp_full | ||
#scale maximum to about 1 | ||
$BART scale 1e-8 data/tmp_full data/full | ||
|
||
|
||
rm data/tmp_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
source ../../BART.sh | ||
|
||
US=$1 | ||
|
||
SEED=20869 | ||
|
||
# VD-PD for total undersampling of $US: | ||
$BART poisson -Y320 -Z256 -y$US -z$US -v -V05 -s$SEED data/tmp_pat_${US} > /dev/null | ||
$BART pattern data/full data/s_${US} | ||
$BART fmac data/tmp_pat_${US} data/s_${US} data/pat_${US} | ||
rm data/tmp_pat_${US}.* | ||
|
||
#calculate undersampling | ||
$BART fmac -s 65535 data/s_${US} data/s_${US} data/ns_${US} | ||
$BART fmac -s 65535 data/pat_${US} data/pat_${US} data/npat_${US} | ||
ALL=$($BART show -f "%+f%+fi" data/ns_${US} | cut -f1 -d"." | cut -f2 -d"+") | ||
PAT=$($BART show -f "%+f%+fi" data/npat_${US} | cut -f1 -d"." | cut -f2 -d"+") | ||
rm data/ns_${US}.* data/npat_${US}.* data/s_${US}.* | ||
|
||
UNDERS=$(echo "scale=1;"$ALL"/"$PAT | bc -l) | ||
echo $UNDERS > data/undersampling_factor_${US}.txt | ||
|
||
source opts.sh | ||
US_NAME=$(GET_US $US) | ||
|
||
mv data/pat_${US}.cfl data/pat_${US_NAME}.cfl | ||
mv data/pat_${US}.hdr data/pat_${US_NAME}.hdr | ||
$BART fmac data/full data/pat_${US_NAME} data/unders_${US_NAME} | ||
|
||
# rss reco: | ||
mkdir -p reco_zerofill | ||
$BART fft -u -i 7 data/unders_${US_NAME} data/tmp_${US_NAME} | ||
$BART rss 8 data/tmp_${US_NAME} reco_zerofill/zf_${US_NAME} | ||
$CFL2PNG $CFLCOMMON reco_zerofill/zf_${US_NAME}{,.png} | ||
|
||
rm data/tmp_${US_NAME}.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
source ../../BART.sh | ||
source opts.sh | ||
|
||
set -euo pipefail | ||
# brace expand | ||
set -B | ||
|
||
out=$1 | ||
US=$(GET_US $2) | ||
|
||
DEBUG=4 | ||
MAPS=2 | ||
|
||
export OMP_NUM_THREADS=1 | ||
|
||
# regular | ||
{ time $BART nlinv -d$DEBUG -m$MAPS -U $NLINV_OPTS ${DATA}_${US} $out/r_mmu_${US}; } \ | ||
>$out/log_r_mmu_${US} 2>$out/timelog_r_mmu_${US} | ||
$CFL2PNG $CFLCOMMON $out/r_mmu_${US}{,} | ||
|
||
$BART nlinv -d$DEBUG -m$MAPS $NLINV_OPTS ${DATA}_${US} $out/r_mm_${US} >$out/log_r_mm_${US} | ||
$CFL2PNG $CFLCOMMON $out/r_mm_${US}{,} | ||
|
||
$BART nlinv -d$DEBUG -m1 $NLINV_OPTS ${DATA}_${US} $out/{r,s}_sm_${US} >$out/log_r_sm_${US} | ||
$CFL2PNG $CFLCOMMON $out/r_sm_${US}{,} | ||
$CFL2PNG -C Y $CFLCOMMON $out/r_sm_${US} $out/r_sm_phase_${US}.png |
Oops, something went wrong.