2020-03-18 16:42:14 +01:00
RAW_IMAGES_ROOT_PATH := $( shell echo ~/work/lipase/raw-images)
2020-03-31 18:57:36 +02:00
# pdflatex is called twice to ensure cross references are found
2020-03-18 16:26:32 +01:00
lipase.pdf : lipase .tex graphics
2020-03-31 18:57:36 +02:00
pdflatex lipase.tex; pdflatex lipase.tex
2020-03-18 16:26:32 +01:00
# command used to convert traps sequences in the visible into png with maximum contrast
TRAPS_VISIBLE_CONVERTER = convert -contrast-stretch 2%x1% -resize 25%
GENERATED_GRAPHICS = \
2022-03-08 18:32:20 +01:00
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000000_DM300_nofilter_vis_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000019_DM300_nofilter_vis_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000039_DM300_nofilter_vis_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000000_DM300_327-353_fluo_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000019_DM300_327-353_fluo_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000039_DM300_327-353_fluo_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000000_DM300_420-480_fluo_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000019_DM300_420-480_fluo_000.png \
graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_img_000000039_DM300_420-480_fluo_000.png \
2020-03-18 16:26:32 +01:00
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000000_DM300_nofilter_vis_000.png \
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000019_DM300_nofilter_vis_000.png \
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000039_DM300_nofilter_vis_000.png
.PHONY : graphics
graphics : $( GENERATED_GRAPHICS )
2022-03-08 18:32:20 +01:00
# creates a rule to list min and max of imanges in an info file for the given sequence
# creates a rule to convert tif images into png for the given sequence
# $1 : dir_path : eg soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1
# $2 : pos_dir : eg Pos0
# $3 : channel_suffix : eg 420-480_fluo_000
# $4 : min_value : the maximum pixel value for this channel (eg 631)
# $5 : max_value : the maximum pixel value for this channel (eg 1441)
# eg it will create graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_%.png from $(RAW_IMAGES_ROOT_PATH)/soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1/Pos0/%.tif
d e f i n e G E N E R A T E _ C H A N N E L _ I M A G E S _ C O N V E R S I O N _ R U L E
graphics/$(subst /,_,$(1))_$(2)_$(3).info :
convert $( RAW_IMAGES_ROOT_PATH) /$( 1) /$( 2) /*$( 3) .tif -format "%[filename] %[min] %[max]\n" info: 2>/dev/null > " $$ @ "
2020-03-18 16:26:32 +01:00
2022-03-08 18:32:20 +01:00
graphics/$(subst /,_,$(1))_$(2)_%$(3).png : $( RAW_IMAGES_ROOT_PATH ) /$( 1) /$( 2) /%$( 3) .tif graphics /$( subst /,_ ,$ ( 1) ) _ $( 2) _ $( 3) .info
convert -level $( 4) x$( 5) -resize 25% " $$ < " " $$ @ "
e n d e f
2020-03-18 16:26:32 +01:00
2022-03-08 18:32:20 +01:00
# creates a rule to convert tif images into png for the given sequence
# $1 : dir_path : eg soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1
# $2 : pos_dir : eg Pos0
# eg it will create graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_%.png from $(RAW_IMAGES_ROOT_PATH)/soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1/Pos0/%.tif
d e f i n e G E N E R A T E _ T R A P _ S E Q U E N C E _ I M A G E S _ C O N V E R S I O N _ R U L E
graphics/$(subst /,_,$(1))_$(2)_%.png : $( RAW_IMAGES_ROOT_PATH ) /$( 1) /$( 2) /%.tif
$( TRAPS_VISIBLE_CONVERTER) " $$ < " " $$ @ "
e n d e f
2020-03-18 16:26:32 +01:00
2022-03-08 18:32:20 +01:00
# manually worked out sensible min and max values from graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_nofilter_vis_000.info
SEQ_GGHL_RDGL_SGF55_VIS_MIN_VALUE = 13000
SEQ_GGHL_RDGL_SGF55_VIS_MAX_VALUE = 65535 # yes, the images are saturated!
$( eval $ ( call GENERATE_CHANNEL_IMAGES_CONVERSION_RULE ,soleil 2016/GGHL_rDGL_SGF 55_lambda_Em_cinsuite_ 1,Pos 0,nofilter_vis_ 000,$ ( SEQ_GGHL_RDGL_SGF 55_VIS_MIN_VALUE ) ,$ ( SEQ_GGHL_RDGL_SGF 55_VIS_MAX_VALUE ) ) )
# manually worked out sensible min and max values from graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_327-353_fluo_000.info
SEQ_GGHL_RDGL_SGF55_F340_MIN_VALUE = 631
SEQ_GGHL_RDGL_SGF55_F340_MAX_VALUE = 1441
$( eval $ ( call GENERATE_CHANNEL_IMAGES_CONVERSION_RULE ,soleil 2016/GGHL_rDGL_SGF 55_lambda_Em_cinsuite_ 1,Pos 0,327-353_fluo_ 000,$ ( SEQ_GGHL_RDGL_SGF 55_F 340_MIN_VALUE ) ,$ ( SEQ_GGHL_RDGL_SGF 55_F 340_MAX_VALUE ) ) )
# manually worked out sensible min and max values from graphics/soleil2016_GGHL_rDGL_SGF55_lambda_Em_cinsuite_1_Pos0_420-480_fluo_000.info
SEQ_GGHL_RDGL_SGF55_F450_MIN_VALUE = 700
SEQ_GGHL_RDGL_SGF55_F450_MAX_VALUE = 1800
$( eval $ ( call GENERATE_CHANNEL_IMAGES_CONVERSION_RULE ,soleil 2016/GGHL_rDGL_SGF 55_lambda_Em_cinsuite_ 1,Pos 0,420-480_fluo_ 000,$ ( SEQ_GGHL_RDGL_SGF 55_F 450_MIN_VALUE ) ,$ ( SEQ_GGHL_RDGL_SGF 55_F 450_MAX_VALUE ) ) )
$( eval $ ( call GENERATE_TRAP_SEQUENCE_IMAGES_CONVERSION_RULE ,res_soleil 2018/GGH /GGH_ 2018_cin 2_phiG_I_ 327_vis_ -40_ 1,Pos 0) )
2020-03-18 16:26:32 +01:00
.PHONY : clean
clean :
2022-03-08 18:32:20 +01:00
rm -f $( GENERATED_GRAPHICS) graphics/*.info
2020-03-18 16:26:32 +01:00
rm -f lipase.pdf lipase.aux lipase.fls lipase.log lipase.fdb_latexmk lipase.dvi;