RAW_IMAGES_ROOT_PATH:=$(shell echo ~/work/lipase/raw-images) # pdflatex is called twice to ensure cross references are found lipase.pdf: lipase.tex graphics pdflatex lipase.tex; pdflatex lipase.tex # 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=\ 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 \ 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) # 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 define GENERATE_CHANNEL_IMAGES_CONVERSION_RULE graphics/$(subst /,_,$(1))_$(2)_$(3).info: convert $(RAW_IMAGES_ROOT_PATH)/$(1)/$(2)/*$(3).tif -format "%[filename] %[min] %[max]\n" info: 2>/dev/null > "$$@" 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% "$$<" "$$@" endef # 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 define GENERATE_TRAP_SEQUENCE_IMAGES_CONVERSION_RULE graphics/$(subst /,_,$(1))_$(2)_%.png : $(RAW_IMAGES_ROOT_PATH)/$(1)/$(2)/%.tif $(TRAPS_VISIBLE_CONVERTER) "$$<" "$$@" endef # 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,soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1,Pos0,nofilter_vis_000,$(SEQ_GGHL_RDGL_SGF55_VIS_MIN_VALUE),$(SEQ_GGHL_RDGL_SGF55_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,soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1,Pos0,327-353_fluo_000,$(SEQ_GGHL_RDGL_SGF55_F340_MIN_VALUE),$(SEQ_GGHL_RDGL_SGF55_F340_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,soleil2016/GGHL_rDGL_SGF55_lambda_Em_cinsuite_1,Pos0,420-480_fluo_000,$(SEQ_GGHL_RDGL_SGF55_F450_MIN_VALUE),$(SEQ_GGHL_RDGL_SGF55_F450_MAX_VALUE))) $(eval $(call GENERATE_TRAP_SEQUENCE_IMAGES_CONVERSION_RULE,res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1,Pos0)) .PHONY: clean clean: rm -f $(GENERATED_GRAPHICS) graphics/*.info rm -f lipase.pdf lipase.aux lipase.fls lipase.log lipase.fdb_latexmk lipase.dvi;