2019-10-04 11:36:53 +02:00
SHELL := /bin/bash
FIJI_ROOT_PATH := ~/soft/Fiji.app
FIJI_EXE_PATH = $( FIJI_ROOT_PATH) /ImageJ-linux64
# RAW_IMAGES_ROOT_PATH:='/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images'
RAW_IMAGES_ROOT_PATH := $( shell echo ~/work/lipase/raw-images)
LIB_SRC_FILES = $( shell find ./src/lipase -name "*.py" )
2019-10-08 17:52:30 +02:00
PLUGINS_SRC_FILES = $( shell find ./src/ij-plugins -name "*.py" )
2020-03-27 16:49:21 +01:00
LIPASE_VERSION = 1.01
2019-10-04 18:48:35 +02:00
BUILD_ROOT_PATH = $( shell pwd ) /build
PACKAGE_FILE_PATH = $( shell pwd ) /lipase-$( LIPASE_VERSION) .zip
2019-03-07 10:32:23 +01:00
2019-10-04 11:36:53 +02:00
.PHONY : all
2020-02-14 18:27:30 +01:00
all : test doc
2020-03-18 16:26:32 +01:00
.PHONY : doc
doc :
cd doc; make
2020-02-14 18:27:30 +01:00
2020-03-18 16:26:32 +01:00
.PHONY : clean_doc
2020-02-14 18:27:30 +01:00
clean_doc :
2020-03-18 16:26:32 +01:00
cd doc; make clean
2020-02-14 18:27:30 +01:00
2019-03-07 10:56:01 +01:00
2019-10-04 18:48:35 +02:00
$(BUILD_ROOT_PATH)/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar : $( LIB_SRC_FILES )
2019-10-04 11:36:53 +02:00
pushd ./src; \
2019-10-04 18:48:35 +02:00
mkdir -p $( BUILD_ROOT_PATH) /jars/Lib ; \
2019-10-04 11:36:53 +02:00
find ./lipase -name "*.py" > /tmp/files.txt ; \
2019-10-04 18:48:35 +02:00
jar cvf $( BUILD_ROOT_PATH) /jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar @/tmp/files.txt ; \
2019-10-04 11:36:53 +02:00
popd
2019-10-04 12:11:15 +02:00
.PHONY : install_ij_opencv
2020-03-18 16:26:32 +01:00
install_ij_opencv :
2019-10-04 12:11:15 +02:00
# enable IJ-OpenCV-plugins site because it's disabled by default
# graffy@graffy-ws2:~$ zcat /home/graffy/soft/Fiji.app/db.xml.gz | grep IJ-Op | grep -v "jar" | grep -v "<plu"
# <disabled-update-site name="IJ-OpenCV-plugins" url="https://sites.imagej.net/IJ-OpenCV/" official="true" description="Collection of plugins created using the IJ-OpenCV library -- a library that allows the connection of ImageJ and OpenCV." timestamp="20190819101544"/>
# graffy@graffy-ws2:~$ history | less
# graffy@graffy-ws2:~$ ~/soft/Fiji.app/ImageJ-linux64 --update edit-update-site IJ-OpenCV-plugins https://sites.imagej.net/IJ-OpenCV/
# Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
# Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
# Done: Checksummer
# graffy@graffy-ws2:~$ zcat /home/graffy/soft/Fiji.app/db.xml.gz | grep IJ-Op | grep -v "jar" | grep -v "<plu"
# <update-site name="IJ-OpenCV-plugins" url="https://sites.imagej.net/IJ-OpenCV/" official="true" description="Collection of plugins created using the IJ-OpenCV library -- a library that allows the connection of ImageJ and OpenCV." timestamp="20190819101544"/>
# $FIJI_ROOT_PATH/ImageJ-linux64 --update edit-update-site IJ-OpenCV-plugins https://sites.imagej.net/IJ-OpenCV/
# then apply an update to download and install IJ-OpenCV-plugins :
# jars/IJ-OpenCV.jar
# jars/javacv.far
# jars/opencv-linux-x86.jar
# jars/opencv-linux-x86_64.jar
# jars/opencv-macosx-x86_64.jar
# jars/opencv-windows-x86.jar
# jars/opencv-windows-x86_64.jar
# jars/opencv.jar
# lib/haarcascade_frontalface_alt.xml
# graffy@graffy-ws2:~$ ~/soft/Fiji.app/ImageJ-linux64 --update update
# Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
# Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
# Done: Checksummer
# Done: Downloading...
# Done: Downloading...
# $FIJI_ROOT_PATH/ImageJ-linux64 --update update
ls $( FIJI_ROOT_PATH) /jars/IJ-OpenCV-*.jar ; \
if [ $$ ? != 0 ] ; \
then \
$( FIJI_ROOT_PATH) /ImageJ-linux64 --update edit-update-site IJ-OpenCV-plugins https://sites.imagej.net/IJ-OpenCV/; \
$( FIJI_ROOT_PATH) /ImageJ-linux64 --update update; \
fi
2019-10-08 17:52:30 +02:00
$(PACKAGE_FILE_PATH) : $( BUILD_ROOT_PATH ) /jars /Lib /fr .univ -rennes 1.ipr .lipase .lib .jar $( PLUGINS_SRC_FILES )
2019-10-04 18:48:35 +02:00
mkdir -p $( BUILD_ROOT_PATH) /plugins/Ipr ; \
rsync -a ./src/ij-plugins/Ipr/ $( BUILD_ROOT_PATH) /plugins/Ipr/ ; \
2019-10-07 12:05:25 +02:00
pushd $( BUILD_ROOT_PATH) ; \
zip -r $( PACKAGE_FILE_PATH) * ; \
popd
2019-10-04 11:36:53 +02:00
2019-10-04 18:48:35 +02:00
.PHONY : package
package : $( PACKAGE_FILE_PATH )
2019-10-04 11:36:53 +02:00
.PHONY : install
2019-10-04 18:48:35 +02:00
install : $( PACKAGE_FILE_PATH ) install_ij_opencv
2019-10-08 16:41:30 +02:00
pushd $( FIJI_ROOT_PATH) ; unzip -o $( PACKAGE_FILE_PATH) ; popd
2019-10-04 11:36:53 +02:00
.PHONY : test 0001
test0001 : install
# on macosx : /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './test0001.py'
# /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './tests/test0001.py' "lipase_src_root_path='$(pwd)',raw_images_root_path='/Users/graffy/ownCloud/ipr/lipase/raw-images'"
2019-10-04 11:47:34 +02:00
echo 2 > '/tmp/test_result.txt' ; \
$( FIJI_EXE_PATH) --ij2 --headless --run './tests/test0001.py' " raw_images_root_path=' $( RAW_IMAGES_ROOT_PATH) ' " ; \
2019-10-04 11:36:53 +02:00
ERROR_CODE = $$ ? ; \
echo " Fiji 's return code : $$ ERROR_CODE " ; \
ERROR_CODE = $$ ( cat '/tmp/test_result.txt' ) ; \
echo " test's return code : $$ ERROR_CODE " ; \
exit $$ ERROR_CODE
2020-03-27 16:49:21 +01:00
.PHONY : test_globules_area
test_globules_area : install
# on macosx : /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './test0001.py'
# /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './tests/test0001.py' "lipase_src_root_path='$(pwd)',raw_images_root_path='/Users/graffy/ownCloud/ipr/lipase/raw-images'"
echo 2 > '/tmp/test_result.txt' ; \
$( FIJI_EXE_PATH) --ij2 --headless --run './src/ij-plugins/Ipr/Lipase/Compute_Globules_Area.py' " INPUT_STACK=' $RAW_IMAGES_ROOT_PATH /res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0/img_000000000_DM300_nofilter_vis_000.tif', INPUT_BACKGROUND=' $RAW_IMAGES_ROOT_PATH /res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0/img_000000000_DM300_nofilter_vis_000.tif', PARTICLE_THRESHOLD='2000' " ; \
ERROR_CODE = $$ ? ; \
echo " Fiji 's return code : $$ ERROR_CODE " ; \
ERROR_CODE = $$ ( cat '/tmp/test_result.txt' ) ; \
echo " test's return code : $$ ERROR_CODE " ; \
exit $$ ERROR_CODE
2019-10-04 11:36:53 +02:00
.PHONY : test
test : test 0001
2019-10-04 18:48:35 +02:00
.PHONY : clean
2020-02-14 18:27:30 +01:00
clean : clean_doc
2019-10-04 18:48:35 +02:00
rm -Rf $( BUILD_ROOT_PATH)
rm -Rf $( PACKAGE_FILE_PATH)