Skip to content

Commit

Permalink
update template project for longitudinal/transversal study of 2d vect…
Browse files Browse the repository at this point in the history
…or fields
  • Loading branch information
pkestene committed Jan 30, 2017
1 parent d824abb commit af5fe4f
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 50 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ AC_CONFIG_FILES([
doc/templates/testXsmurf_scalar2d/parameters_mexican.tcl
doc/templates/testXsmurf_vector2d/parameters_gaussian.tcl
doc/templates/testXsmurf_vector2d/parameters_mexican.tcl
doc/templates/testXsmurf_vector2d_LT/parameters_gaussian.tcl
doc/templates/testXsmurf_vector2d_LT/parameters_mexican.tcl
doc/templates/testXsmurf_scalar3d/parameters_gaussian.tcl
doc/templates/testXsmurf_scalar3d/parameters_mexican.tcl
doc/templates/testXsmurf_vector3d/parameters_gaussian.tcl
Expand Down
9 changes: 3 additions & 6 deletions doc/templates/testXsmurf_vector2d_LT/README
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ type the following command:


DATA: 2D Fractional Brownian Vector Field
data are generated with the xsmurf command ibro2Dfield
inside the scr_gaussian.tcl script.

more information about this command:
help ibro2Dfield
data are generated with the python script compute_2dfBm_divfree.py
locate at ${XSMURF_TOP_SRC_DIR}/utils



To clean this directory:
rm -Rf bro* *.eps pf logFile *~
rm -Rf fBm* *.eps pf logFile *~
25 changes: 19 additions & 6 deletions doc/templates/testXsmurf_vector2d_LT/average_pf.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,28 @@ proc imStudy::average {{wave gaussian} {fitmin 2} {fitmax 4} } {
}
}


# list of identifier for a multi images study
set image_list {1 2 3 4}
# number of images
set numImages 2

# base name of pf files
set type xsm_fftw${useFftw}_nmaxsup${useNMaxSup}

# Which type of partition functions are we using ?
# gradient on maxima or gradient on lines ?
set pf_method_str "grad_max"
#set pf_method_str "grad_lines"

# suffix can be N (normal/regular) L (longitudinal) or T (transversal)
set pf_suffix {N}

# load partition function pre-computations
foreach iF $image_list {
pf load ::pf::1 pf/pf_${type}_brox${iF}_broy${iF}_${wave}
for {set i 0} {$i<$numImages} {incr i} {

set imaIdf1 fBm_vx$i
set imaIdf2 fBm_vy$i

set pf_filename pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wave}_${pf_method_str}_${pf_suffix}
pf load ::pf::1 $pf_filename
}

# compute partition function
Expand All @@ -41,7 +54,7 @@ proc imStudy::average {{wave gaussian} {fitmin 2} {fitmax 4} } {
pf Dh ::pf::1 $qmin $qmax

# graphical output
pf setcomments ::pf::1 "$type $wave fit : $fitmin $fitmax \n"
pf setcomments ::pf::1 "$type $wave fit : $fitmin $fitmax pf_type:$pf_suffix pf_method:$pf_method_str\n"
pf thdDisp ::pf::1 {Dh}

# sortie graphique des fn de parttion
Expand Down
56 changes: 37 additions & 19 deletions doc/templates/testXsmurf_vector2d_LT/scr_gaussian.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,29 @@ set theScr {

set logCmd dputs

# set a list of image identifiers (4 vector fields will be analyzed)
set image_list_x {brox1 brox2 brox3 brox4}
set image_list_y {broy1 broy2 broy3 broy4}
# set number of Images of this study
set numImages 2

set type xsm_fftw${useFftw}_nmaxsup${useNMaxSup}
dputs " wtmm $wavelet"

# loop over vector fields
foreach imaIdf1 $image_list_x imaIdf2 $image_list_y {
for {set i 0} {$i<$numImages} {incr i} {

set imaIdf1 fBm_vx$i
set imaIdf2 fBm_vy$i

logMsg "Vector field: $imaIdf1 $imaIdf2 "
# create data to be analyzed
# 2D Fractional Brownian vector field with default holder value
# defined in parameters_gaussian.tcl
ibro2Dfield ${imaIdf1} ${imaIdf2} $size -h $H
isave ${imaIdf1} ${baseDir}/${imaIdf1}
isave ${imaIdf2} ${baseDir}/${imaIdf2}

#ibro2Dfield ${imaIdf1} ${imaIdf2} $size -h $H
#isave ${imaIdf1} ${baseDir}/${imaIdf1}
#isave ${imaIdf2} ${baseDir}/${imaIdf2}
exec python compute_2dfBm_divfree.py -s $size -i $i
iload ${imaIdf1}.xsm ${imaIdf1}
iload ${imaIdf2}.xsm ${imaIdf2}

file mkdir ${baseDir}/${imaIdf1}_${imaIdf2}_${type}_max_${wavelet}

# main WTMM command
Expand Down Expand Up @@ -60,17 +65,26 @@ set theScr {
-boxratio 1 \
-ecut [list $b1 $b1 $b2 $b2] \
-nomsg


# pf method
set pf_method "Gradient max"
set pf_method_str "grad_max"
#set pf_method "Gradient lines"
#set pf_method_str "grad_lines"

# pre-computations (intermediate result) of the partition functions
file mkdir ${baseDir}/pf
if {[file exists ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}] == 0} {

# N is for normal / regular partition function computations
set pf_suffix {N}
set pf_filename ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_${pf_method_str}_${pf_suffix}
if {[file exists $pf_filename] == 0} {
dputs " Computing the pf..."

set zepf [pf create]
pf init $zepf $amin $noct $nvox $q_lst $size "Gradient max" {}
pf init $zepf $amin $noct $nvox $q_lst $size $pf_method {}
pf compute $zepf m
pf save $zepf ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}
pf save $zepf ${pf_filename}
pf destroy $zepf
dputs " ok."
} else {
Expand All @@ -88,14 +102,16 @@ set theScr {
-boxratio 1 \
-ecut [list $b1 $b1 $b2 $b2] \
-nomsg

if {[file exists ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_L] == 0} {

set pf_suffix L
set pf_filename ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_${pf_method_str}_${pf_suffix}
if {[file exists ${pf_filename}] == 0} {
dputs " Computing Longitudinal pf..."

set zepf [pf create]
pf init $zepf $amin $noct $nvox $q_lst $size "Gradient max" {}
pf init $zepf $amin $noct $nvox $q_lst $size $pf_method {}
pf compute $zepf m
pf save $zepf ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_L
pf save $zepf ${pf_filename}
pf destroy $zepf
dputs " ok."
} else {
Expand All @@ -110,13 +126,15 @@ set theScr {
-ecut [list $b1 $b1 $b2 $b2] \
-nomsg

if {[file exists ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_T] == 0} {
set pf_suffix T
set pf_filename ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_${pf_method_str}_${pf_suffix}
if {[file exists ${pf_filename}] == 0} {
dputs " Computing Longitudinal pf..."

set zepf [pf create]
pf init $zepf $amin $noct $nvox $q_lst $size "Gradient max" {}
pf init $zepf $amin $noct $nvox $q_lst $size $pf_method {}
pf compute $zepf m
pf save $zepf ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_T
pf save $zepf ${pf_filename}
pf destroy $zepf
dputs " ok."
} else {
Expand Down
56 changes: 37 additions & 19 deletions doc/templates/testXsmurf_vector2d_LT/scr_mexican.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,29 @@ set theScr {

set logCmd dputs

# set a list of image identifiers (4 vector fields will be analyzed)
set image_list_x {brox1 brox2 brox3 brox4}
set image_list_y {broy1 broy2 broy3 broy4}
# set number of Images of this study
set numImages 2

set type xsm_fftw${useFftw}_nmaxsup${useNMaxSup}
dputs " wtmm $wavelet"

# loop over vector fields
foreach imaIdf1 $image_list_x imaIdf2 $image_list_y {
for {set i 0} {$i<$numImages} {incr i} {

set imaIdf1 fBm_vx$i
set imaIdf2 fBm_vy$i

logMsg "Vector field: $imaIdf1 $imaIdf2 "
# create data to be analyzed
# 2D Fractional Brownian vector field with default holder value
# defined in parameters_mexican.tcl
ibro2Dfield ${imaIdf1} ${imaIdf2} $size -h $H
isave ${imaIdf1} ${baseDir}/${imaIdf1}
isave ${imaIdf2} ${baseDir}/${imaIdf2}

#ibro2Dfield ${imaIdf1} ${imaIdf2} $size -h $H
#isave ${imaIdf1} ${baseDir}/${imaIdf1}
#isave ${imaIdf2} ${baseDir}/${imaIdf2}
exec python compute_2dfBm_divfree.py -s $size -i $i
iload ${imaIdf1}.xsm ${imaIdf1}
iload ${imaIdf2}.xsm ${imaIdf2}

file mkdir ${baseDir}/${imaIdf1}_${imaIdf2}_${type}_max_${wavelet}

# main WTMM command
Expand Down Expand Up @@ -60,17 +65,26 @@ set theScr {
-boxratio 1 \
-ecut [list $b1 $b1 $b2 $b2] \
-nomsg


# pf method
set pf_method "Gradient max"
set pf_method_str "grad_max"
#set pf_method "Gradient lines"
#set pf_method_str "grad_lines"

# pre-computations (intermediate result) of the partition functions
file mkdir ${baseDir}/pf
if {[file exists ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}] == 0} {

# N is for normal / regular partition function computations
set pf_suffix {N}
set pf_filename ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_${pf_method_str}_${pf_suffix}
if {[file exists $pf_filename] == 0} {
dputs " Computing the pf..."

set zepf [pf create]
pf init $zepf $amin $noct $nvox $q_lst $size "Gradient max" {}
pf init $zepf $amin $noct $nvox $q_lst $size $pf_method {}
pf compute $zepf m
pf save $zepf ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}
pf save $zepf ${pf_filename}
pf destroy $zepf
dputs " ok."
} else {
Expand All @@ -88,14 +102,16 @@ set theScr {
-boxratio 1 \
-ecut [list $b1 $b1 $b2 $b2] \
-nomsg

if {[file exists ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_L] == 0} {

set pf_suffix L
set pf_filename ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_${pf_method_str}_${pf_suffix}
if {[file exists ${pf_filename}] == 0} {
dputs " Computing Longitudinal pf..."

set zepf [pf create]
pf init $zepf $amin $noct $nvox $q_lst $size "Gradient max" {}
pf init $zepf $amin $noct $nvox $q_lst $size $pf_method {}
pf compute $zepf m
pf save $zepf ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_L
pf save $zepf ${pf_filename}
pf destroy $zepf
dputs " ok."
} else {
Expand All @@ -110,13 +126,15 @@ set theScr {
-ecut [list $b1 $b1 $b2 $b2] \
-nomsg

if {[file exists ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_T] == 0} {
set pf_suffix T
set pf_filename ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_${pf_method_str}_${pf_suffix}
if {[file exists ${pf_filename}] == 0} {
dputs " Computing Longitudinal pf..."

set zepf [pf create]
pf init $zepf $amin $noct $nvox $q_lst $size "Gradient max" {}
pf init $zepf $amin $noct $nvox $q_lst $size $pf_method {}
pf compute $zepf m
pf save $zepf ${baseDir}/pf/pf_${type}_${imaIdf1}_${imaIdf2}_${wavelet}_T
pf save $zepf ${pf_filename}
pf destroy $zepf
dputs " ok."
} else {
Expand Down

0 comments on commit af5fe4f

Please sign in to comment.