diff --git a/.gitignore b/.gitignore index 588451eb1..a4f09e780 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,9 @@ # Built documenation /doc/build -/doc/source/_autosummary -scripts/config_generator/test_processes -scripts/config_generator/test_processes_2 +/doc/source/_autosummary +scripts/config_generator/test_processes +scripts/config_generator/test_processes_2 # Python egg metadata, regenerated from source files by setuptools. /*.egg-info @@ -22,5 +22,11 @@ scripts/config_generator/test_processes_2 # nfs failures .nfs* -# vim swap files -*.swp +# vim swap files +*.swp +# conda build directory +build/ + +# VSCode settings +.vscode +.vscode/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c0cd9cbf7..8eba53a66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,39 +1,24 @@ +dist: bionic cache: apt -sudo: true language: python python: - - "2.7" -# - "3.5" -#addons: -# apt: -# packages: -# - libblas-dev -# - liblapack-dev -# - gfortran -# - libhdf5-serial-dev -# - libboost-all-dev + - 3.7 before_install: - - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - - conda info -a + - cd $TRAVIS_BUILD_DIR/install/savu_hpc/savu_installer + - ls -lah +# - touch ~/.condarc +# - "echo channel_priority: strict >> ~/.condarc" install: - - conda env create --file environment.yml - - source activate test-environment + - PREFIX=$HOME bash savu_installer.sh --local --no_prompts + - export PATH=$HOME/miniconda/bin:$PATH + - export FACILITY=dls + - cd $TRAVIS_BUILD_DIR - python setup.py install script: - - py.test scripts/configurator_tests/ -v - - py.test savu/test/travis -v --cov savu --cov-report term-missing - -after_script: - - coveralls - -#allow_failures: -# - python: "3.5" - + - pip install coverage pytest-cov + - cd $TRAVIS_BUILD_DIR + - pytest scripts/configurator_tests/ --cov=scripts + - pytest savu/test/travis --cov=savu --cov-report term-missing diff --git a/GUI/GUI_comparison/PyQt/create_plugin_template_v4.py b/GUI/GUI_comparison/PyQt/create_plugin_template_v4.py index 27cf13b3a..b9bc0cef3 100644 --- a/GUI/GUI_comparison/PyQt/create_plugin_template_v4.py +++ b/GUI/GUI_comparison/PyQt/create_plugin_template_v4.py @@ -96,7 +96,7 @@ def CreateModule(self): f.close - print 'done, go to : '+ os.path.dirname(os.path.realpath(__file__)) + '/' + modname + print('done, go to : '+ os.path.dirname(os.path.realpath(__file__)) + '/' + modname) # creates the GUI window, with specifications given above diff --git a/GUI/GUI_comparison/qml/plugin_template_v6.py b/GUI/GUI_comparison/qml/plugin_template_v6.py index b817447fe..bce41412a 100644 --- a/GUI/GUI_comparison/qml/plugin_template_v6.py +++ b/GUI/GUI_comparison/qml/plugin_template_v6.py @@ -48,7 +48,7 @@ def on_create_template(plugin_info): f.write("\n\n def get_max_frames(self):\n return 'multiple'") f.close - print 'done, go to : '+ os.path.dirname(os.path.realpath(__file__)) + '/' + modname + print('done, go to : '+ os.path.dirname(os.path.realpath(__file__)) + '/' + modname) QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True) myApp = QApplication(sys.argv) diff --git a/GUI/plugin_template_wizard/auto_plugin_wizard.py b/GUI/plugin_template_wizard/auto_plugin_wizard.py index 628b83bf0..db591759c 100644 --- a/GUI/plugin_template_wizard/auto_plugin_wizard.py +++ b/GUI/plugin_template_wizard/auto_plugin_wizard.py @@ -13,7 +13,7 @@ from PyQt5.QtGui import QGuiApplication from PyQt5.QtQml import QQmlApplicationEngine -from template import Template +from .template import Template current_template = Template() diff --git a/GUI/plugin_template_wizard/template.py b/GUI/plugin_template_wizard/template.py index 123e3b099..1e989f356 100644 --- a/GUI/plugin_template_wizard/template.py +++ b/GUI/plugin_template_wizard/template.py @@ -89,4 +89,4 @@ def write_template(self,plugin_info): f.close - print 'done, go to : '+ os.path.dirname(os.path.realpath(__file__)) + '/' + modname + print('done, go to : '+ os.path.dirname(os.path.realpath(__file__)) + '/' + modname) diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index cf4e4b478..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,87 +0,0 @@ -pipeline { - agent any - - triggers { - pollSCM('H 21 * * *') - } - - options { - skipDefaultCheckout(true) - // Keep the 10 most recent builds - buildDiscarder(logRotator(numToKeepStr: '10')) - timestamps() - } - - environment { - PATH="/var/lib/jenkins/miniconda3/bin:$PATH" - } - - stages { - - stage ("Code pull"){ - steps{ - checkout scm - } - } - - stage('Env py27') { - steps { - echo "Building py27 virtualenv" - sh ''' conda create --yes -n "${BUILD_TAG}py27" python=2.7 - conda install conda-build - conda install anaconda-client - ''' - } - } - stage('Build savu-py27') { - when { - expression { - currentBuild.result == null || currentBuild.result == 'SUCCESS' - } - } - steps { - sh ''' source activate "${BUILD_TAG}py27" - conda config --set anaconda_upload no - cd install/savu_lite27/ - conda build . - conda install /var/lib/jenkins/miniconda3/savu_install/linux-64/*.tar.bz2 - ''' - } - } - - stage('Savu Tests') { - steps { - sh ''' source activate "${BUILD_TAG}py27" - conda install pytest pytest-cov - cd savu/test/travis/plugin_tests/filter_tests/denoise - pytest -v --cov - ''' - } - } - - stage("Deploy savu-py27") { - steps { - sh ''' source activate "${BUILD_TAG}py27" - conda config --set anaconda_upload yes - source /var/lib/jenkins/upload.sh - anaconda -t $CONDA_UPLOAD_TOKEN upload -u dkazanc /var/lib/jenkins/miniconda3/savu_install/linux-64/*.tar.bz2 --force - ''' - } - } - } - - post { - always { - sh ''' conda remove --yes -n "${BUILD_TAG}py27" --all - ''' - } - failure { - emailext ( - subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: """

FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':

-

Check console output at "${env.JOB_NAME} [${env.BUILD_NUMBER}]"

""", - recipientProviders: [[$class: 'DevelopersRecipientProvider']]) - } - } - -} diff --git a/bin/savu.sh b/bin/savu.sh deleted file mode 100755 index e60932616..000000000 --- a/bin/savu.sh +++ /dev/null @@ -1,5 +0,0 @@ -module load python/ana - -export PYTHONPATH=/home/ssg37927/savu/Savu:$PYTHONPATH - -python /home/ssg37927/savu/Savu/savu/tomo_recon.py $@ \ No newline at end of file diff --git a/bin/savu_mpi_dev.sh b/bin/savu_mpi_dev.sh new file mode 100755 index 000000000..965db9045 --- /dev/null +++ b/bin/savu_mpi_dev.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# This script should be used to test Local MPI runs on +# DEVELOPMENT versions of Savu. It takes the path to the +# Savu source to be used as its first argument, and the rest +# are forwarded to Savu itself. +# +# The Python environment containing all the dependencies of Savu +# must already be activated. +# +# Example usage with full paths: +# /scratch/dev/savu/bin/savu_mpi_dev.sh /scratch/dev/savu /scratch/dev/savu/test_data/data/24737.nxs /scratch/dev/savu/test_data/process_lists/ica_test.nxs /scratch/output +# +# Example usage while inside the repository root: +# bin/savu_mpi_local_dev.sh . test_data/data/24737.nxs test_data/process_lists/ica_test.nxs /scratch/output + +echo "SAVU_MPI_LOCAL:: Running Job with Savu at $1" + +nNodes=1 +nCoresPerNode=`lscpu --all --parse=CORE,SOCKET | grep -E "^[0-9]" | wc -l` +nGPUs=$(nvidia-smi -L | wc -l) + +echo "***********************************************" +echo -e "\tRunning on $nCoresPerNode CPUs and $nGPUs GPUs" +echo "***********************************************" + +savupath=$1 +datafile=$2 +processfile=$3 +outpath=$4 +shift 4 +options=$@ + +DIR="$(cd "$(dirname "$0")" && pwd)" +echo "savupath is:" $savupath + +nCPUs=$((nNodes*nCoresPerNode)) + +# launch mpi job +filename=$savupath/savu/tomo_recon.py + +echo "running on host: "$HOSTNAME +echo "Processes running are : ${nCPUs}" + +processes=`bc <<< "$nCPUs"` + +for i in $(seq 0 $((nGPUs-1))); do GPUs+="GPU$i " ; done +for i in $(seq 0 $((nCPUs-1-nGPUs))); do CPUs+="CPU$i " ; done +CPUs=$(echo $GPUs$CPUs | tr ' ' ,) + +echo "running the savu mpi local job with process parameters: $CPUs" + +echo "Using python at $(which python)" + +OMPI_MCA_opal_cuda_support=true PYTHONPATH=$savupath:$PYTHONPATH mpirun -np $nCPUs --use-hwthread-cpus \ + -mca btl self,vader -mca orte_forward_job_control 1 \ + python $filename $datafile $processfile $outpath -n $CPUs -v $options + +echo "SAVU_MPI_LOCAL:: Process complete" diff --git a/bin/savu_mpijob.sh b/bin/savu_mpijob.sh deleted file mode 100644 index 203cfea2f..000000000 --- a/bin/savu_mpijob.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -#module load global/testcluster -module load global/cluster - -module load python/anaconda-savu -# test unloading astra module! -source activate savu_mpi1 - -#module load savu/1.0_new_env -#activate_env - -savupath=$1 -datafile=$2 -processfile=$3 -outfile=$4 -nCPUs=$5 -shift 5 -nGPUs=4 - -if [ $nGPUs -gt $nCPUs ]; then - nGPUs=$nCPUs -fi - -export PYTHONPATH=$savupath:$PYTHONPATH -filename=$savupath/savu/tomo_recon.py - -UNIQHOSTS=${TMPDIR}/machines-u -awk '{print $1 }' ${PE_HOSTFILE} | uniq > ${UNIQHOSTS} -uniqslots=$(wc -l <${UNIQHOSTS}) -echo "number of uniq hosts: ${uniqslots}" -echo "running on these hosts:" -cat ${UNIQHOSTS} - -processes=`bc <<< "$((uniqslots*nCPUs))"` - -for i in $(seq 0 $((nGPUs-1))); do GPUs+="GPU$i " ; done -for i in $(seq 0 $((nCPUs-1-nGPUs))); do CPUs+="CPU$i " ; done -#for i in $(seq 0 $((nCPUs-1))); do CPUs+="CPU$i " ; done -CPUs=$(echo $GPUs$CPUs | tr ' ' ,) -echo $CPUs -echo $nCPUs $nGPUs - -echo "Processes running are : ${processes}" - -#export OMP_NUM_THREADS=1 -#export PYFAI_OPENCL=0 - -mpirun -np ${processes} \ - -mca btl self,openib,sm \ - -mca orte_forward_job_control 1 \ - -x LD_LIBRARY_PATH \ - --hostfile ${UNIQHOSTS} \ - python $filename $datafile $processfile $outfile -n $CPUs -v $@ - diff --git a/c_source_code/dezing/.gitignore b/c_source_code/dezing/.gitignore deleted file mode 100644 index ca172798a..000000000 --- a/c_source_code/dezing/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -build/ -*.a -*.o -*.so -dezing.c -dezing.h diff --git a/c_source_code/dezing/Makefile b/c_source_code/dezing/Makefile deleted file mode 100644 index 63d811a9d..000000000 --- a/c_source_code/dezing/Makefile +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/local/bin/gnumake - -CXX := g++ -CC := gcc -LINK := gcc -.SUFFIXES : .c .cpp .cu .o - - -#FFTWPREFIX := ${FFTWDIR} - -OPTIMIZER = -O3 -#OPTIMIZER = -ggdb - -#include all warnings .. -#FLAGS = $(OPTIMIZER) -DPCO_4000_FIX_BCD #-Wall -FLAGS = $(OPTIMIZER) #-DDEBUG_ALGORITHM # -DDEBUG_DEZING_FIX # -DDEBUG_INDEX # -DTESTRAW #-Wall - -FLAGS += $(CFLAGS) - -#location of the library folders - -LIBDIRS = - -#-L$(FFTWPREFIX)/lib - -INCDIRS := - -#-I$(FFTWPREFIX)/include/ - -#library flags required -# -# - - -LIBS = -lm -ldl -lrt \ --pthread -Wl,-rpath `pwd` - -#-Wl,-rpath $(FFTWPREFIX)/lib \ - -# add this flag to get lots of linker output -#-Wl,--verbose - - -CSOURCES=\ - dezing_functions.c \ - handlers.c \ - timestamp.c - -CMAIN=\ - dezing_main.c\ - tifwrite.c - -CSALL=$(CSOURCES) $(CMAIN) - - -COBJECTS=$(CSALL:%.c=%.o) - -COBJLIB=$(CSOURCES:%.c=%.o) - -COBJMAIN=$(CMAIN:%.c=%.o) - - -PROGNAME=dezing_batch - -SHARENAME=libdezing.so -STATICNAME=libdezing.a - -DFFLAGS = -DDEBUGALL - -# the dependencies -default: $(PROGNAME) - -debug: OPTIMIZER := -ggdb -debug: FLAGS += -lefence -debug: clean $(COBJECTS) - $(CC) -o $@ $(COBJECTS) $(LIBDIRS) $(LIBS) $(FLAGS) -ltiff - - -debugthread: OPTIMIZER := -ggdb -debugthread: FLAGS += -DSINGLETHREAD -DDEBUG_THREADSCALE -debugthread: clean $(COBJECTS) - $(CC) -o $@ $(COBJECTS) $(LIBDIRS) $(LIBS) $(FLAGS) - -debugfilt: FLAGS += $(DFFLAGS) -debugfilt: clean $(COBJECTS) - $(CC) -o $@ $(COBJECTS) $(LIBDIRS) $(LIBS) $(FLAGS) - - -.c.o: - $(CC) $(INCDIRS) $(FLAGS) -c $< - - - -$(PROGNAME): $(CUDAOBJECTS) $(COBJMAIN) shared - $(CC) -o $@ $(COBJMAIN) $(LIBDIRS) $(LIBS) $(FLAGS) $(SHARENAME) -ltiff - -shared: FLAGS+=-fPIC -Wall -shared: $(SHARENAME) - -static: FLAGS+=-fPIC -Wall -static: $(STATICNAME) - - -$(SHARENAME): $(CUDAOBJECTS) $(COBJLIB) - $(CC) -o $@ $(COBJLIB) $(LIBDIRS) $(LIBS) $(FLAGS) -shared - -$(STATICNAME): $(CUDAOBJECTS) $(COBJLIB) - ar rcs $@ $(COBJLIB) - -# using 'export NVCCFLAGS=-DDEBUGTIME' in the shell -# to activate the extra time print out - -clean: - rm -f $(COBJECTS) $(PROGNAME) debugfilt $(SHARENAME) $(STATICNAME) - - diff --git a/c_source_code/dezing/build.sh b/c_source_code/dezing/build.sh deleted file mode 100755 index 2c212641f..000000000 --- a/c_source_code/dezing/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -module add fftw -module add python/anaconda-savu -#make shared -make static -export CFLAGS="-I . $CFLAGS" -export LDFLAGS="-L . $LDFLAGS" -python setup.py build_ext -i -#make debug -# $Id: build.sh 465 2016-02-16 11:02:36Z kny48981 $ - diff --git a/c_source_code/dezing/cdezing.pxd b/c_source_code/dezing/cdezing.pxd deleted file mode 100644 index 91f317052..000000000 --- a/c_source_code/dezing/cdezing.pxd +++ /dev/null @@ -1,25 +0,0 @@ - -# $Id: cdezing.pxd 465 2016-02-16 11:02:36Z kny48981 $ - -cdef extern from "./options.h": - ctypedef struct Options: - unsigned char versionflag - unsigned char f_call_num - size_t cropwd - unsigned int nlines - unsigned short int nthreadsreq - float outlier_mu - unsigned char returnflag - unsigned char warnflag - unsigned char errflag - unsigned int npad - -cdef extern from "./timestamp.h": - void timestamp_open(const char * const logname) - void timestamp_close() - void timestamp_init() - void timestamp(const char * const stampmsg,const int loglevel) - -cdef extern from "./dezing_functions.h": - void runDezing(Options * ctrlp, unsigned int thisbatch,unsigned char * inbuf, unsigned char * outbuf ) - diff --git a/c_source_code/dezing/clean.sh b/c_source_code/dezing/clean.sh deleted file mode 100755 index 6c1feb5d4..000000000 --- a/c_source_code/dezing/clean.sh +++ /dev/null @@ -1,8 +0,0 @@ - -set -x -make clean -rm -f dezing.c dezing.so -rm -rf build -set +x -# $Id: clean.sh 465 2016-02-16 11:02:36Z kny48981 $ - diff --git a/c_source_code/dezing/dezing.pyx b/c_source_code/dezing/dezing.pyx deleted file mode 100644 index 349d7541c..000000000 --- a/c_source_code/dezing/dezing.pyx +++ /dev/null @@ -1,188 +0,0 @@ - -import numpy as np -import logging -cimport numpy as np -cimport cdezing - -# $Id: dezing.pyx 465 2016-02-16 11:02:36Z kny48981 $ - - - -cdef cdezing.Options ctrl -ctrl.nthreadsreq=0 - -cdef unsigned int batchsize - -cdef public void pydebug(char * message): - logging.debug(message) -cdef public void pyinfo(char * message): - logging.info(message) -cdef public void pywarn(char * message): - logging.warning(message) -cdef public void pyerr(char * message): - logging.error(message) -cdef public void pyuser(char * message): - logging.log(100,message) - -def getversion(): - global ctrl - ctrl.versionflag=1 - cdezing.runDezing(&ctrl,0,NULL,NULL) - - - -def setup_size(array_size,outlier_mu,npad,logfile="dezing.log",versionflag=0): #,bytes summary): - global ctrl - global batchsize - logging.debug("setup_size: opening log file") - cdezing.timestamp_open(logfile) - cdezing.timestamp_init() - - logging.debug( "setup_size: setting control flags") - ctrl.versionflag=versionflag - ctrl.outlier_mu=outlier_mu - ctrl.cropwd=array_size[2] - ctrl.nlines=array_size[1] - ctrl.npad=npad - ctrl.nthreadsreq=0 - - batchsize = array_size[0] + (2 * npad) - - ctrl.f_call_num=0 - - cdezing.timestamp( "setup_size: calling c function for setup",1 ) - #cdezing.runDezing(&ctrl,batchsize, inarray.data, outarray.data) - cdezing.runDezing(&ctrl,batchsize, NULL, NULL) - return(ctrl.returnflag,ctrl.warnflag,ctrl.errflag) - -def setup(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray,outlier_mu,npad,logfile="dezing.log",versionflag=0): #,bytes summary): - global ctrl - global batchsize - print "setup: opening log file" - cdezing.timestamp_open(logfile) - cdezing.timestamp_init() - print "setup: coercing array" - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - - print "setup:setting control flags" - ctrl.versionflag=versionflag - ctrl.outlier_mu=outlier_mu - ctrl.cropwd=inarray.shape[2] - ctrl.nlines=inarray.shape[1] - ctrl.npad=npad - batchsize=inarray.shape[0] - - ctrl.f_call_num=0 - - cdezing.timestamp( "calling c function setup",1 ) - #cdezing.runDezing(&ctrl,batchsize, inarray.data, outarray.data) - cdezing.runDezing(&ctrl,batchsize, inbuf, outbuf) - pass - -def run(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray): #,bytes summary): - global ctrl - global batchsize - - logging.debug("coercing arrays ") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - logging.debug( "in dezing.run: ctrl.cropwd is: %i batchsize is %s"% (ctrl.cropwd, (batchsize,))) - - batchsize=inarray.shape[0] - - cdezing.timestamp( "calling c function with run flag",1 ) - ctrl.f_call_num=1 - cdezing.runDezing(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - return(ctrl.returnflag,ctrl.warnflag,ctrl.errflag) - - - -def cleanup(): #,bytes summary): - global ctrl - global batchsize - ctrl.f_call_num=2 - cdezing.timestamp( "calling c function with cleanup flag",1 ) - cdezing.runDezing(&ctrl,batchsize, NULL,NULL) - cdezing.timestamp_close() - return(ctrl.returnflag,ctrl.warnflag,ctrl.errflag) - - - - - - - -def test_run(width=2550,length=2500,batchsize=100): - #cdef np.ndarray[np.uint16_t,ndim=3] inarray =np.ones((width,length,batchsize),dtype=np.uint16) - #cdef np.ndarray[np.uint16_t,ndim=3] outarray =np.empty((width,length,batchsize),dtype=np.uint16) - inarray =np.ones((width,length,batchsize),dtype=np.uint16) - outarray =np.empty((width,length,batchsize),dtype=np.uint16) - print "setting control flags" - ctrl.versionflag=0 - ctrl.outlier_mu=1.5 - ctrl.cropwd=width - ctrl.nlines=length - print "setting a test value at element 0" - inarray[0,0,0]=143 - print "creating random zingers" - xarray=np.random.random_integers(0,width-1,1000) - yarray=np.random.random_integers(0,length-1,1000) - print "applying random zingers" - for i in range(0,batchsize): - for d in range(0,len(xarray)): - xidx=xarray[d] - yidx=yarray[d] - inarray[xidx,yidx,i]=100*np.random.rand() - - print "getting slice of input" - in50=inarray[:,:,50] - print "setting inarray element 0 to %i"%inarray[0,0,0] - cdezing.timestamp_open("test_run.log") - - - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - - ctrl.f_call_num=0 - print "calling c function setup" - #cdezing.runDezing(&ctrl,batchsize, inarray.data, outarray.data) - cdezing.runDezing(&ctrl,batchsize, inbuf, outbuf) - - ctrl.f_call_num=1 - print "calling c function" - #cdezing.runDezing(&ctrl,batchsize, inarray.data, outarray.data) - cdezing.runDezing(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - - ctrl.f_call_num=2 - print "calling c function cleanup" - #cdezing.runDezing(&ctrl,batchsize, inarray.data, outarray.data) - cdezing.runDezing(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - - - cdezing.timestamp_close() - print "finished c function" - print "outarray element 0 is %i"%outarray[0,0,0] - out50=outarray[:,:,50] - return(in50,out50) - - - - -def test_data(): - cdef np.ndarray[np.uint16_t,ndim=3] inarray =np.ones((50,100,15),dtype=np.uint16) - cdef np.ndarray[np.uint16_t,ndim=3] outarray =np.empty((50,100,15),dtype=np.uint16) - ctrl.versionflag=2 - ctrl.outlier_mu=0.7 - ctrl.cropwd=50 - ctrl.nlines=100 - inarray[0,0,0]=143 - print "setting inarray element 0 to %i"%inarray[0,0,0] - print "calling c function" - cdezing.timestamp("calling c function",1) - cdezing.runDezing(&ctrl,15, inarray.data, outarray.data) - print "finished c function" - print "outarray element 0 is %i"%outarray[0,0,0] - - - diff --git a/c_source_code/dezing/dezing_functions.c b/c_source_code/dezing/dezing_functions.c deleted file mode 100644 index 7a25cf76b..000000000 --- a/c_source_code/dezing/dezing_functions.c +++ /dev/null @@ -1,626 +0,0 @@ -#ifndef _REENTRANT -#define _REENTRANT -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "timestamp.h" -#include "options.h" - -#ifndef PI -#define PI (3.14159265) -#endif /* */ - -#ifndef PLANCK -#define PLANCK (1240.0e-6) -#endif -#ifdef DEBUG_ALGORITHM -static pthread_mutex_t count_mutex=PTHREAD_MUTEX_INITIALIZER; -#endif /*DEBUG_ALGORITHM*/ -unsigned char vflag=0; - -char gmessagebuf[MAX_MESSAGE]; - -extern void timestamp(const char *const stampmsg,const int loglevel); - -static void svn_id_file(FILE * fp){ - - //printf("%s: SVN ID: $Id: dezing_functions.c 464 2016-02-16 10:54:37Z kny48981 $\n",__FILE__); - snprintf(gmessagebuf,MAX_MESSAGE,"%s: SVN ID: $Id: dezing_functions.c 464 2016-02-16 10:54:37Z kny48981 $",__FILE__); - timestamp(gmessagebuf,LEVEL_USER); - snprintf(gmessagebuf,MAX_MESSAGE,"%s: SVN URL: $URL: file:///home/kny48981/SVN/progs/dezing_cython/dezing_functions.c $",__FILE__); - logprint(gmessagebuf,LEVEL_USER); - snprintf(gmessagebuf,MAX_MESSAGE,"%s: SVN header ID: %s","options.h",OPTIONS_H); - logprint(gmessagebuf,LEVEL_USER); -} - -// Real data type -typedef float Real; - - - - -typedef struct filtdata_struct{ - - u_int16_t * input16; - u_int16_t * flat16; - u_int16_t * dark16; - u_int16_t * result16; - - Real * result; - size_t * tsizes; - int * origsizes; - - double outlier_mu; -} Filtdata; - -typedef struct threadlimit_struct{ - u_int16_t mynum; - int start; - int end; -}Threadlimit; - - -static void * threaddezing (void * datap) ; - - -static Filtdata g_filtdata; - - -void write_raw_16(const u_int16_t * const datap, const u_int32_t filenum,const size_t tsize,const u_int32_t batch,const char * const prefix) { - FILE *ofp; - char fname[1024]; - size_t nw = 0; - snprintf(fname,1024,"%s_%03d.raw",prefix,filenum); - timestamp ("writing ...",LEVEL_DEBUG); - ofp = fopen (fname, "w"); - nw = fwrite (datap, sizeof (u_int16_t), tsize * batch, ofp); - snprintf (gmessagebuf,MAX_MESSAGE,"wrote %zu uint16 values to %s",nw, fname); - logprint(gmessagebuf,LEVEL_DEBUG); - fclose(ofp); -} - -void write_raw_real(const Real * const datap, const u_int32_t filenum,const size_t tsize,const u_int32_t batch,const char * const prefix) { - FILE *ofp; - char fname[1024]; - size_t nw = 0; - snprintf(fname,1024,"%s_%03d.raw",prefix,filenum); - timestamp ("writing ...",LEVEL_DEBUG); - ofp = fopen (fname, "w"); - nw = fwrite (datap, sizeof (float), tsize * batch, ofp); - printf ("wrote %zu float values to %s\n",nw, fname); - fclose(ofp); -} - - - -void runDezing( Options * ctrlp, u_int32_t thisbatch,u_int8_t * inbuf, u_int8_t * outbuf){ -/* - const Options * const ctrlp: Pointer to the structure that contains all the options required - u_int32_t thisbatch: The number of image frames to process in this batch - u_int8_t * inbuf: Pointer to a memory location containing the image frame data - u_int8_t * outbuf: Pointer to a memory location ALREADY allocated to contain the required output size -*/ - int retval=0; - unsigned int i; - long int nprocavail=0; - long int nslotsavail=0; - char * envstring; - unsigned short int nthreads=16; - unsigned short int nthreadsmax=16; - unsigned int chunksize,extra,istart=0; - - - size_t batchsize, imagesize, sizex, sizey, batch ; - int32_t batch_nopad; - - int sizes[2]; - - // static char * logmessage; - static char logmessage[MAX_MESSAGE]; - //static char * fname; - //static char * wfname; - - static pthread_t * thread; - static Threadlimit * threadlimit; - pthread_attr_t attr; - void * status; - - /* handles to the buffer in uint16 type: NOT allocated in this fucntion , DON'T free these */ - u_int16_t * inbuf16 ; - u_int16_t * outbuf16 ; - u_int16_t * result16; - - - - static int alloc=0; - - - - snprintf(logmessage,MAX_MESSAGE,"versionflag: %hhu",ctrlp->versionflag); - timestamp(logmessage,LEVEL_DEBUG); - snprintf(logmessage,MAX_MESSAGE,"f_call_num: %hhu",ctrlp->f_call_num); - timestamp(logmessage,LEVEL_DEBUG); - snprintf(logmessage,MAX_MESSAGE,"outlier_mu: %f",ctrlp->outlier_mu); - timestamp(logmessage,LEVEL_DEBUG); - - if (ctrlp->versionflag != 0 ){ - if (ctrlp->versionflag == 2 ){ - // 2 -- test mode - inbuf16=(u_int16_t *)(inbuf); - outbuf16=(u_int16_t *)(outbuf); - printf("inbuf element 0 is %hu\n",inbuf16[0]); - printf("outbuf element 0 is %hu\n",outbuf16[0]); - outbuf16[0]=55; - printf("set outbuf element 0 to %hu\n",outbuf16[0]); - printf("quitting test mode\n"); - return; - } - - if (ctrlp->versionflag == 5 ){ - /* set output mode to 5, store the test value instead of corrected value */ - vflag=5; - } - } - - /* nproc refers to actual processor cores on the local system */ - /* nslots refers to the number of processors assigned by the resource manager (queue) system */ - /* nthreadsreq to the number requested by the script configuration or user input */ - /* nthreadsmax set to the most that shoudl be allowed */ - /* nthreads may be reduced if the batch of data is small */ - - envstring=getenv("NSLOTS"); - nprocavail=sysconf( _SC_NPROCESSORS_ONLN ); - - if (envstring != NULL){ - nslotsavail=atol(envstring); - } - - if (ctrlp->nthreadsreq ==0){ - if (envstring == NULL){ - /* not running in the queue */ - /* use all the processors */ - nthreadsmax = nprocavail; - }else{ - /* running in the queue,*/ - /* get number of processors from the queue environment */ - nthreadsmax=nslotsavail; - - if (nthreadsmax < 1 ){ - fprintf(stderr,"WARNING: no processors detected! Something is wrong with the environment variable NSLOTS\n"); - ctrlp->warnflag=1; - nthreadsmax=2; - } - } - }else{ - if((ctrlp->nthreadsreq > nslotsavail) && (nslotsavail != 0 )){ - fprintf(stderr,"WARNING: selected n-threads > nslots\n"); - fprintf(stderr,"nthreads %i > nslots %li\n",ctrlp->nthreadsreq,nslotsavail); - snprintf(logmessage,MAX_MESSAGE,"WARNING: nthreads %i > nslots %li",ctrlp->nthreadsreq,nslotsavail); - timestamp(logmessage,LEVEL_WARN); - ctrlp->warnflag=1; - } - if(ctrlp->nthreadsreq > nprocavail){ - fprintf(stderr,"WARNING: selected n-threads > nprocs\n"); - snprintf(logmessage,MAX_MESSAGE,"WARNING: nthreads %i > nproc %li",ctrlp->nthreadsreq,nprocavail); - timestamp(logmessage,LEVEL_WARN); - ctrlp->warnflag=1; - } - nthreadsmax=ctrlp->nthreadsreq; - } - - inbuf16=(u_int16_t *)(inbuf); - outbuf16=(u_int16_t *)(outbuf); - - - /* get parameters from the options control structure */ - sizex = ctrlp->cropwd; - sizey = ctrlp->nlines; - batch = thisbatch; - - - - //calcuate derived sizes - /* sizes of the image */ - sizes[1] = sizey; - sizes[0] = sizex; - imagesize = sizex * sizey; - batchsize = (imagesize * batch); - snprintf(logmessage,MAX_MESSAGE,"Image size to read : sizex %lu sizey %lu imagesize %lu batchsize %lu",sizex,sizey,imagesize,batchsize); - timestamp(logmessage,LEVEL_INFO); - - - /* number of slices in this batch */ - snprintf(logmessage,MAX_MESSAGE,"thisbatch %i",thisbatch); - timestamp(logmessage,LEVEL_INFO); - - /* how many threads will actually be used this time ? */ - if (thisbatch < nthreadsmax){ - nthreads=thisbatch; - }else{ - nthreads=nthreadsmax; - } - - switch (ctrlp->f_call_num){ - case(0): - if (!alloc){ - alloc=1; - ctrlp->errflag=0; - ctrlp->warnflag=0; - svn_id_file(NULL); - - //************************** - timestamp("allocating the memory in dezing functions",LEVEL_INFO); - snprintf(logmessage,MAX_MESSAGE,"batchsize %zu allocating the memory in dezing functions",batchsize); - timestamp(logmessage,LEVEL_INFO); - //fname=(char *) calloc(1024 , sizeof (char)); - - /* array of threadspecific data , one for each thread */ - /* hmm.. when to free this array??*/ - thread=(pthread_t *)calloc(nthreadsmax,sizeof(pthread_t)); - threadlimit=(Threadlimit *)calloc(nthreadsmax,sizeof(Threadlimit)); - - snprintf (logmessage, MAX_MESSAGE,"Threads available: %u ", nthreadsmax); - timestamp(logmessage,LEVEL_DEBUG); - snprintf (logmessage, MAX_MESSAGE,"Threads requested: %u ", ctrlp->nthreadsreq ); - timestamp(logmessage,LEVEL_DEBUG); - snprintf (logmessage, MAX_MESSAGE,"Threads used: %u ", nthreads); - timestamp(logmessage,LEVEL_INFO); - - timestamp("finished allocating the memory in the dezing functions",LEVEL_INFO); - ctrlp->returnflag=0; - return; - }else{ - snprintf(logmessage,MAX_MESSAGE,"ERROR: %s: attempted to double-allocate !",__func__); - timestamp(logmessage,LEVEL_ERR); - //exit(0); - ctrlp->returnflag=5; - ctrlp->errflag=1; - return; - } - break; - - case(1): - if (!alloc){ - fprintf(stderr,"ERROR: %s: attempted to run without allocating !\n",__func__); - snprintf(logmessage,MAX_MESSAGE,"ERROR: %s: attempted to run without allocating !",__func__); - timestamp(logmessage,LEVEL_ERR); - ctrlp->returnflag=5; - ctrlp->errflag=1; - return; - } - if(nthreads ==0){ - fprintf(stderr,"ERROR: %s: attempted to run with zero threads!\n",__func__); - snprintf(logmessage,MAX_MESSAGE,"ERROR: %s: attempted to run with zero threads!",__func__); - timestamp(logmessage,LEVEL_ERR); - ctrlp->returnflag=5; - ctrlp->errflag=1; - return; - } - //printf("logmessage addr: %x\n",logmessage); - - snprintf (logmessage, MAX_MESSAGE,"Threads available: %u ", nthreadsmax); - timestamp(logmessage,LEVEL_DEBUG); - snprintf (logmessage, MAX_MESSAGE,"Threads requested: %u ", ctrlp->nthreadsreq ); - timestamp(logmessage,LEVEL_DEBUG); - snprintf (logmessage, MAX_MESSAGE,"Threads used: %u ", nthreads); - timestamp(logmessage,LEVEL_INFO); - break; - - case(2): - if(alloc){ - alloc=0; - timestamp("freeing the memory in dezing functions",LEVEL_INFO); - timestamp("freeing thread",LEVEL_DEBUG); - free(thread); - timestamp("freeing threadlimit",LEVEL_DEBUG); - free(threadlimit); - //timestamp("freeing logmessage",LEVEL_DEBUG); - //free(logmessage); - //timestamp("freeing filename",LEVEL_DEBUG); - //free(fname); - timestamp("finished freeing the memory in dezing functions",LEVEL_INFO); - ctrlp->returnflag=0; - return; - }else{ - fprintf(stderr,"ERROR: %s: attempted to double-free !\n",__func__); - snprintf(logmessage,MAX_MESSAGE,"ERROR: %s: attempted to double-free !",__func__); - timestamp(logmessage,LEVEL_ERR); - ctrlp->returnflag=5; - ctrlp->errflag=1; - return; - } - break; - default: - fprintf(stderr,"ERROR: %s: unknown call flag %i\n",__func__,ctrlp->f_call_num); - ctrlp->returnflag=5; - ctrlp->errflag=1; - return; - break; - } - - - result16 = outbuf16; - - - snprintf (logmessage, MAX_MESSAGE,"batchsize: %zu", batchsize); - timestamp(logmessage,LEVEL_INFO); - snprintf (logmessage,MAX_MESSAGE, "sizes: %i %i batch %zu",sizes[0],sizes[1],batch); - timestamp(logmessage,LEVEL_DEBUG); - - - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - - /* calculate the slice numbers belonging to each thread */ - batch_nopad=batch-(2*ctrlp->npad); - - chunksize=(int)floor(batch_nopad/nthreads); - /* only slices inside the non-padded area sent to the threads */ - extra=batch_nopad-(chunksize*nthreads); /* calculate the extra slices after integer division into chunks */ - - istart=ctrlp->npad; - snprintf(logmessage,MAX_MESSAGE,"npad: %i",ctrlp->npad); - timestamp(logmessage,LEVEL_DEBUG); - for (i=0;ioutlier_mu; - snprintf(logmessage,MAX_MESSAGE,"set outlier mu to %f",g_filtdata.outlier_mu); - timestamp(logmessage,LEVEL_DEBUG); - - /* the data locations */ - snprintf(logmessage,MAX_MESSAGE,"g_filtdata.result16 %p",(void *)(&(g_filtdata.result16))); - timestamp(logmessage,LEVEL_DEBUG); - - g_filtdata.result16=result16; - g_filtdata.origsizes=sizes; - - -#ifdef WRITEINPUT - // write out the input data in case of debugging - // - { - static int counter=0; - write_raw_16(g_filtdata.input16,counter,imagesize,batch,"Iinp"); - counter++; - } -#endif - - timestamp("running the dezinger correction ...",LEVEL_INFO); - //timestamp("running thedezinger correction ..."); - //snprintf (logmessage, MAX_MESSAGE,"nthreads: %u ", nthreads); - //timestamp(logmessage); -#ifdef SINGLETHREAD - /* mainly for debugging, just run the function once in the main thread */ - threadlimit[0].start=0; - threadlimit[0].end=batch; - - /* call the function with limits 0 and total batch size */ - threaddezing((void *)(threadlimit)); - - timestamp ("finished single threaddezing",LEVEL_INFO); - -#else /* true multithread calculation of the filter */ - snprintf(logmessage,MAX_MESSAGE,"launching threads: %i ..." , nthreads); - timestamp(logmessage,LEVEL_DEBUG); - for (i=0;ierrflag=1; - } - } - timestamp ("waiting for dezing threads",LEVEL_INFO); - - for (i=0;ierrflag=1; - - } -#ifdef DEBUG_THREADDEZING - else{ - fprintf(stdout,"SUCCESS joining thread %i: code %li\n",i,(long int)status); - } -#endif /*DEGUG*/ - //snprintf(logmessage,MAX_MESSAGE,"finished joining thread %i: code %li\n",i,(long int)status); - //timestamp(logmessage); - } - - timestamp ("finished waiting for dezing threads",LEVEL_INFO); - pthread_attr_destroy(&attr); - - -#endif/*SINGLETHREAD*/ -#ifdef WRITEOUTPUT - - // write out the output data in case of debugging - // - { - static int counter=0; - write_raw_16(g_filtdata.result16,counter,imagesize,batch,"Ioutp"); - counter++; - } -#endif -ctrlp->returnflag=0; - -} - -//////////////////////////////////////////////////////////////////////////////// -// Filtering operations -//////////////////////////////////////////////////////////////////////////////// - - - - - - // 172x167 - // -/* the dezing function */ -static float getfix(u_int16_t * inputs, int size){ - float sumsq; - float mean; - float sum; - float diff,var,sdev; - float testval; - int i; - sum=0; - sumsq=0; - - for (i=0;i g_filtdata.outlier_mu){ - /* if the test is bad, then */ - /* form the mean of remaining pixels except this one */ - if (vflag == 6 ) return(50000); - return(mean); - - }else{ /* return the original value */ - if (vflag == 6) return(0); - return(inputs[2]); - } - - return(-1); -} - -static void * threaddezing (void * in_struct) { - - const static int thisnum=5; /* the number of neighbours in the neighbourhood */ - Threadlimit * tlim; /* container for the thread-specific data passed in via void* */ - int i,j,k; - long int idx,rowidx,slicestart; - int nbj,offset,nbidx; - u_int16_t thisnb[thisnum]; /* array of neighbours */ - const long int size = g_filtdata.origsizes[0]*g_filtdata.origsizes[1]; -#ifdef DEBUG_ALGORITHM - static int mynum=0; /* counter for logging the thread number/slice number activity */ - int thisthread; - const int width=g_filtdata.origsizes[0]; - const int height=g_filtdata.origsizes[1]; - - /* count the threads */ - pthread_mutex_lock(&count_mutex); - thisthread=mynum; - mynum++; - pthread_mutex_unlock(&count_mutex); - /********************/ -#endif /* DEBUG_ALGORITHM */ - - - tlim = (Threadlimit *)(in_struct); - -#ifdef DEBUG_ALGORITHM - /* count the threads */ - pthread_mutex_lock(&count_mutex) ; - j=1; - rowidx=j*(g_filtdata.origsizes[0]); - - //printf("dezing: thread %i batchchunk %hi tlim %i %i first rowidx: %i\n",thisthread,tlim->mynum,tlim->start,tlim->end,rowidx); - //printf("dezing: thread %i width %u height %u \n",thisthread,width,height); - pthread_mutex_unlock(&count_mutex); - /********************/ -#endif /* DEBUG_ALGORITHM */ - - idx=0; - //for (j=1;j<(size_t)(g_filtdata.origsizes[1])-1;j++) - for (j=0;j<(size_t)(g_filtdata.origsizes[1]);j++) - { - rowidx=j*(g_filtdata.origsizes[0]); - - //for(i=1;istart * size; - - for (k=tlim->start ;kend;k++){ - for(nbj=-2;nbj<=+2;nbj++){ /*neighborhood loop */ - offset=nbj*size; - nbidx=(nbj+2); - thisnb[nbidx] = g_filtdata.input16[slicestart+idx+offset]; -#ifdef DEBUG_ALGORITHM - { - static int first=1; - int firstidx; - pthread_mutex_lock(&count_mutex) ; - if ( first == 1 && tlim->mynum==0 ){ - firstidx=slicestart+idx+offset; - first=0; - printf("dezing: thread %i width %u height %u slicestart %i idx %i offset %i ",thisthread,width,height,slicestart,idx,offset); - printf(" batchchunk %hi tlim %i %i first nb idx: %i\n",tlim->mynum,tlim->start,tlim->end,firstidx); - } - pthread_mutex_unlock(&count_mutex); - } -#endif /* DEBUG_ALGORITHM */ - }/*neighbour j nbj*/ - g_filtdata.result16[idx + slicestart ] = (u_int16_t)(getfix(thisnb,thisnum)); - slicestart += size; /* increment the slice */ - }/* slice k */ - idx++; /* increment the in-plane index */ - } /* i index */ - - }/* j index */ - - -#ifndef SINGLETHREAD - pthread_exit(NULL); -#endif - -} - diff --git a/c_source_code/dezing/dezing_functions.h b/c_source_code/dezing/dezing_functions.h deleted file mode 100644 index 1e55a1c07..000000000 --- a/c_source_code/dezing/dezing_functions.h +++ /dev/null @@ -1,2 +0,0 @@ - -extern void runDezing(Options * ctrlp, u_int32_t thisbatch,u_int8_t * inbuf, u_int8_t * outbuf ); diff --git a/c_source_code/dezing/dezing_main.c b/c_source_code/dezing/dezing_main.c deleted file mode 100644 index 6ba07cce9..000000000 --- a/c_source_code/dezing/dezing_main.c +++ /dev/null @@ -1,1328 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "options.h" - -#include "tifwrite.h" -#include "handlers.h" -#include "timestamp.h" -#include "dezing_functions.h" - -#ifdef PCO_4000_FIX_BCD -# ifndef PCO_CROPTOP -# define PCO_CROPTOP (10) -# endif -#endif - -#ifndef NOPAUSE -#define NOPAUSE (10) /* microseconds */ -#endif - -#ifndef SHORTPAUSE -#define SHORTPAUSE (100000) /* microseconds */ -#endif - -#ifndef LONGPAUSE -#define LONGPAUSE (500000) /* microseconds */ -#endif -#ifndef NOPAUSE -#define NOPAUSE (100) /* microseconds */ -#endif - -#ifndef DEFAULT_DARK -#define DEFAULT_DARK (400) -#endif - -/* how many file numbers to look-ahead when running live */ -#ifndef LOOKAHEAD -#define LOOKAHEAD (5) -#endif - -#ifndef NPAD -#define NPAD (2) -#endif - - -int nfix=10; - -extern char * optarg; -char * myhost; - -// some globals -extern unsigned char vflag; -const unsigned char True=1; -const unsigned char False=0; -static char * myname; -//extern int errno; - -Flags flags; - - -void calc_chunks(int64_t * cproj,int nchunksint,int nprojint,u_int32_t npad){ - float nchunks; - float nperchunk; - float nproj; - float pad; - int32_t chunkint; - int32_t totalint; - int32_t totalpad; - int rem; - int ochunk; - int tpad; - int pstart,thisp,thise,thisp_prime,thise_prime; - int i; - - nchunks=(float)(nchunksint); - nproj=(float)(nprojint); - pad=(float)(npad); - - nperchunk=((nproj)/(nchunks)); - chunkint=(int)(ceilf(nperchunk)); - totalint=chunkint*(int)(nchunks); - rem=totalint - (int)(nproj); - - ochunk=chunkint+2*npad; - - tpad=rem+2*npad; - totalpad=nchunksint+tpad; - - -#ifdef DEBUG_CALC_CHUNKS - printf("nchunks = %i\n",nchunksint); - printf("nproj = %li\n",(nprojint)); - printf("npad = %u\n",(npad)); - printf(".........\n\n"); - printf("nperchunk float = %.5g\n",nperchunk); - printf("nperchunk int = %u\n",chunkint); - printf("total int = %u\n",totalint); - printf("rem = %i\n",rem); - printf("overlapping chunk size = %i\n",ochunk); - printf("total padding required = %i\n",tpad); -#endif /*DEBUG_CALC_CHUNKS*/ - - pstart=-npad; - thisp=pstart; - for (i=0;iinoffset; - outoffset=0; - - tifgetstripsdata(mytiff,(char *)(uncropbuf16)); - for (lct=options->croptop;lct< options->cropbot;lct++){ - memcpy(inbuf16+outoffset,uncropbuf16+inoffset,options->cropwd*options->bytes); - outoffset+=options->cropwd; - inoffset+=options->wd; - } -} - -void zeroflags(Flags *f){ - memset(f,0,sizeof(Flags)); -} - - -void print_opts(Options *o, FILE * fp){ - fprintf(fp,"image_size_bytes: %llu\n",o->image_size_bytes); -} - -void free_opts(Options * o){ - free (o->indir); - free (o->outdir); - free (o->jobname); -} - -int checkahead(const Options * const ctrlp, const u_int32_t readahead,const char * const inpath){ - /* cheack for the file status to be good */ - /* look ahead a few files and check if that file has arrived yet */ - - static char * aheadpath; - static char * aheadfile; - static char * message; - static int allocflag=0; - - struct stat fstatus; - int pausetime=(NOPAUSE); - int wtime=0,found=0; - int statret=0; - - if (!allocflag){ - aheadpath= (char *) calloc(PATH_MAX,sizeof(char)); - aheadfile= (char *) calloc(FILENAME_MAX,sizeof(char)); - message= (char *) calloc(MAX_MESSAGE,sizeof(char)); - allocflag=1; - } - - snprintf (aheadfile, FILENAME_MAX, ctrlp->infmt, readahead); - snprintf (aheadpath, PATH_MAX, "%s/%s", ctrlp->indir, aheadfile); - snprintf (message, MAX_MESSAGE, "looking for %s ", aheadpath); - timestamp (message); - while (wtime <= ctrlp->timeout && found == False) { - statret = stat (aheadpath, &fstatus); - if (statret != 0) { - snprintf (message, MAX_MESSAGE, "waiting for %s ", aheadpath); - timestamp (message); - wtime += ctrlp->interval; - sleep (ctrlp->interval); - } else { - snprintf (message, MAX_MESSAGE, "found file %s ", aheadpath); - timestamp (message); - found = True; - timestamp ("Pausing "); - usleep(pausetime); - timestamp ("Finished Pausing "); - } - } - timestamp ("Stopped looking for file"); - - /* if it's still not found, time out */ - if (found == False) { - snprintf (message, MAX_MESSAGE, "projection %s is not found after %i seconds!", aheadpath, wtime); - errprint (message); - return (7); - } - - /* if it's still not good, time out */ - if (vflag) { - snprintf (message, MAX_MESSAGE, "checking projection %s ", inpath); - vprint (message); - } - timestamp ("Checking file status"); - statret = stat (inpath, &fstatus); - if (statret != 0) { - int myerror = errno; - - snprintf (message, MAX_MESSAGE, "status of projection %s is not good after %i seconds!", inpath, wtime); - errprint (message); - snprintf (message, MAX_MESSAGE, "Error: %s", strerror (myerror)); - errprint (message); - return (27); - } - return(0); -} - - -int create_next_filename(char * outpath,Options * ctrlp,unsigned int i){ - static char * outfile; - static char * message; - static int allocflag=0; - int retval=0; - - if (allocflag == 0 ){ - outfile= (char *) calloc(FILENAME_MAX,sizeof(char)); - message= (char *) calloc(MAX_MESSAGE,sizeof(char)); - allocflag = 1; - } - - //create output filename - snprintf(outfile,FILENAME_MAX,ctrlp->outfmt,i); - snprintf(outpath,PATH_MAX,"%s/%s",ctrlp->outdir,outfile); - -} - -int parseopts (int argc, char **argv,Options * options){ - int o; - unsigned char flagerr = 0; - char defaultjob[32]; - pid_t mypid; - mypid=getpid(); - snprintf(defaultjob,32,"p%u",(unsigned int)mypid); - - zeroflags (&flags); - options->bytes=2; /* default */ - options->obytes=2; /* default */ - options->batchnum=1; - options->nsegs=1; - options->wd=4008; - options->image_len=2672; - options->nchunks=16; - options->mychunk=0; - options->fname=strdup("flat.tif"); - options->infmt=strdup("p_%05d.tif"); - options->outfmt=strdup("p_%05d.tif"); - options->uval=0.01; - options->beta=1.0e-9; - options->energy=53.0; - options->distance=500; - options->pixelsize=10.0; - options->deltaratio=1e-3; - options->croptop=0; - options->cropbot=0; - options->cropleft=0; - options->cropright=0; - options->cropwd=0; - options->croplen=0; - options->fftw_level=0; - options->outlier_mu=2.5; - options->delta=options->deltaratio*options->beta; - options->versionflag=0; - flags.d=False; - flags.crop=False; - if (argc <= 1){ - usage(argc,argv); - exit(0); - } - - while (( o = getopt(argc,argv, "a:x:B:b:C:c:D:d:E:W:f:hI:i:J:l:m:n:O:o:p:s:S:T:t:u:v:Vw:X:Z:z:K:") ) != -1){ - - - - switch(o) { - case 'B': - options->beta=atof(optarg); - break; - case 'D': - options->delta=atof(optarg); - break; - case 'W': - options->fftw_level=(u_int8_t)(atoi(optarg)); - break; - - case 'K': - nfix=atoi(optarg); - break; - case 'V': - options->versionflag=1; - break; - - case 'C': - options->cropleft=atoi(optarg); - flags.crop=True; - break; - case 'c': - options->cropwd=atoi(optarg); - flags.crop=True; - break; - case 'T': - options->croptop=atoi(optarg); - flags.crop=True; - break; - case 't': - options->croplen=atoi(optarg); - flags.crop=True; - break; - - case 'E': - options->energy=atof(optarg); - break; - case 'x': - options->pixelsize=atof(optarg); - break; - case 'X': - options->distance=atof(optarg); - break; - case 'u': - options->outlier_mu=atof(optarg); - break; - - case 'S': - options->settingsfolder=strdup(optarg); - flags.S=True; - break; - - case 'i': - options->indir=strdup(optarg); - flags.i=True; - break; - case 'I': - options->infmt=strdup(optarg); - printf("Using infmt option\n"); - flags.Iflag=True; - break; - case 'O': - options->outfmt=strdup(optarg); - printf("Using outfmt option with %s\n",options->outfmt); - flags.O=True; - break; - case 'd': - options->dname=strdup(optarg); - flags.d=True; - if (strcasecmp(options->dname,"NONE") == 0){ - flags.d=False; - } - break; - case 'f': - options->fname=strdup(optarg); - flags.f=True; - break; - case 'o': - options->outdir=strdup(optarg); - flags.o=True; - break; - case 'J': - options->jobname=strdup(optarg); - flags.J=True; - break; - case 'a': - options->batchnum=atoi(optarg); - flags.a=True; - break; - case 'l': - options->image_len=atoi(optarg); - flags.h=True; - break; - case 'w': - options->wd=atoi(optarg); - flags.w=True; - break; - case 'b': - options->bytes=atoi(optarg); - flags.b=True; - break; - case 's': - options->nsegs=atoi(optarg); - flags.s=True; - break; - case 'p': - options->nperseg=atoi(optarg); - flags.p=True; - break; - case 'n': - options-> nchunks=atoi(optarg); - break; - case 'm': - options-> mychunk=atoi(optarg); - flags.m=True; - break; - case 'h': - usage(argc,argv); - exit(0); - break; - case 'Z': - options->timeout=atoi(optarg); - flags.Z=True; - break; - case 'z': - options->interval=atoi(optarg); - flags.z=True; - break; - case 'v': - flags.v=atoi(optarg); - break; - case '?': - printf( "Unhandled option\n"); - printf ("option %i (%c) value %s\n" , optopt,optopt,optarg); - usage(argc,argv); - //return(2); - break; - default: - printf( "Problem in parsing options\n"); - printf ("option %i value %s\n" , o,optarg); - usage(argc,argv); - return(2); - break; - } - } - - flagerr=False; - - - - if ( !(flags.h && flags.w)){ - errprint("Default values used for width or chunk length"); - } - - - if (flags.s == 0 ){ - errprint ("number of segments default used: 1"); - options->nsegs=1; - } - - if (flags.S == 0 ){ - /* default folder */ - options->settingsfolder=strdup("./"); - } - - if (flags.p == 0){ - errprint ("number of projections per segment default used: 100"); - options->nperseg=100; - } - - if ( !(flags.z)){ - errprint("time-out check interval default used"); - options->interval=1; - - } - if ( !(flags.Z)){ - errprint("time-out interval default used"); - options->timeout=3; - } - - if ( !(flags.i && flags.o)){ - errprint("FATAL: Input and Output directories must be specified"); - flagerr=True; - } - if ( !(flags.a )){ - options->batchnum=10; - errprint(" Number of images for a batch not specified using default 10"); - }else{ - if(options->batchnum < 1 ){ - errprint("FATAL: Cannot specify zero or negative number of images for averaging"); - flagerr=True; - } - } - - if (flagerr != False){ - errprint("Not all options were correctly specified"); - usage(argc,argv); - return(3); - } - - options->deltaratio=options->beta/options->delta; - - /* check for unsupported data types */ - if (flags.b == True) { - if (options->bytes != 2 ){ - errprint(" Only 2-byte data supported at present " ); - return(12); - } - } - /* check for too many files */ - if (options->image_len >= 3000){ - errprint("Processing not feasible with > 3000 rows"); - return(13); - } - /* put verbosity in global flag*/ - vflag=flags.v; - /* default job name */ - if (flags.J == False){ - options->jobname=strdup(defaultjob); - } - options->npad=NPAD; - return(0); -}/* end of parseopts */ - -/* test version , jsut copy the files */ -void multiframe(const Options ctrl,const u_int32_t thisbatch, u_int8_t * imagebuf, u_int8_t * outbuf){ - int i; - for (i=0;itiffp); - fsync(tifffd); - TIFFClose(outfp->tiffp); - tiffree(outfp); - vprint("Done closing the files"); - timestamp("Done closing the files "); - snprintf(message,MAX_MESSAGE,"%s closing files done ... ",myhost); - return(0); -} - -int main (int argc, char ** argv) { - Options ctrl; - struct timeval now; - time_t etimes; - double nowtime,etime; - suseconds_t etimeu; - int retval,statret; - int oldpct,newpct; - int wtime; - int ssig; - int npauses=0; - - - size_t total_bytes_read=0,total_bytes_written=0; - - Mytiff outfp; - Mytiff firstfp; - Mytiff darkfp; - - Mytiff * projfp; - u_int8_t **linebuf; - u_int8_t * imagebuf; - u_int8_t * uncropbuf; - u_int8_t *outbuf,*outstart; - u_int8_t * flatbuf, *darkbuf; - u_int16_t * flatbuf16, *darkbuf16; - u_int16_t * uncropbuf16; - off_t tiffoffset; - u_int64_t image_size,linebytes,mystartrow; - int32_t nproj; - int32_t chunkstart,chunkend,chunk_data_start,chunk_data_end; - u_int64_t startproj,endproj,cboundary,chunkproj,extraproj; - - int64_t *cproj; - int32_t i,j,found,thisbatch; - int32_t projcount,batchstart; - int32_t anum=1; - char message[MAX_MESSAGE]; - char * outpath; - char * outfile; - char * inpath; - char * logfile; - char * infile; - struct stat fstatus; - size_t nread,nwrite; - int readahead; - - int pausetime=0; - - /* store the (global) starting time-of-day */ - gettimeofday(&mystime,NULL); - - myname=basename(strdup(argv[0])); - myhost=getenv("HOSTNAME"); - - /* output to standard out before the logfile is created */ - - svn_id_file(stdout); - nowtime=(double)(mystime.tv_sec) + ((double)(mystime.tv_usec) / 1.0e6); - printf("hostname amount %% done ... elapsed absolute\n"); - printf("%s ",myhost); - printf("none %% done ... %f %f\n",nowtime,nowtime); - -/* Set up the signal handler to use SIGTERM */ -signal (SIGTERM, catchit); -/* set up a signal handler to use SIGUSR1 (writeblock and exit) */ -signal (SIGUSR1, catchit); -/* set up a signal handler to use SIGUSR2 (writeblock and continue) */ -signal (SIGUSR2, catchit); - -#ifdef ALLSIGS -for (ssig=1;ssig<32;ssig++){ - signal(ssig,catchit); -} -#endif - -/* set up a signal handler to use SIGFPE (doesn't do anything, but you can s */ -/* also requires linking with libfpe on the SGI , not sure how to do this on */ -/* using gcc >=2.2 : use fenv.h functions , feenableexcepts() (in handlers.c */ - -#ifdef GNU_TRAP_FPE -enable_fpe_traps (); -signal (SIGFPE, float_error); -#endif - -/* Parse the command line options */ - retval=0; - retval=parseopts(argc,argv,&ctrl); - -/* request only the version strings from subroutine files if that option is selected */ - if (ctrl.versionflag != 0){ - svn_id_file(stdout); - runDezing(&ctrl,0,NULL,NULL); - return(0); - } - - /* stop here if there's any problem */ - if (retval != 0 ){ - fprintf(stderr,"%s: Problem parsing options\n",argv[0]); - return(retval); - } - - - - /* allocate strings for path and filenames */ - outfile = (char *) calloc(FILENAME_MAX,sizeof(char)); - outpath = (char *) calloc(PATH_MAX,sizeof(char)); - inpath = (char *) calloc(PATH_MAX,sizeof(char)); - infile = (char *) calloc(FILENAME_MAX,sizeof(char)); - logfile = (char *) calloc(FILENAME_MAX,sizeof(char)); - - /* */ - /* calculate subsidiary values */ - - nproj=ctrl.nsegs*ctrl.nperseg; - - mystartrow=0; - - if (nproj < ctrl.nchunks){ - - /* - printf("ERROR: we don't like fewer projections %lu than parallel chunks %lu ... %lu \n",nproj,ctrl.nchunks,ctrl.nchunks); - fprintf(stderr,"Error; fewer projections than parallel chunks: nproj %lu nchunks %lu \n",nproj,ctrl.nchunks); - */ - - fprintf(stderr,"Error; fewer projections than parallel chunks:\n"); - fprintf(stderr," nproj %lu ... \n",nproj); - fprintf(stderr," nchunks %lu ... \n",ctrl.nchunks); - exit(0); - } - - if (ctrl.mychunk >= ctrl.nchunks){ - fprintf(stderr,"ERROR: selected chunk number too great\n"); - fprintf(stderr," mychunk %lu ... \n",ctrl.mychunk); - fprintf(stderr," nchunks %lu ... \n",ctrl.nchunks); - exit(0); - } - - if (ctrl.mychunk == ctrl.nchunks) { - } - - if (ctrl.mychunk == 0) { - } - - - cproj=(int64_t * ) calloc(2*(ctrl.nchunks+1),sizeof(int64_t)); - - /* Calculate the chunk boundaries */ - - calc_chunks(cproj,ctrl.nchunks,nproj,ctrl.npad); - - - - - /* set up the i/o handles */ - snprintf(logfile,FILENAME_MAX,"%s/%s.log",ctrl.settingsfolder,ctrl.jobname); - logfp=fopen(logfile,"w"); - if (logfp == NULL){ - int myerror=errno; - snprintf(message,MAX_MESSAGE,"log file open failed\n%s",strerror(myerror)); - errprint(message); - return(21); - } - - timestamp_init(); - snprintf(message,MAX_MESSAGE,"%s log file %s open",myhost,logfile); - timestamp(message); - - - nwrite=0; - nwrite+=sprintf(message,"Command line: "); - for (i=0;i= MAX_MESSAGE) break; - } - timestamp(message); - - for (i=0;i= nproj){ - printf("start number %i is greater than %i \n",i,nproj); - projcount=nproj; - }else{ - printf("start number %i is ok \n",i); - projcount = i ; - } - printf("start number %i set to %i \n",i,projcount); - snprintf (infile, FILENAME_MAX, ctrl.infmt, projcount); - snprintf (inpath, PATH_MAX, "%s/%s", ctrl.indir, infile); - printf("first file name set to %s \n",inpath); - - /* if the height or width are not specified, get from the first file which should match all inputs */ - if (flags.w == 0 ){ - firstfp.wd=0; - } - - if (flags.h == 0 ){ - firstfp.ht=0; - } - - firstfp.bytes=ctrl.bytes; - firstfp.bits=8*ctrl.bytes; - - retval = tifread (&firstfp, inpath); - timestamp ("Finished tiff open of first file"); - if (retval != 0) { - snprintf (message, MAX_MESSAGE, "problem reading first file "); - errprint (message); - fprintf (stderr, "%s: Problem reading first file \n", argv[0]); - fprintf (stderr, "%s: %s: %i: returning %i\n", myname, __func__, __LINE__, retval); - return (retval); - } - if (flags.w == 0){ - snprintf(message,MAX_MESSAGE,"getting width from first file: %i", firstfp.wd); - timestamp(message); - ctrl.wd=firstfp.wd; - } - if (flags.l == 0){ - snprintf(message,MAX_MESSAGE,"getting length from first file: %i", firstfp.ht); - timestamp(message); - ctrl.image_len=firstfp.ht; - } - - - if (ctrl.cropwd == 0 ){ - ctrl.cropwd = ctrl.wd - ctrl.cropleft; - printf("default -- cropping full width %u\n", ctrl.cropwd); - } - - if (ctrl.croplen == 0 ){ - printf("default -- cropping full length %u\n",ctrl.croplen); - ctrl.croplen = ctrl.image_len-ctrl.croptop; - } - - if (flags.crop){ - /* check cropping is sensible */ - if (ctrl.cropleft > ctrl.wd){ - fprintf(stderr,"%s: bad cropping: left value %lu exceeds width %lu\n",argv[0],ctrl.cropleft,ctrl.wd); - return(8); - } - if (ctrl.cropleft + ctrl.cropwd > ctrl.wd){ - fprintf(stderr,"%s: bad cropping: region end %lu exceeds width %lu\n",argv[0],ctrl.cropwd+ctrl.cropleft,ctrl.wd); - return(8); - } - if (ctrl.croptop > ctrl.image_len){ - fprintf(stderr,"%s: bad cropping: top value %lu exceeds length %lu\n",argv[0],ctrl.croptop,ctrl.image_len); - return(8); - } - if (ctrl.croptop + ctrl.croplen > ctrl.image_len){ - fprintf(stderr,"%s: bad cropping: region bottom %lu exceeds length %lu\n",argv[0],ctrl.croplen+ctrl.croptop,ctrl.image_len); - return(8); - } - - ctrl.inoffset=ctrl.croptop*ctrl.wd + ctrl.cropleft; - ctrl.cropbot=ctrl.croptop+ctrl.croplen; - } - - /* calculate derived sizes of image parameters */ - ctrl.nlines=ctrl.croplen; - ctrl.uncrop_image_size=ctrl.wd*ctrl.image_len; - image_size=ctrl.cropwd*ctrl.croplen; - ctrl.image_size_bytes=image_size * ctrl.bytes; - ctrl.outimage_size_bytes=image_size * ctrl.obytes; - ctrl.image_size=image_size; - - linebytes=ctrl.cropwd*ctrl.obytes; - - - /* allocate for all image buffers */ - - snprintf(message,MAX_MESSAGE,"allocating memory"); - timestamp(message); - projfp = (Mytiff *) calloc(ctrl.batchnum,sizeof(Mytiff)); - uncropbuf = (u_int8_t *) calloc(ctrl.uncrop_image_size * ctrl.bytes,sizeof(u_int8_t *)); - - imagebuf = (u_int8_t *) calloc(ctrl.batchnum*ctrl.image_size_bytes,sizeof(u_int8_t *)); - linebuf = (u_int8_t **) calloc(ctrl.batchnum,sizeof(u_int8_t *)); - - outbuf = (u_int8_t * ) calloc(ctrl.batchnum * ctrl.outimage_size_bytes,sizeof(u_int8_t)); - flatbuf = (u_int8_t * ) calloc(ctrl.image_size_bytes,sizeof(u_int8_t)); - darkbuf = (u_int8_t * ) calloc(ctrl.image_size_bytes,sizeof(u_int8_t)); - - darkbuf16=(u_int16_t *)(darkbuf); - flatbuf16=(u_int16_t *)(flatbuf); - uncropbuf16=(u_int16_t *)(uncropbuf); - - outstart=outbuf; - - snprintf(message,MAX_MESSAGE,"done allocating memory"); - timestamp(message); - -/* set up the array of tiff pointers for the images in a batch*/ - - for (anum=0;anum= nproj){ - snprintf(message,MAX_MESSAGE,"loop number %i is greater than %i",i,nproj); - vprint(message); - projcount=nproj; - }else{ - snprintf(message,MAX_MESSAGE,"loop number %i is ok",i); - vprint(message); - projcount = i ; - } - snprintf(message,MAX_MESSAGE,"loop number %i set to %i",i,projcount); - vprint(message); - - - - // try to look ahead 'LOOKAHEAD' files so that processing may continue while - // frames are being acquired - - readahead = projcount + (LOOKAHEAD); - snprintf(message,MAX_MESSAGE,"readahead number set to %i ",readahead); - vprint(message); - - /* sort out some zero index/ one index/ issues */ - /* manage the last few files */ - - if (readahead >= chunkend){ - snprintf(message,MAX_MESSAGE,"readahead number %i greater than boundary %i ",readahead,chunkend); - vprint(message); - readahead = chunkend - 1 ; - snprintf(message,MAX_MESSAGE,"readahead number set to %i ",readahead); - vprint(message); - } - - if (readahead >= nproj){ - snprintf(message,MAX_MESSAGE,"readahead number %i greater than nproj %i \n Using padding algorithm",readahead,nproj); - vprint(message); - readahead = nproj ; - snprintf(message,MAX_MESSAGE,"readahead number set to %i ",readahead); - vprint(message); - } - - snprintf(message,MAX_MESSAGE,"looking ahead to file number %lu",readahead); - timestamp(message); - pausetime = NOPAUSE; - snprintf (infile, FILENAME_MAX, ctrl.infmt, projcount); - snprintf (inpath, PATH_MAX, "%s/%s", ctrl.indir, infile); - - - wtime = 0; - found = 0; - retval = 0; - - /* check for file having been written by another program*/ - retval=checkahead(&ctrl,readahead,inpath); - - /* returns something bad if it reaches the specified timeout */ - if (retval != 0 ){ - snprintf(message,MAX_MESSAGE,"ERROR: checking ahead returned %i\n",retval); - errprint (message); - return(retval); - } - - /***************************/ - /* the file is available */ - /* and ready to open */ - /***************************/ - - if (vflag >= 3){ - printf("CHECKLOOP: anum %i thisbatch %i batchstart %i i %i projcount %i\n",anum,thisbatch,batchstart,i,projcount); - } - - if (vflag) { - snprintf (message, MAX_MESSAGE, "Opening projection file %i/%i %s\n", i,anum, inpath); - vprint (message); - } - snprintf (message, MAX_MESSAGE, "Opening projection file %i/%i %s", i,anum, inpath); - timestamp (message); - - /* Open the tiff for reading using helper functions */ - retval = tifread ((projfp+anum), inpath); - timestamp ("Finished tiff open"); - if (retval != 0) { - snprintf (message, MAX_MESSAGE, "problem reading projection file %i/%i", i,anum); - errprint (message); - fprintf (stderr, "%s: Problem reading projection file %i/%i\n", argv[0], i,anum); - fprintf (stderr, "%s: %s: %i: returning %i\n", myname, __func__, __LINE__, retval); - return (retval); - } - - /* percent progress output */ - newpct = (int) floor ((100 * i) / nproj); - if (newpct > oldpct) { - oldpct = newpct; - snprintf (message, MAX_MESSAGE, "%s %i %% done ... ", myhost, newpct); - timestamp (message); - } - - /* load the file data into the memory location */ - if (flags.crop) { - getcropdata((projfp+anum),&ctrl,uncropbuf16,(u_int16_t *)(linebuf[anum])); - } else { - tifgetstripsdata ((projfp+anum), linebuf[anum]); - } - - snprintf (message, MAX_MESSAGE,"Finished reading frame %i",anum); - timestamp (message); - timestamp ("Closing projection file "); - TIFFClose (projfp[anum].tiffp); - timestamp ("Done closing projection file "); - - if (vflag >=3){ - printf("ENDOFLOOP: anum %i < ctrl.batchnum %i && i %i < chunkend %i \n",anum,ctrl.batchnum,i,chunkend); - } - } /* end of loop (anum) for reading one batch */ - if (vflag >=3){ - printf("AFTERLOOP: anum %i < ctrl.batchnum %i && i %i < chunkend %i \n",anum,ctrl.batchnum,i,chunkend); - } - - - - /* processs a batch */ -#ifdef MOREMESSAGES - snprintf(message,MAX_MESSAGE,"processing batch: thisbatch %i i %i anum %i",thisbatch, i,anum); - timestamp(message); -#endif - if (ctrl.batchnum > 1){ - /* set the pointer to the beginnign of the output batch */ - outbuf=outstart; - snprintf(message,MAX_MESSAGE,"applying batch processing "); - timestamp(message); - printf("*** %i\n",i); - - - print_opts(&ctrl,stdout); - - /* call the desired process algorithm for the batch */ - runDezing(&ctrl,thisbatch,imagebuf,outbuf); - - snprintf(message,MAX_MESSAGE,"finished batch processing"); - timestamp(message); - }else{ - outbuf=outstart; - memcpy(outstart,imagebuf,ctrl.image_size_bytes); - } - -#ifdef TESTRAW - { - static int batchno=0; - char * taskstring; - char rawname[255]; - int taskno; - static testraw=0; - taskstring=getenv("SGE_TASK_ID"); - if (taskstring == NULL){ - taskno=0; - }else{ - taskno=atoi(taskstring); - } - - snprintf(rawname,255,"in_%i_%i.raw",taskno,batchno); - if (testraw == 0 ){ - FILE * trfp; - trfp=fopen(rawname,"wb"); - fwrite(imagebuf,sizeof(u_int8_t),thisbatch*ctrl.image_size_bytes,trfp); - fclose(trfp); - } - //testraw = 1 ; - batchno++; - } -#endif -#ifdef TESTRAW - { - static int batchno=0; - char * taskstring; - char rawname[255]; - int taskno; - static testraw=0; - taskstring=getenv("SGE_TASK_ID"); - if (taskstring == NULL){ - taskno=0; - }else{ - taskno=atoi(taskstring); - } - snprintf(rawname,255,"out_%i_%i.raw",taskno,batchno); - if (testraw == 0 ){ - FILE * trfp; - trfp=fopen(rawname,"wb"); - fwrite(outbuf,sizeof(u_int8_t),thisbatch*ctrl.outimage_size_bytes,trfp); - fclose(trfp); - } - //testraw = 1 ; - batchno++; - } -#endif - /* */ - - // output batch of 'anum' frames per batch - // now the counter i contains the end index of the current batch - // even if the last batch of a chunk is unequal to the rest - // - outbuf=outstart+ctrl.npad*ctrl.outimage_size_bytes; - for (anum = batchstart+ctrl.npad; - anum < i-ctrl.npad && anum < chunk_data_end ; - anum++) { - // create the output file - - //skip the padding at the beginning of the chunk - if (anum < chunk_data_start) { - outbuf += ctrl.outimage_size_bytes; - continue; - } - - create_next_filename(outpath,&ctrl,anum); - - retval=tifinit((&outfp),outpath); -#ifdef MOREMESSAGES - snprintf(message,MAX_MESSAGE,"output loop: batchstart: %i anum: %i i: %i outpath: %s",batchstart,anum, i,outpath); - timestamp(message); - printf("%s\n",message); -#endif - - if (retval != 0){ - snprintf(message,MAX_MESSAGE,"tiff init failed, filename is '%s'",outpath); - errprint(message); - fprintf(stderr,"%s: problem with tiff file init\n",argv[0]); - fprintf(stderr,"%s: %s: %i: returning %i\n",myname,__func__,__LINE__,retval); - return(retval); - } - snprintf(message,MAX_MESSAGE,"donetifinit output file -- %s",outpath); - timestamp(message); - for (j = 0; j < ctrl.nlines; j++) { - nwrite = TIFFWriteScanline (outfp.tiffp, outbuf, j, 0); - total_bytes_written += linebytes; - if (nwrite != 1) { - snprintf (message, MAX_MESSAGE, "tiff line write failed for projection %i line %i", i, j); - errprint (message); - return (14); - } - outbuf += linebytes; - } - - timestamp("Closing the output files "); - - { - int tifffd; - tifffd=TIFFFileno(outfp.tiffp); - fsync(tifffd); - TIFFClose(outfp.tiffp); - tiffree(&outfp); - vprint("Done closing the output files"); - timestamp("Done closing the output files "); - } - - } /* end of loop for output of one batch [anum] */ - - if (i<=chunkend){ - i-=2*ctrl.npad; - } - if (vflag >=3){ - printf("PADLOOP: anum %i < ctrl.batchnum %i && i %i < chunkend %i \n",anum,ctrl.batchnum,i,chunkend); - } - /* done with this batch */ - timestamp ("Done with this batch "); - }/* end of loop over a chunk [i] */ - - - - - snprintf(message,MAX_MESSAGE,"%s chunk done ...",myhost); - timestamp(message); - - timestamp("running cleanup ..."); - /* clean up */ - ctrl.f_call_num=2; - runDezing(&ctrl,thisbatch,imagebuf,outbuf); - - timestamp("... finished running cleanup"); - /* clean up memory */ - - vprint("Cleaning up the memory..."); - free(outpath); - free(outfile); - free(inpath); - free(infile); - free(imagebuf); - free_opts(&ctrl); - - free(cproj); - free(projfp); - free(uncropbuf); - free(linebuf); - free(outstart); - free(flatbuf); - free(darkbuf); - - vprint("..Done"); - vprint("All Done"); - printf("%s closing log file ... \n",myhost); - - fclose(logfp); - logfp=NULL; - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - - printf("%s ... log file %s closed %f %f \n",myhost,logfile,etime,nowtime); - free(logfile); - - return(0); -} - diff --git a/c_source_code/dezing/handlers.c b/c_source_code/dezing/handlers.c deleted file mode 100644 index 082587266..000000000 --- a/c_source_code/dezing/handlers.c +++ /dev/null @@ -1,159 +0,0 @@ -/*$Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $*/ -# define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef GNU_TRAP_FPE -# define _GNU_SOURCE -# include -extern int feenableexcept (int excepts); -#endif -int the_signo; - -/* - extern int jflg; - extern jmp_buf env; - extern int signal_change_freq; -*/ - -//extern int errno; - -void float_error (int signo) -{ /* signal handler for sigfpe */ - static int count = 0; - - printf ("\nSignal handler: float_error: ERROR: fpe detected (signal %i) !!!!\n", signo); - if (count == 0) - #ifdef JUNK - printf ("\nRaising USR2 to obtain output step.\n"); - raise (SIGUSR2); - #endif - count++; - if (count >= 10){ - printf ("\n%s: More than %i fpe errors detected. Exiting...\n", __func__,count); - exit (60); - } - /* RE_RAISE the signal so that the OS can handle it properly */ - /* and return to the program while de-bugging so you can actually find the mistake */ - signal (SIGFPE, float_error); - return; -} - -void catchit (int signo) -{ /* signal handler */ - printf ("\n%s: Signal %d received \n",__func__, signo); - printf ("attempting to flush files ... \n"); - the_signo = signo; - fflush (NULL); - sync(); - //FILE *fp; - //struct stat status; - - /******** handle the TERM signal *************/ - if (signo == SIGTERM){ - printf("%s: got SIGTERM\n",__func__); - printf ("attempting to close files ... \n"); - fcloseall(); - sync(); - printf ("exiting ... \n"); - exit(199); - - /******** handle the USR1 signal *************/ - } else if (signo == SIGUSR1) { - /* jflg = JFLG_WRITEXIT; */ - printf("%s: got SIGUSR1\n",__func__); - /* basically do nothing */ - - - /******** handle the USR2 signal *************/ - }else if (signo == SIGUSR2) { - /* jflg = JFLG_WRITEBIN; */ - printf("%s: got SIGUSR2\n",__func__); - signal (SIGUSR2, catchit); - - /********************************************************/ - /* mechanism for changing output timestep while runnign */ - /* if the file is there, then it gets read when the signal */ - /* is caught */ - - #ifdef JUNK - /* here's how I used to use SIGUSR2 to trigger the program */ - /* to read some changed parameters */ - if (stat ("umat_newstep.in", &status) == 0) { - char *line, *sep, *token; - line = (char *) calloc (MAX_STRING_LEN, sizeof (char)); - sep = (char *) calloc (MAX_STRING_LEN, sizeof (char)); - sprintf (sep, " ,;\t\n\r"); - fprintf (stderr, "%s: Changing the output step as requested.\n", __func__); - - /* change the time step */ - fp = fopen ("umat_newstep.in", "r"); - - while (fgets (line, MAX_STRING_LEN, fp) != NULL) { - /* ignore comment and blank lines */ - if (line[0] == '%' || line[0] == '#' || (token = strtok (line, sep)) == NULL) { - continue; - } else if (strcasecmp (token, "NewStep") == 0) { - if ((token = strtok (NULL, sep)) != NULL) - signal_change_freq = atoi (token); - if (signal_change_freq <= 0) { - signal_change_freq = 0; - } - } else { - signal_change_freq = 0; - } - } - } else { - /* no change */ - signal_change_freq = 0; - fprintf (stderr, "%s:Returning with output flag set.\n", __func__); - } - return; - #endif /*JUNK*/ - }else{ - fprintf(stderr,"Signal %i not handled. Resetting... \n",signo); - signal (signo, catchit); - } - //longjmp (env, 1); - return; -} - -#ifdef GNU_TRAP_FPE -void enable_fpe_traps () -{ - /* - * This installs the SIGFPE signal handler and enables traps for - * - * debugging purposes. - */ - - fenv_t env; - int excepts; - - /* Enable exception trapping. */ - - excepts = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW; - feholdexcept (&env); /* start clean */ - if (feenableexcept (excepts) == -1) /* set traps */ - /* crash out if the traps can't even be set! */ - exit (1); -} -#endif - -/***************************************************/ -/* rcs id routine to include rcs id in the program */ -/* generated by make_rcs_sub.sh script */ -/***************************************************/ -char const *handlers_c () -{ - static char const rcsid[] = "$Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $"; - - return (rcsid); -} diff --git a/c_source_code/dezing/handlers.h b/c_source_code/dezing/handlers.h deleted file mode 100644 index 6b7913739..000000000 --- a/c_source_code/dezing/handlers.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Prototypes for the signal handler functions */ -/* Define GNU_TRAP_FPE if using GCC in order to catch floating point exceptions */ -/* This impacts the performance so don't do it all the time */ -#ifndef HANDLERS_H -# define HANDLERS_H - -# ifdef GNU_TRAP_FPE -# include -void enable_fpe_traps (); -# endif - /* GNU_TRAP_FPE */ - -extern void float_error (int signo); /* signal handler for sigfpe */ -extern void catchit (int signo); /* signal handler -- jump to finish_bb */ -#endif diff --git a/c_source_code/dezing/machine.h b/c_source_code/dezing/machine.h deleted file mode 100644 index f0a7a26e2..000000000 --- a/c_source_code/dezing/machine.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MACHINE_H -#define MACHINE_H -#define MAX_MESSAGE (1024) -#define Day (86400) -#define Hour (3600) -#define Minute (60) -#endif diff --git a/c_source_code/dezing/options.h b/c_source_code/dezing/options.h deleted file mode 100644 index cda75330c..000000000 --- a/c_source_code/dezing/options.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef OPTIONS_H -#define OPTIONS_H ("options.h svn id:$Id: options.h 376 2015-04-27 14:08:37Z kny48981 $") - -typedef struct Options_str { - char * indir,*outdir,*jobname,*fname,*dname; - char * settingsfolder; - char * infmt,*outfmt; - u_int8_t fftw_level; - u_int8_t f_call_num; - u_int8_t returnflag; - u_int8_t errflag; - u_int8_t warnflag; - u_int16_t nthreadsreq; - double uval; - size_t image_size; - size_t uncrop_image_size; - size_t image_size_bytes; - size_t outimage_size_bytes; - - size_t croptop; - size_t cropbot; - size_t cropleft; - size_t cropright; - size_t cropwd; - size_t croplen; - size_t inoffset; - - u_int32_t image_len; - u_int32_t nlines; - u_int32_t wd; - u_int32_t bytes; - u_int32_t obytes; - int32_t nsegs; - int32_t nperseg; - int32_t npad; - u_int32_t nproj; - u_int32_t timeout; - u_int32_t interval; - u_int32_t batchnum; - u_int32_t nchunks; - u_int32_t mychunk; - u_int8_t Dtype; - float energy; - float distance; - float pixelsize; - float beta; - float delta; - float deltaratio; - float outlier_mu; - unsigned char versionflag; // flag to just print versions and exit -}Options; - - - -typedef struct Flags_str{ - unsigned char D; - unsigned char Iflag; - unsigned char J; - unsigned char O; - unsigned char T; - unsigned char Z; - unsigned char S; - unsigned char a; - unsigned char b; - unsigned char d; - unsigned char f; - unsigned char h; - unsigned char i; - unsigned char l; - unsigned char m; - unsigned char o; - unsigned char p; - unsigned char s; - unsigned char u; - unsigned char v; - unsigned char w; - unsigned char z; - unsigned char crop; -}Flags ; -#endif diff --git a/c_source_code/dezing/setup.py b/c_source_code/dezing/setup.py deleted file mode 100644 index 34245e817..000000000 --- a/c_source_code/dezing/setup.py +++ /dev/null @@ -1,11 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext -#$Id: setup.py 465 2016-02-16 11:02:36Z kny48981 $ -setup( - cmdclass={'build_ext':build_ext}, - ext_modules=[ - Extension("dezing",["dezing.pyx"], - libraries=["dezing"]) - ] - ) diff --git a/c_source_code/dezing/test_main.c b/c_source_code/dezing/test_main.c deleted file mode 100644 index 457a836f8..000000000 --- a/c_source_code/dezing/test_main.c +++ /dev/null @@ -1,481 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "options.h" - -#include "handlers.h" -#include "timestamp.h" -#include "dezing_functions.h" - -#ifdef PCO_4000_FIX_BCD -# ifndef PCO_CROPTOP -# define PCO_CROPTOP (10) -# endif -#endif - -#ifndef NOPAUSE -#define NOPAUSE (10) /* microseconds */ -#endif - -#ifndef SHORTPAUSE -#define SHORTPAUSE (100000) /* microseconds */ -#endif - -#ifndef LONGPAUSE -#define LONGPAUSE (500000) /* microseconds */ -#endif -#ifndef NOPAUSE -#define NOPAUSE (100) /* microseconds */ -#endif - -#ifndef DEFAULT_DARK -#define DEFAULT_DARK (400) -#endif - -/* how many file numbers to look-ahead when running live */ -#ifndef LOOKAHEAD -#define LOOKAHEAD (5) -#endif - - -int nfix=10; - -extern char * optarg; -char * myhost; - -// some globals -extern unsigned char vflag; -const unsigned char True=1; -const unsigned char False=0; -static char * myname; -//extern int errno; - -Flags flags; - -static void svn_id_file(FILE * fp){ - fprintf(fp,"%s: SVN ID: $Id: test_main.c 347 2014-05-21 15:15:57Z kny48981 $\n",myname); - fprintf(fp,"%s: SVN URL: $URL: file:///home/kny48981/SVN/progs/dezing_cython/test_main.c $\n",myname); - fprintf(fp,"%s: SVN header ID: %s\n","options.h",OPTIONS_H); -} - -static void usage(int argc, char **argv){ - // while (( o = getopt(argc,argv, "S:B:d:m:I:O:D:i:o:l:w:b:s:p:u:n:hZ:z:vJ:a:f:") ) != -1){ - printf("Usage:\n"); - printf("%s [options]\n",argv[0]); - - printf("-i input dir (REQUIRED)\n"); - printf ("-o output dir (REQUIRED)\n"); - printf("\n"); - - printf("-I Input format string (default p_%%05d.tif)\n"); - printf("-O c-style string format for output files\n"); - printf("\n"); - printf("-S Settings folder (for log files etc) \n"); - printf("\n"); - - printf("-C crop start (left)\n"); - printf("-c crop width \n"); - printf("-T crop start (top)\n"); - printf("-t crop length (vertical)\n"); - printf("\n"); - - printf("-u outlier detection parameter \n"); - printf("\n"); - - - printf ("-s number of segments (default 1)\n"); - printf ("-p number of images per segment (default 100) \n"); - printf ("-n number of chunks (default 8)\n"); - printf ("-m my chunk number (default 0)\n"); - printf ("-a number of images in a batch (default 10 )\n"); - - printf ("-b input data type; bytes per pixel (default 2)\n"); - printf ("-Z timeout (default 3 seconds)\n" ); - printf ("-z check interval (default 1 second) \n"); - - printf ("-J job name (used to decorate output file names) \n"); - printf ("-v verbose messages\n"); -} - - -void zeroflags(Flags *f){ - memset(f,0,sizeof(Flags)); -} - - -void print_opts(Options *o, FILE * fp){ - fprintf(fp,"image_size_bytes: %llu\n",o->image_size_bytes); -} - -void free_opts(Options * o){ - free (o->indir); - free (o->outdir); - free (o->jobname); -} - - - - -int parseopts (int argc, char **argv,Options * options){ - int o; - unsigned char flagerr = 0; - char defaultjob[32]; - pid_t mypid; - mypid=getpid(); - snprintf(defaultjob,32,"p%u",(unsigned int)mypid); - - zeroflags (&flags); - options->bytes=2; /* default */ - options->obytes=2; /* default */ - options->batchnum=1; - options->nsegs=1; - options->wd=4008; - options->image_len=2672; - options->nchunks=16; - options->mychunk=0; - options->fname=strdup("flat.tif"); - options->infmt=strdup("p_%05d.tif"); - options->outfmt=strdup("p_%05d.tif"); - options->uval=0.01; - options->beta=1.0e-9; - options->energy=53.0; - options->distance=500; - options->pixelsize=10.0; - options->deltaratio=1e-3; - options->croptop=0; - options->cropbot=0; - options->cropleft=0; - options->cropright=0; - options->cropwd=0; - options->croplen=0; - options->fftw_level=0; - options->outlier_mu=2.5; - options->delta=options->deltaratio*options->beta; - options->versionflag=0; - flags.d=False; - flags.crop=False; - if (argc <= 1){ - usage(argc,argv); - exit(0); - } - - while (( o = getopt(argc,argv, "a:x:B:b:C:c:D:d:E:W:f:hI:i:J:l:m:n:O:o:p:s:S:T:t:u:vVw:X:Z:z:K:") ) != -1){ - - - - switch(o) { - case 'B': - options->beta=atof(optarg); - break; - case 'D': - options->delta=atof(optarg); - break; - case 'W': - options->fftw_level=(u_int8_t)(atoi(optarg)); - break; - - case 'K': - nfix=atoi(optarg); - break; - case 'V': - options->versionflag=1; - break; - - case 'C': - options->cropleft=atoi(optarg); - flags.crop=True; - break; - case 'c': - options->cropwd=atoi(optarg); - flags.crop=True; - break; - case 'T': - options->croptop=atoi(optarg); - flags.crop=True; - break; - case 't': - options->croplen=atoi(optarg); - flags.crop=True; - break; - - case 'E': - options->energy=atof(optarg); - break; - case 'x': - options->pixelsize=atof(optarg); - break; - case 'X': - options->distance=atof(optarg); - break; - case 'u': - options->outlier_mu=atof(optarg); - break; - - case 'S': - options->settingsfolder=strdup(optarg); - flags.S=True; - break; - - case 'i': - options->indir=strdup(optarg); - flags.i=True; - break; - case 'I': - options->infmt=strdup(optarg); - printf("Using infmt option\n"); - flags.Iflag=True; - break; - case 'O': - options->outfmt=strdup(optarg); - printf("Using outfmt option with %s\n",options->outfmt); - flags.O=True; - break; - case 'd': - options->dname=strdup(optarg); - flags.d=True; - if (strcasecmp(options->dname,"NONE") == 0){ - flags.d=False; - } - break; - case 'f': - options->fname=strdup(optarg); - flags.f=True; - break; - case 'o': - options->outdir=strdup(optarg); - flags.o=True; - break; - case 'J': - options->jobname=strdup(optarg); - flags.J=True; - break; - case 'a': - options->batchnum=atoi(optarg); - flags.a=True; - break; - case 'l': - options->image_len=atoi(optarg); - flags.h=True; - break; - case 'w': - options->wd=atoi(optarg); - flags.w=True; - break; - case 'b': - options->bytes=atoi(optarg); - flags.b=True; - break; - case 's': - options->nsegs=atoi(optarg); - flags.s=True; - break; - case 'p': - options->nperseg=atoi(optarg); - flags.p=True; - break; - case 'n': - options-> nchunks=atoi(optarg); - break; - case 'm': - options-> mychunk=atoi(optarg); - flags.m=True; - break; - case 'h': - usage(argc,argv); - exit(0); - break; - case 'Z': - options->timeout=atoi(optarg); - flags.Z=True; - break; - case 'z': - options->interval=atoi(optarg); - flags.z=True; - break; - case 'v': - flags.v=True; - break; - case '?': - printf( "Unhandled option\n"); - printf ("option %i (%c) value %s\n" , optopt,optopt,optarg); - usage(argc,argv); - //return(2); - break; - default: - printf( "Problem in parsing options\n"); - printf ("option %i value %s\n" , o,optarg); - usage(argc,argv); - return(2); - break; - } - } - - flagerr=False; - - - - if ( !(flags.h && flags.w)){ - errprint("Default values used for width or chunk length"); - } - - - if (flags.s == 0 ){ - errprint ("number of segments default used: 1"); - options->nsegs=1; - } - - if (flags.S == 0 ){ - /* default folder */ - options->settingsfolder=strdup("./"); - } - - if (flags.p == 0){ - errprint ("number of projections per segment default used: 100"); - options->nperseg=100; - } - - if ( !(flags.z)){ - errprint("time-out check interval default used"); - options->interval=1; - - } - if ( !(flags.Z)){ - errprint("time-out interval default used"); - options->timeout=3; - } - - if ( !(flags.i && flags.o)){ - errprint("FATAL: Input and Output directories must be specified"); - flagerr=True; - } - if ( !(flags.a )){ - options->batchnum=10; - errprint(" Number of images for a batch not specified using default 10"); - }else{ - if(options->batchnum < 1 ){ - errprint("FATAL: Cannot specify zero or negative number of images for averaging"); - flagerr=True; - } - } - - if (flagerr != False){ - errprint("Not all options were correctly specified"); - usage(argc,argv); - return(3); - } - - options->deltaratio=options->beta/options->delta; - - /* check for unsupported data types */ - if (flags.b == True) { - if (options->bytes != 2 ){ - errprint(" Only 2-byte data supported at present " ); - return(12); - } - } - /* check for too many files */ - if (options->image_len >= 3000){ - errprint("Processing not feasible with > 3000 rows"); - return(13); - } - /* put verbosity in global flag*/ - vflag=flags.v; - /* default job name */ - if (flags.J == False){ - options->jobname=strdup(defaultjob); - } - return(0); -}/* end of parseopts */ - - - -int main (int argc, char ** argv) { - Options ctrl; - u_int16_t * inarray; - u_int16_t * outarray; - u_int16_t width,length,batch; - u_int32_t allsize; - u_int32_t idx; - int i,j,k; - width=100; - length=100; - batch=50; - allsize=width*length*batch; - - ctrl.versionflag=0; - ctrl.versionflag=0; - ctrl.outlier_mu=0.7; - ctrl.cropwd=width; - ctrl.nlines=length; - - timestamp_open("test_main.log"); - timestamp_init(); - timestamp("allocating the main buffers"); - inarray=(u_int16_t *)calloc(allsize,sizeof(u_int16_t)); - outarray=(u_int16_t *)calloc(allsize,sizeof(u_int16_t)); - timestamp("finished allocating the main buffers"); - -// for (k=0;k`_ - -:Organization: - Laboratory for Fluorescence Dynamics, University of California, Irvine - -:Version: 2014.02.05 - -Requirements ------------- -* `CPython 2.7 or 3.3 `_ -* `Numpy 1.7 `_ -* `Matplotlib 1.3 `_ (optional for plotting) -* `Tifffile.c 2013.01.18 `_ - (recommended for faster decoding of PackBits and LZW encoded strings) - -Notes ------ -The API is not stable yet and might change between revisions. - -Tested on little-endian platforms only. - -Other Python packages and modules for reading bio-scientific TIFF files: -* `Imread `_ -* `PyLibTiff `_ -* `SimpleITK `_ -* `PyLSM `_ -* `PyMca.TiffIO.py `_ -* `BioImageXD.Readers `_ -* `Cellcognition.io `_ -* `CellProfiler.bioformats `_ - -Acknowledgements ----------------- -* Egor Zindy, University of Manchester, for cz_lsm_scan_info specifics. -* Wim Lewis for a bug fix and some read_cz_lsm functions. -* Hadrien Mary for help on reading MicroManager files. - -References ----------- -(1) TIFF 6.0 Specification and Supplements. Adobe Systems Incorporated. - http://partners.adobe.com/public/developer/tiff/ -(2) TIFF File Format FAQ. http://www.awaresystems.be/imaging/tiff/faq.html -(3) MetaMorph Stack (STK) Image File Format. - http://support.meta.moleculardevices.com/docs/t10243.pdf -(4) File Format Description - LSM 5xx Release 2.0. - http://ibb.gsf.de/homepage/karsten.rodenacker/IDL/Lsmfile.doc -(5) BioFormats. http://www.loci.wisc.edu/ome/formats.html -(6) The OME-TIFF format. - http://www.openmicroscopy.org/site/support/file-formats/ome-tiff -(7) TiffDecoder.java - http://rsbweb.nih.gov/ij/developer/source/ij/io/TiffDecoder.java.html -(8) UltraQuant(r) Version 6.0 for Windows Start-Up Guide. - http://www.ultralum.com/images%20ultralum/pdf/UQStart%20Up%20Guide.pdf -(9) Micro-Manager File Formats. - http://www.micro-manager.org/wiki/Micro-Manager_File_Formats - -Examples --------- ->>> data = numpy.random.rand(301, 219) ->>> imsave('temp.tif', data) ->>> image = imread('temp.tif') ->>> assert numpy.all(image == data) - ->>> tif = TiffFile('test.tif') ->>> images = tif.asarray() ->>> image0 = tif[0].asarray() ->>> for page in tif: -... for tag in page.tags.values(): -... t = tag.name, tag.value -... image = page.asarray() -... if page.is_rgb: pass -... if page.is_palette: -... t = page.color_map -... if page.is_stk: -... t = page.mm_uic_tags.number_planes -... if page.is_lsm: -... t = page.cz_lsm_info ->>> tif.close() - -""" - -from __future__ import division, print_function - -import sys -import os -import re -import glob -import math -import zlib -import time -import json -import struct -import warnings -import datetime -import collections -from fractions import Fraction -from xml.etree import cElementTree as ElementTree - -import numpy - -__version__ = '2014.02.05' -__docformat__ = 'restructuredtext en' -__all__ = ['imsave', 'imread', 'imshow', 'TiffFile', 'TiffSequence'] - - -def imsave(filename, data, photometric=None, planarconfig=None, - resolution=None, description=None, software='tifffile.py', - byteorder=None, bigtiff=False, compress=0, extratags=()): - """Write image data to TIFF file. - - Image data are written in one stripe per plane. - Dimensions larger than 2 or 3 (depending on photometric mode and - planar configuration) are flattened and saved as separate pages. - The 'sample_format' and 'bits_per_sample' TIFF tags are derived from - the data type. - - Parameters - ---------- - filename : str - Name of file to write. - data : array_like - Input image. The last dimensions are assumed to be image height, - width, and samples. - photometric : {'minisblack', 'miniswhite', 'rgb'} - The color space of the image data. - By default this setting is inferred from the data shape. - planarconfig : {'contig', 'planar'} - Specifies if samples are stored contiguous or in separate planes. - By default this setting is inferred from the data shape. - 'contig': last dimension contains samples. - 'planar': third last dimension contains samples. - resolution : (float, float) or ((int, int), (int, int)) - X and Y resolution in dots per inch as float or rational numbers. - description : str - The subject of the image. Saved with the first page only. - software : str - Name of the software used to create the image. - Saved with the first page only. - byteorder : {'<', '>'} - The endianness of the data in the file. - By default this is the system's native byte order. - bigtiff : bool - If True, the BigTIFF format is used. - By default the standard TIFF format is used for data less than 2000 MB. - compress : int - Values from 0 to 9 controlling the level of zlib compression. - If 0, data are written uncompressed (default). - extratags: sequence of tuples - Additional tags as [(code, dtype, count, value, writeonce)]. - code : int - The TIFF tag Id. - dtype : str - Data type of items in `value` in Python struct format. - One of B, s, H, I, 2I, b, h, i, f, d, Q, or q. - count : int - Number of data values. Not used for string values. - value : sequence - `Count` values compatible with `dtype`. - writeonce : bool - If True, the tag is written to the first page only. - - Examples - -------- - >>> data = numpy.ones((2, 5, 3, 301, 219), 'float32') * 0.5 - >>> imsave('temp.tif', data, compress=6) - - >>> data = numpy.ones((5, 301, 219, 3), 'uint8') + 127 - >>> value = u'{"shape": %s}' % str(list(data.shape)) - >>> imsave('temp.tif', data, extratags=[(270, 's', 0, value, True)]) - - """ - assert(photometric in (None, 'minisblack', 'miniswhite', 'rgb')) - assert(planarconfig in (None, 'contig', 'planar')) - assert(byteorder in (None, '<', '>')) - assert(0 <= compress <= 9) - - if byteorder is None: - byteorder = '<' if sys.byteorder == 'little' else '>' - - data = numpy.asarray(data, dtype=byteorder+data.dtype.char, order='C') - data_shape = shape = data.shape - data = numpy.atleast_2d(data) - - if not bigtiff and data.size * data.dtype.itemsize < 2000*2**20: - bigtiff = False - offset_size = 4 - tag_size = 12 - numtag_format = 'H' - offset_format = 'I' - val_format = '4s' - else: - bigtiff = True - offset_size = 8 - tag_size = 20 - numtag_format = 'Q' - offset_format = 'Q' - val_format = '8s' - - # unify shape of data - samplesperpixel = 1 - extrasamples = 0 - if photometric is None: - if data.ndim > 2 and (shape[-3] in (3, 4) or shape[-1] in (3, 4)): - photometric = 'rgb' - else: - photometric = 'minisblack' - if photometric == 'rgb': - if len(shape) < 3: - raise ValueError("not a RGB(A) image") - if planarconfig is None: - planarconfig = 'planar' if shape[-3] in (3, 4) else 'contig' - if planarconfig == 'contig': - if shape[-1] not in (3, 4): - raise ValueError("not a contiguous RGB(A) image") - data = data.reshape((-1, 1) + shape[-3:]) - samplesperpixel = shape[-1] - else: - if shape[-3] not in (3, 4): - raise ValueError("not a planar RGB(A) image") - data = data.reshape((-1, ) + shape[-3:] + (1, )) - samplesperpixel = shape[-3] - if samplesperpixel == 4: - extrasamples = 1 - elif planarconfig and len(shape) > 2: - if planarconfig == 'contig': - data = data.reshape((-1, 1) + shape[-3:]) - samplesperpixel = shape[-1] - else: - data = data.reshape((-1, ) + shape[-3:] + (1, )) - samplesperpixel = shape[-3] - extrasamples = samplesperpixel - 1 - else: - planarconfig = None - # remove trailing 1s - while len(shape) > 2 and shape[-1] == 1: - shape = shape[:-1] - data = data.reshape((-1, 1) + shape[-2:] + (1, )) - - shape = data.shape # (pages, planes, height, width, contig samples) - - bytestr = bytes if sys.version[0] == '2' else ( - lambda x: bytes(x, 'utf-8') if isinstance(x, str) else x) - tifftypes = {'B': 1, 's': 2, 'H': 3, 'I': 4, '2I': 5, 'b': 6, - 'h': 8, 'i': 9, 'f': 11, 'd': 12, 'Q': 16, 'q': 17} - tifftags = { - 'new_subfile_type': 254, 'subfile_type': 255, - 'image_width': 256, 'image_length': 257, 'bits_per_sample': 258, - 'compression': 259, 'photometric': 262, 'fill_order': 266, - 'document_name': 269, 'image_description': 270, 'strip_offsets': 273, - 'orientation': 274, 'samples_per_pixel': 277, 'rows_per_strip': 278, - 'strip_byte_counts': 279, 'x_resolution': 282, 'y_resolution': 283, - 'planar_configuration': 284, 'page_name': 285, 'resolution_unit': 296, - 'software': 305, 'datetime': 306, 'predictor': 317, 'color_map': 320, - 'extra_samples': 338, 'sample_format': 339} - tags = [] # list of (code, ifdentry, ifdvalue, writeonce) - - def pack(fmt, *val): - return struct.pack(byteorder+fmt, *val) - - def addtag(code, dtype, count, value, writeonce=False): - # compute ifdentry and ifdvalue bytes from code, dtype, count, value - # append (code, ifdentry, ifdvalue, writeonce) to tags list - code = tifftags[code] if code in tifftags else int(code) - if dtype not in tifftypes: - raise ValueError("unknown dtype %s" % dtype) - tifftype = tifftypes[dtype] - rawcount = count - if dtype == 's': - value = bytestr(value) + b'\0' - count = rawcount = len(value) - value = (value, ) - if len(dtype) > 1: - count *= int(dtype[:-1]) - dtype = dtype[-1] - ifdentry = [pack('HH', code, tifftype), - pack(offset_format, rawcount)] - ifdvalue = None - if count == 1: - if isinstance(value, (tuple, list)): - value = value[0] - ifdentry.append(pack(val_format, pack(dtype, value))) - elif struct.calcsize(dtype) * count <= offset_size: - ifdentry.append(pack(val_format, pack(str(count)+dtype, *value))) - else: - ifdentry.append(pack(offset_format, 0)) - ifdvalue = pack(str(count)+dtype, *value) - tags.append((code, b''.join(ifdentry), ifdvalue, writeonce)) - - def rational(arg, max_denominator=1000000): - # return nominator and denominator from float or two integers - try: - f = Fraction.from_float(arg) - except TypeError: - f = Fraction(arg[0], arg[1]) - f = f.limit_denominator(max_denominator) - return f.numerator, f.denominator - - if software: - addtag('software', 's', 0, software, writeonce=True) - if description: - addtag('image_description', 's', 0, description, writeonce=True) - elif shape != data_shape: - addtag('image_description', 's', 0, - "shape=(%s)" % (",".join('%i' % i for i in data_shape)), - writeonce=True) - addtag('datetime', 's', 0, - datetime.datetime.now().strftime("%Y:%m:%d %H:%M:%S"), - writeonce=True) - addtag('compression', 'H', 1, 32946 if compress else 1) - addtag('orientation', 'H', 1, 1) - addtag('image_width', 'I', 1, shape[-2]) - addtag('image_length', 'I', 1, shape[-3]) - addtag('new_subfile_type', 'I', 1, 0 if shape[0] == 1 else 2) - addtag('sample_format', 'H', 1, - {'u': 1, 'i': 2, 'f': 3, 'c': 6}[data.dtype.kind]) - addtag('photometric', 'H', 1, - {'miniswhite': 0, 'minisblack': 1, 'rgb': 2}[photometric]) - addtag('samples_per_pixel', 'H', 1, samplesperpixel) - if planarconfig: - addtag('planar_configuration', 'H', 1, 1 if planarconfig=='contig' - else 2) - addtag('bits_per_sample', 'H', samplesperpixel, - (data.dtype.itemsize * 8, ) * samplesperpixel) - else: - addtag('bits_per_sample', 'H', 1, data.dtype.itemsize * 8) - if extrasamples: - if photometric == 'rgb': - addtag('extra_samples', 'H', 1, 1) # alpha channel - else: - addtag('extra_samples', 'H', extrasamples, (0, ) * extrasamples) - if resolution: - addtag('x_resolution', '2I', 1, rational(resolution[0])) - addtag('y_resolution', '2I', 1, rational(resolution[1])) - addtag('resolution_unit', 'H', 1, 2) - addtag('rows_per_strip', 'I', 1, shape[-3]) - - # use one strip per plane - strip_byte_counts = (data[0, 0].size * data.dtype.itemsize, ) * shape[1] - addtag('strip_byte_counts', offset_format, shape[1], strip_byte_counts) - addtag('strip_offsets', offset_format, shape[1], (0, ) * shape[1]) - - # add extra tags from users - for t in extratags: - addtag(*t) - - # the entries in an IFD must be sorted in ascending order by tag code - tags = sorted(tags, key=lambda x: x[0]) - - with open(filename, 'wb') as fh: - seek = fh.seek - tell = fh.tell - - def write(arg, *args): - fh.write(pack(arg, *args) if args else arg) - - write({'<': b'II', '>': b'MM'}[byteorder]) - if bigtiff: - write('HHH', 43, 8, 0) - else: - write('H', 42) - ifd_offset = tell() - write(offset_format, 0) # first IFD - - for pageindex in range(shape[0]): - # update pointer at ifd_offset - pos = tell() - seek(ifd_offset) - write(offset_format, pos) - seek(pos) - - # write ifdentries - write(numtag_format, len(tags)) - tag_offset = tell() - write(b''.join(t[1] for t in tags)) - ifd_offset = tell() - write(offset_format, 0) # offset to next IFD - - # write tag values and patch offsets in ifdentries, if necessary - for tagindex, tag in enumerate(tags): - if tag[2]: - pos = tell() - seek(tag_offset + tagindex*tag_size + offset_size + 4) - write(offset_format, pos) - seek(pos) - if tag[0] == 273: - strip_offsets_offset = pos - elif tag[0] == 279: - strip_byte_counts_offset = pos - write(tag[2]) - - # write image data - data_offset = tell() - if compress: - strip_byte_counts = [] - for plane in data[pageindex]: - plane = zlib.compress(plane, compress) - strip_byte_counts.append(len(plane)) - fh.write(plane) - else: - # if this fails try update Python/numpy - data[pageindex].tofile(fh) - fh.flush() - - # update strip_offsets and strip_byte_counts if necessary - pos = tell() - for tagindex, tag in enumerate(tags): - if tag[0] == 273: # strip_offsets - if tag[2]: - seek(strip_offsets_offset) - strip_offset = data_offset - for size in strip_byte_counts: - write(offset_format, strip_offset) - strip_offset += size - else: - seek(tag_offset + tagindex*tag_size + offset_size + 4) - write(offset_format, data_offset) - elif tag[0] == 279: # strip_byte_counts - if compress: - if tag[2]: - seek(strip_byte_counts_offset) - for size in strip_byte_counts: - write(offset_format, size) - else: - seek(tag_offset + tagindex*tag_size + - offset_size + 4) - write(offset_format, strip_byte_counts[0]) - break - seek(pos) - fh.flush() - # remove tags that should be written only once - if pageindex == 0: - tags = [t for t in tags if not t[-1]] - - -def imread(files, *args, **kwargs): - """Return image data from TIFF file(s) as numpy array. - - The first image series is returned if no arguments are provided. - - Parameters - ---------- - files : str or list - File name, glob pattern, or list of file names. - key : int, slice, or sequence of page indices - Defines which pages to return as array. - series : int - Defines which series of pages in file to return as array. - multifile : bool - If True (default), OME-TIFF data may include pages from multiple files. - pattern : str - Regular expression pattern that matches axes names and indices in - file names. - - Examples - -------- - >>> im = imread('test.tif', 0) - >>> im.shape - (256, 256, 4) - >>> ims = imread(['test.tif', 'test.tif']) - >>> ims.shape - (2, 256, 256, 4) - - """ - kwargs_file = {} - if 'multifile' in kwargs: - kwargs_file['multifile'] = kwargs['multifile'] - del kwargs['multifile'] - else: - kwargs_file['multifile'] = True - kwargs_seq = {} - if 'pattern' in kwargs: - kwargs_seq['pattern'] = kwargs['pattern'] - del kwargs['pattern'] - - if isinstance(files, basestring) and any(i in files for i in '?*'): - files = glob.glob(files) - if not files: - raise ValueError('no files found') - if len(files) == 1: - files = files[0] - - if isinstance(files, basestring): - with TiffFile(files, **kwargs_file) as tif: - return tif.asarray(*args, **kwargs) - else: - with TiffSequence(files, **kwargs_seq) as imseq: - return imseq.asarray(*args, **kwargs) - - -class lazyattr(object): - """Lazy object attribute whose value is computed on first access.""" - __slots__ = ('func', ) - - def __init__(self, func): - self.func = func - - def __get__(self, instance, owner): - if instance is None: - return self - value = self.func(instance) - if value is NotImplemented: - return getattr(super(owner, instance), self.func.__name__) - setattr(instance, self.func.__name__, value) - return value - - -class TiffFile(object): - """Read image and meta-data from TIFF, STK, LSM, and FluoView files. - - TiffFile instances must be closed using the close method, which is - automatically called when using the 'with' statement. - - Attributes - ---------- - pages : list - All TIFF pages in file. - series : list of Records(shape, dtype, axes, TiffPages) - TIFF pages with compatible shapes and types. - micromanager_metadata: dict - Extra MicroManager non-TIFF metadata in the file, if exists. - - All attributes are read-only. - - Examples - -------- - >>> tif = TiffFile('test.tif') - ... try: - ... images = tif.asarray() - ... except Exception as e: - ... print(e) - ... finally: - ... tif.close() - - """ - def __init__(self, arg, name=None, multifile=False): - """Initialize instance from file. - - Parameters - ---------- - arg : str or open file - Name of file or open file object. - The file objects are closed in TiffFile.close(). - name : str - Human readable label of open file. - multifile : bool - If True, series may include pages from multiple files. - - """ - if isinstance(arg, basestring): - filename = os.path.abspath(arg) - self._fh = open(filename, 'rb') - else: - filename = str(name) - self._fh = arg - - self._fh.seek(0, 2) - self._fsize = self._fh.tell() - self._fh.seek(0) - self.fname = os.path.basename(filename) - self.fpath = os.path.dirname(filename) - self._tiffs = {self.fname: self} # cache of TiffFiles - self.offset_size = None - self.pages = [] - self._multifile = bool(multifile) - try: - self._fromfile() - except Exception: - self._fh.close() - raise - - def close(self): - """Close open file handle(s).""" - for tif in self._tiffs.values(): - if tif._fh: - tif._fh.close() - tif._fh = None - self._tiffs = {} - - def _fromfile(self): - """Read TIFF header and all page records from file.""" - self._fh.seek(0) - try: - self.byteorder = {b'II': '<', b'MM': '>'}[self._fh.read(2)] - except KeyError: - raise ValueError("not a valid TIFF file") - version = struct.unpack(self.byteorder+'H', self._fh.read(2))[0] - if version == 43: # BigTiff - self.offset_size, zero = struct.unpack(self.byteorder+'HH', - self._fh.read(4)) - if zero or self.offset_size != 8: - raise ValueError("not a valid BigTIFF file") - elif version == 42: - self.offset_size = 4 - else: - raise ValueError("not a TIFF file") - self.pages = [] - while True: - try: - page = TiffPage(self) - self.pages.append(page) - except StopIteration: - break - if not self.pages: - raise ValueError("empty TIFF file") - - if self.is_micromanager: - # MicroManager files contain metadata not stored in TIFF tags. - self.micromanager_metadata = read_micromanager_metadata(self._fh) - - @lazyattr - def series(self): - """Return series of TiffPage with compatible shape and properties.""" - series = [] - if self.is_ome: - series = self._omeseries() - elif self.is_fluoview: - dims = {b'X': 'X', b'Y': 'Y', b'Z': 'Z', b'T': 'T', - b'WAVELENGTH': 'C', b'TIME': 'T', b'XY': 'R', - b'EVENT': 'V', b'EXPOSURE': 'L'} - mmhd = list(reversed(self.pages[0].mm_header.dimensions)) - series = [Record( - axes=''.join(dims.get(i[0].strip().upper(), 'Q') - for i in mmhd if i[1] > 1), - shape=tuple(int(i[1]) for i in mmhd if i[1] > 1), - pages=self.pages, dtype=numpy.dtype(self.pages[0].dtype))] - elif self.is_lsm: - lsmi = self.pages[0].cz_lsm_info - axes = CZ_SCAN_TYPES[lsmi.scan_type] - if self.pages[0].is_rgb: - axes = axes.replace('C', '').replace('XY', 'XYC') - axes = axes[::-1] - shape = [getattr(lsmi, CZ_DIMENSIONS[i]) for i in axes] - pages = [p for p in self.pages if not p.is_reduced] - series = [Record(axes=axes, shape=shape, pages=pages, - dtype=numpy.dtype(pages[0].dtype))] - if len(pages) != len(self.pages): # reduced RGB pages - pages = [p for p in self.pages if p.is_reduced] - cp = 1 - i = 0 - while cp < len(pages) and i < len(shape)-2: - cp *= shape[i] - i += 1 - shape = shape[:i] + list(pages[0].shape) - axes = axes[:i] + 'CYX' - series.append(Record(axes=axes, shape=shape, pages=pages, - dtype=numpy.dtype(pages[0].dtype))) - elif self.is_imagej: - shape = [] - axes = [] - ij = self.pages[0].imagej_tags - if 'frames' in ij: - shape.append(ij['frames']) - axes.append('T') - if 'slices' in ij: - shape.append(ij['slices']) - axes.append('Z') - if 'channels' in ij and not self.is_rgb: - shape.append(ij['channels']) - axes.append('C') - remain = len(self.pages) // (numpy.prod(shape) if shape else 1) - if remain > 1: - shape.append(remain) - axes.append('I') - shape.extend(self.pages[0].shape) - axes.extend(self.pages[0].axes) - axes = ''.join(axes) - series = [Record(pages=self.pages, shape=shape, axes=axes, - dtype=numpy.dtype(self.pages[0].dtype))] - elif self.is_nih: - series = [Record(pages=self.pages, - shape=(len(self.pages),) + self.pages[0].shape, - axes='I' + self.pages[0].axes, - dtype=numpy.dtype(self.pages[0].dtype))] - elif self.pages[0].is_shaped: - shape = self.pages[0].tags['image_description'].value[7:-1] - shape = tuple(int(i) for i in shape.split(b',')) - series = [Record(pages=self.pages, shape=shape, - axes='Q' * len(shape), - dtype=numpy.dtype(self.pages[0].dtype))] - - if not series: - shapes = [] - pages = {} - for page in self.pages: - if not page.shape: - continue - shape = page.shape + (page.axes, - page.compression in TIFF_DECOMPESSORS) - if not shape in pages: - shapes.append(shape) - pages[shape] = [page] - else: - pages[shape].append(page) - series = [Record(pages=pages[s], - axes=(('I' + s[-2]) - if len(pages[s]) > 1 else s[-2]), - dtype=numpy.dtype(pages[s][0].dtype), - shape=((len(pages[s]), ) + s[:-2] - if len(pages[s]) > 1 else s[:-2])) - for s in shapes] - return series - - def asarray(self, key=None, series=None, memmap=False): - """Return image data of multiple TIFF pages as numpy array. - - By default the first image series is returned. - - Parameters - ---------- - key : int, slice, or sequence of page indices - Defines which pages to return as array. - series : int - Defines which series of pages to return as array. - memmap : bool - If True, use numpy.memmap to read arrays from file if possible. - - """ - if key is None and series is None: - series = 0 - if series is not None: - pages = self.series[series].pages - else: - pages = self.pages - - if key is None: - pass - elif isinstance(key, int): - pages = [pages[key]] - elif isinstance(key, slice): - pages = pages[key] - elif isinstance(key, collections.Iterable): - pages = [pages[k] for k in key] - else: - raise TypeError("key must be an int, slice, or sequence") - - if len(pages) == 1: - return pages[0].asarray(memmap=memmap) - elif self.is_nih: - result = numpy.vstack( - p.asarray(colormapped=False, squeeze=False, memmap=memmap) - for p in pages) - if pages[0].is_palette: - result = numpy.take(pages[0].color_map, result, axis=1) - result = numpy.swapaxes(result, 0, 1) - else: - if self.is_ome and any(p is None for p in pages): - firstpage = next(p for p in pages if p) - nopage = numpy.zeros_like(firstpage.asarray(memmap=memmap)) - result = numpy.vstack((p.asarray(memmap=memmap) if p else nopage) - for p in pages) - if key is None: - try: - result.shape = self.series[series].shape - except ValueError: - warnings.warn("failed to reshape %s to %s" % ( - result.shape, self.series[series].shape)) - result.shape = (-1,) + pages[0].shape - else: - result.shape = (-1,) + pages[0].shape - return result - - def _omeseries(self): - """Return image series in OME-TIFF file(s).""" - root = ElementTree.XML(self.pages[0].tags['image_description'].value) - uuid = root.attrib.get('UUID', None) - self._tiffs = {uuid: self} - modulo = {} - result = [] - for element in root: - if element.tag.endswith('BinaryOnly'): - warnings.warn("not an OME-TIFF master file") - break - if element.tag.endswith('StructuredAnnotations'): - for annot in element: - if not annot.attrib.get('Namespace', - '').endswith('modulo'): - continue - for value in annot: - for modul in value: - for along in modul: - if not along.tag[:-1].endswith('Along'): - continue - axis = along.tag[-1] - newaxis = along.attrib.get('Type', 'other') - newaxis = AXES_LABELS[newaxis] - if 'Start' in along.attrib: - labels = range( - int(along.attrib['Start']), - int(along.attrib['End']) + 1, - int(along.attrib.get('Step', 1))) - else: - labels = [label.text for label in along - if label.tag.endswith('Label')] - modulo[axis] = (newaxis, labels) - if not element.tag.endswith('Image'): - continue - for pixels in element: - if not pixels.tag.endswith('Pixels'): - continue - atr = pixels.attrib - axes = "".join(reversed(atr['DimensionOrder'])) - shape = list(int(atr['Size'+ax]) for ax in axes) - size = numpy.prod(shape[:-2]) - ifds = [None] * size - for data in pixels: - if not data.tag.endswith('TiffData'): - continue - atr = data.attrib - ifd = int(atr.get('IFD', 0)) - num = int(atr.get('NumPlanes', 1 if 'IFD' in atr else 0)) - num = int(atr.get('PlaneCount', num)) - idx = [int(atr.get('First'+ax, 0)) for ax in axes[:-2]] - idx = numpy.ravel_multi_index(idx, shape[:-2]) - for uuid in data: - if uuid.tag.endswith('UUID'): - if uuid.text not in self._tiffs: - if not self._multifile: - # abort reading multi file OME series - return [] - fn = uuid.attrib['FileName'] - try: - tf = TiffFile(os.path.join(self.fpath, fn)) - except (IOError, ValueError): - warnings.warn("failed to read %s" % fn) - break - self._tiffs[uuid.text] = tf - pages = self._tiffs[uuid.text].pages - try: - for i in range(num if num else len(pages)): - ifds[idx + i] = pages[ifd + i] - except IndexError: - warnings.warn("ome-xml: index out of range") - break - else: - pages = self.pages - try: - for i in range(num if num else len(pages)): - ifds[idx + i] = pages[ifd + i] - except IndexError: - warnings.warn("ome-xml: index out of range") - result.append(Record(axes=axes, shape=shape, pages=ifds, - dtype=numpy.dtype(ifds[0].dtype))) - - for record in result: - for axis, (newaxis, labels) in modulo.items(): - i = record.axes.index(axis) - size = len(labels) - if record.shape[i] == size: - record.axes = record.axes.replace(axis, newaxis, 1) - else: - record.shape[i] //= size - record.shape.insert(i+1, size) - record.axes = record.axes.replace(axis, axis+newaxis, 1) - - return result - - def __len__(self): - """Return number of image pages in file.""" - return len(self.pages) - - def __getitem__(self, key): - """Return specified page.""" - return self.pages[key] - - def __iter__(self): - """Return iterator over pages.""" - return iter(self.pages) - - def __str__(self): - """Return string containing information about file.""" - result = [ - self.fname.capitalize(), - format_size(self._fsize), - {'<': 'little endian', '>': 'big endian'}[self.byteorder]] - if self.is_bigtiff: - result.append("bigtiff") - if len(self.pages) > 1: - result.append("%i pages" % len(self.pages)) - if len(self.series) > 1: - result.append("%i series" % len(self.series)) - if len(self._tiffs) > 1: - result.append("%i files" % (len(self._tiffs))) - return ", ".join(result) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - @lazyattr - def fstat(self): - try: - return os.fstat(self._fh.fileno()) - except Exception: # io.UnsupportedOperation - return None - - @lazyattr - def is_bigtiff(self): - return self.offset_size != 4 - - @lazyattr - def is_rgb(self): - return all(p.is_rgb for p in self.pages) - - @lazyattr - def is_palette(self): - return all(p.is_palette for p in self.pages) - - @lazyattr - def is_mdgel(self): - return any(p.is_mdgel for p in self.pages) - - @lazyattr - def is_mediacy(self): - return any(p.is_mediacy for p in self.pages) - - @lazyattr - def is_stk(self): - return all(p.is_stk for p in self.pages) - - @lazyattr - def is_lsm(self): - return self.pages[0].is_lsm - - @lazyattr - def is_imagej(self): - return self.pages[0].is_imagej - - @lazyattr - def is_micromanager(self): - return self.pages[0].is_micromanager - - @lazyattr - def is_nih(self): - return self.pages[0].is_nih - - @lazyattr - def is_fluoview(self): - return self.pages[0].is_fluoview - - @lazyattr - def is_ome(self): - return self.pages[0].is_ome - - -class TiffPage(object): - """A TIFF image file directory (IFD). - - Attributes - ---------- - index : int - Index of page in file. - dtype : str {TIFF_SAMPLE_DTYPES} - Data type of image, colormapped if applicable. - shape : tuple - Dimensions of the image array in TIFF page, - colormapped and with one alpha channel if applicable. - axes : str - Axes label codes: - 'X' width, 'Y' height, 'S' sample, 'P' plane, 'I' image series, - 'Z' depth, 'C' color|em-wavelength|channel, 'E' ex-wavelength|lambda, - 'T' time, 'R' region|tile, 'A' angle, 'F' phase, 'H' lifetime, - 'L' exposure, 'V' event, 'Q' unknown, '_' missing - tags : TiffTags - Dictionary of tags in page. - Tag values are also directly accessible as attributes. - color_map : numpy array - Color look up table, if exists. - mm_uic_tags: Record(dict) - Consolidated MetaMorph mm_uic# tags, if exists. - cz_lsm_scan_info: Record(dict) - LSM scan info attributes, if exists. - imagej_tags: Record(dict) - Consolidated ImageJ description and metadata tags, if exists. - - All attributes are read-only. - - """ - def __init__(self, parent): - """Initialize instance from file.""" - self.parent = parent - self.index = len(parent.pages) - self.shape = self._shape = () - self.dtype = self._dtype = None - self.axes = "" - self.tags = TiffTags() - - self._fromfile() - self._process_tags() - - def _fromfile(self): - """Read TIFF IFD structure and its tags from file. - - File cursor must be at storage position of IFD offset and is left at - offset to next IFD. - - Raises StopIteration if offset (first bytes read) is 0. - - """ - fh = self.parent._fh - byteorder = self.parent.byteorder - offset_size = self.parent.offset_size - - fmt = {4: 'I', 8: 'Q'}[offset_size] - offset = struct.unpack(byteorder + fmt, fh.read(offset_size))[0] - if not offset: - raise StopIteration() - - # read standard tags - tags = self.tags - fh.seek(offset) - fmt, size = {4: ('H', 2), 8: ('Q', 8)}[offset_size] - try: - numtags = struct.unpack(byteorder + fmt, fh.read(size))[0] - except Exception: - warnings.warn("corrupted page list") - raise StopIteration() - - tagcode = 0 - for _ in range(numtags): - try: - tag = TiffTag(self.parent) - except TiffTag.Error as e: - warnings.warn(str(e)) - finally: - if tagcode > tag.code: - warnings.warn("tags are not ordered by code") - tagcode = tag.code - if not tag.name in tags: - tags[tag.name] = tag - else: - # some files contain multiple IFD with same code - # e.g. MicroManager files contain two image_description - for ext in ('_1', '_2', '_3'): - name = tag.name + ext - if not name in tags: - tags[name] = tag - break - - # read LSM info subrecords - if self.is_lsm: - pos = fh.tell() - for name, reader in CZ_LSM_INFO_READERS.items(): - try: - offset = self.cz_lsm_info['offset_'+name] - except KeyError: - continue - if not offset: - continue - fh.seek(offset) - try: - setattr(self, 'cz_lsm_'+name, reader(fh, byteorder)) - except ValueError: - pass - fh.seek(pos) - - def _process_tags(self): - """Validate standard tags and initialize attributes. - - Raise ValueError if tag values are not supported. - - """ - tags = self.tags - for code, (name, default, dtype, count, validate) in TIFF_TAGS.items(): - if not (name in tags or default is None): - tags[name] = TiffTag(code, dtype=dtype, count=count, - value=default, name=name) - if name in tags and validate: - try: - if tags[name].count == 1: - setattr(self, name, validate[tags[name].value]) - else: - setattr(self, name, tuple( - validate[value] for value in tags[name].value)) - except KeyError: - raise ValueError("%s.value (%s) not supported" % - (name, tags[name].value)) - - tag = tags['bits_per_sample'] - if tag.count == 1: - self.bits_per_sample = tag.value - else: - value = tag.value[:self.samples_per_pixel] - if any((v-value[0] for v in value)): - self.bits_per_sample = value - else: - self.bits_per_sample = value[0] - - tag = tags['sample_format'] - if tag.count == 1: - self.sample_format = TIFF_SAMPLE_FORMATS[tag.value] - else: - value = tag.value[:self.samples_per_pixel] - if any((v-value[0] for v in value)): - self.sample_format = [TIFF_SAMPLE_FORMATS[v] for v in value] - else: - self.sample_format = TIFF_SAMPLE_FORMATS[value[0]] - - if not 'photometric' in tags: - self.photometric = None - - if 'image_length' in tags: - self.strips_per_image = int(math.floor( - float(self.image_length + self.rows_per_strip - 1) / - self.rows_per_strip)) - else: - self.strips_per_image = 0 - - key = (self.sample_format, self.bits_per_sample) - self.dtype = self._dtype = TIFF_SAMPLE_DTYPES.get(key, None) - - if self.is_imagej: - # consolidate imagej meta data - if 'image_description_1' in self.tags: # MicroManager - adict = imagej_description(tags['image_description_1'].value) - else: - adict = imagej_description(tags['image_description'].value) - if 'imagej_metadata' in tags: - try: - adict.update(imagej_metadata( - tags['imagej_metadata'].value, - tags['imagej_byte_counts'].value, - self.parent.byteorder)) - except Exception as e: - warnings.warn(str(e)) - self.imagej_tags = Record(adict) - - if not 'image_length' in self.tags or not 'image_width' in self.tags: - # some GEL file pages are missing image data - self.image_length = 0 - self.image_width = 0 - self.strip_offsets = 0 - self._shape = () - self.shape = () - self.axes = '' - - if self.is_palette: - self.dtype = self.tags['color_map'].dtype[1] - self.color_map = numpy.array(self.color_map, self.dtype) - dmax = self.color_map.max() - if dmax < 256: - self.dtype = numpy.uint8 - self.color_map = self.color_map.astype(self.dtype) - #else: - # self.dtype = numpy.uint8 - # self.color_map >>= 8 - # self.color_map = self.color_map.astype(self.dtype) - self.color_map.shape = (3, -1) - - if self.is_stk: - # consolidate mm_uci tags - planes = tags['mm_uic2'].count - self.mm_uic_tags = Record(tags['mm_uic2'].value) - for key in ('mm_uic3', 'mm_uic4', 'mm_uic1'): - if key in tags: - self.mm_uic_tags.update(tags[key].value) - if self.planar_configuration == 'contig': - self._shape = (planes, 1, self.image_length, self.image_width, - self.samples_per_pixel) - self.shape = tuple(self._shape[i] for i in (0, 2, 3, 4)) - self.axes = 'PYXS' - else: - self._shape = (planes, self.samples_per_pixel, - self.image_length, self.image_width, 1) - self.shape = self._shape[:4] - self.axes = 'PSYX' - if self.is_palette and (self.color_map.shape[1] - >= 2**self.bits_per_sample): - self.shape = (3, planes, self.image_length, self.image_width) - self.axes = 'CPYX' - else: - warnings.warn("palette cannot be applied") - self.is_palette = False - elif self.is_palette: - samples = 1 - if 'extra_samples' in self.tags: - samples += len(self.extra_samples) - if self.planar_configuration == 'contig': - self._shape = ( - 1, 1, self.image_length, self.image_width, samples) - else: - self._shape = ( - 1, samples, self.image_length, self.image_width, 1) - if self.color_map.shape[1] >= 2**self.bits_per_sample: - self.shape = (3, self.image_length, self.image_width) - self.axes = 'CYX' - else: - warnings.warn("palette cannot be applied") - self.is_palette = False - self.shape = (self.image_length, self.image_width) - self.axes = 'YX' - elif self.is_rgb or self.samples_per_pixel > 1: - if self.planar_configuration == 'contig': - self._shape = (1, 1, self.image_length, self.image_width, - self.samples_per_pixel) - self.shape = (self.image_length, self.image_width, - self.samples_per_pixel) - self.axes = 'YXS' - else: - self._shape = (1, self.samples_per_pixel, self.image_length, - self.image_width, 1) - self.shape = self._shape[1:-1] - self.axes = 'SYX' - if self.is_rgb and 'extra_samples' in self.tags: - extra_samples = self.extra_samples - if self.tags['extra_samples'].count == 1: - extra_samples = (extra_samples, ) - for exs in extra_samples: - if exs in ('unassalpha', 'assocalpha', 'unspecified'): - if self.planar_configuration == 'contig': - self.shape = self.shape[:2] + (4,) - else: - self.shape = (4,) + self.shape[1:] - break - else: - self._shape = (1, 1, self.image_length, self.image_width, 1) - self.shape = self._shape[2:4] - self.axes = 'YX' - - if not self.compression and not 'strip_byte_counts' in tags: - self.strip_byte_counts = numpy.prod(self.shape) * ( - self.bits_per_sample // 8) - - def asarray(self, squeeze=True, colormapped=True, rgbonly=True, - memmap=False): - """Read image data from file and return as numpy array. - - Raise ValueError if format is unsupported. - If any argument is False, the shape of the returned array might be - different from the page shape. - - Parameters - ---------- - squeeze : bool - If True, all length-1 dimensions (except X and Y) are - squeezed out from result. - colormapped : bool - If True, color mapping is applied for palette-indexed images. - rgbonly : bool - If True, return RGB(A) image without additional extra samples. - memmap : bool - If True, use numpy.memmap to read array if possible. - - """ - fh = self.parent._fh - if not fh: - raise IOError("TIFF file is not open") - if self.dtype is None: - raise ValueError("data type not supported: %s%i" % ( - self.sample_format, self.bits_per_sample)) - if self.compression not in TIFF_DECOMPESSORS: - raise ValueError("cannot decompress %s" % self.compression) - if ('ycbcr_subsampling' in self.tags - and self.tags['ycbcr_subsampling'].value not in (1, (1, 1))): - raise ValueError("YCbCr subsampling not supported") - tag = self.tags['sample_format'] - if tag.count != 1 and any((i-tag.value[0] for i in tag.value)): - raise ValueError("sample formats don't match %s" % str(tag.value)) - - dtype = self._dtype - shape = self._shape - - if not shape: - return None - - image_width = self.image_width - image_length = self.image_length - typecode = self.parent.byteorder + dtype - bits_per_sample = self.bits_per_sample - byteorder_is_native = ({'big': '>', 'little': '<'}[sys.byteorder] == - self.parent.byteorder) - - if self.is_tiled: - if 'tile_offsets' in self.tags: - byte_counts = self.tile_byte_counts - offsets = self.tile_offsets - else: - byte_counts = self.strip_byte_counts - offsets = self.strip_offsets - tile_width = self.tile_width - tile_length = self.tile_length - tw = (image_width + tile_width - 1) // tile_width - tl = (image_length + tile_length - 1) // tile_length - shape = shape[:-3] + (tl*tile_length, tw*tile_width, shape[-1]) - tile_shape = (tile_length, tile_width, shape[-1]) - runlen = tile_width - else: - byte_counts = self.strip_byte_counts - offsets = self.strip_offsets - runlen = image_width - - try: - offsets[0] - except TypeError: - offsets = (offsets, ) - byte_counts = (byte_counts, ) - if any(o < 2 for o in offsets): - raise ValueError("corrupted page") - - if (not self.is_tiled and (self.is_stk or (not self.compression - and bits_per_sample in (8, 16, 32, 64) - and all(offsets[i] == offsets[i+1] - byte_counts[i] - for i in range(len(offsets)-1))))): - # contiguous data - if (memmap and not (self.is_tiled or self.predictor or - ('extra_samples' in self.tags) or - (colormapped and self.is_palette) or - (not byteorder_is_native))): - result = numpy.memmap(fh, typecode, 'r', offsets[0], shape) - else: - fh.seek(offsets[0]) - result = numpy_fromfile(fh, typecode, numpy.prod(shape)) - result = result.astype('=' + dtype) - else: - if self.planar_configuration == 'contig': - runlen *= self.samples_per_pixel - if bits_per_sample in (8, 16, 32, 64, 128): - if (bits_per_sample * runlen) % 8: - raise ValueError("data and sample size mismatch") - - def unpack(x): - return numpy.fromstring(x, typecode) - elif isinstance(bits_per_sample, tuple): - def unpack(x): - return unpackrgb(x, typecode, bits_per_sample) - else: - def unpack(x): - return unpackints(x, typecode, bits_per_sample, runlen) - decompress = TIFF_DECOMPESSORS[self.compression] - if self.is_tiled: - result = numpy.empty(shape, dtype) - tw, tl, pl = 0, 0, 0 - for offset, bytecount in zip(offsets, byte_counts): - fh.seek(offset) - tile = unpack(decompress(fh.read(bytecount))) - tile.shape = tile_shape - if self.predictor == 'horizontal': - numpy.cumsum(tile, axis=-2, dtype=dtype, out=tile) - result[0, pl, tl:tl+tile_length, - tw:tw+tile_width, :] = tile - del tile - tw += tile_width - if tw >= shape[-2]: - tw, tl = 0, tl + tile_length - if tl >= shape[-3]: - tl, pl = 0, pl + 1 - result = result[..., :image_length, :image_width, :] - else: - strip_size = (self.rows_per_strip * self.image_width * - self.samples_per_pixel) - result = numpy.empty(shape, dtype).reshape(-1) - index = 0 - for offset, bytecount in zip(offsets, byte_counts): - fh.seek(offset) - strip = fh.read(bytecount) - strip = unpack(decompress(strip)) - size = min(result.size, strip.size, strip_size, - result.size - index) - result[index:index+size] = strip[:size] - del strip - index += size - - result.shape = self._shape - - if self.predictor == 'horizontal' and not self.is_tiled: - # work around bug in LSM510 software - if not (self.parent.is_lsm and not self.compression): - numpy.cumsum(result, axis=-2, dtype=dtype, out=result) - - if colormapped and self.is_palette: - if self.color_map.shape[1] >= 2**bits_per_sample: - # FluoView and LSM might fail here - result = numpy.take(self.color_map, - result[:, 0, :, :, 0], axis=1) - elif rgbonly and self.is_rgb and 'extra_samples' in self.tags: - # return only RGB and first alpha channel if exists - extra_samples = self.extra_samples - if self.tags['extra_samples'].count == 1: - extra_samples = (extra_samples, ) - for i, exs in enumerate(extra_samples): - if exs in ('unassalpha', 'assocalpha', 'unspecified'): - if self.planar_configuration == 'contig': - result = result[..., [0, 1, 2, 3+i]] - else: - result = result[:, [0, 1, 2, 3+i]] - break - else: - if self.planar_configuration == 'contig': - result = result[..., :3] - else: - result = result[:, :3] - - if squeeze: - try: - result.shape = self.shape - except ValueError: - warnings.warn("failed to reshape from %s to %s" % ( - str(result.shape), str(self.shape))) - - return result - - def __str__(self): - """Return string containing information about page.""" - s = ', '.join(s for s in ( - ' x '.join(str(i) for i in self.shape), - str(numpy.dtype(self.dtype)), - '%s bit' % str(self.bits_per_sample), - self.photometric if 'photometric' in self.tags else '', - self.compression if self.compression else 'raw', - '|'.join(t[3:] for t in ( - 'is_stk', 'is_lsm', 'is_nih', 'is_ome', 'is_imagej', - 'is_micromanager', 'is_fluoview', 'is_mdgel', 'is_mediacy', - 'is_reduced', 'is_tiled') if getattr(self, t))) if s) - return "Page %i: %s" % (self.index, s) - - def __getattr__(self, name): - """Return tag value.""" - if name in self.tags: - value = self.tags[name].value - setattr(self, name, value) - return value - raise AttributeError(name) - - @lazyattr - def is_rgb(self): - """True if page contains a RGB image.""" - return ('photometric' in self.tags and - self.tags['photometric'].value == 2) - - @lazyattr - def is_palette(self): - """True if page contains a palette-colored image.""" - return ('photometric' in self.tags and - self.tags['photometric'].value == 3) - - @lazyattr - def is_tiled(self): - """True if page contains tiled image.""" - return 'tile_width' in self.tags - - @lazyattr - def is_reduced(self): - """True if page is a reduced image of another image.""" - return bool(self.tags['new_subfile_type'].value & 1) - - @lazyattr - def is_mdgel(self): - """True if page contains md_file_tag tag.""" - return 'md_file_tag' in self.tags - - @lazyattr - def is_mediacy(self): - """True if page contains Media Cybernetics Id tag.""" - return ('mc_id' in self.tags and - self.tags['mc_id'].value.startswith(b'MC TIFF')) - - @lazyattr - def is_stk(self): - """True if page contains MM_UIC2 tag.""" - return 'mm_uic2' in self.tags - - @lazyattr - def is_lsm(self): - """True if page contains LSM CZ_LSM_INFO tag.""" - return 'cz_lsm_info' in self.tags - - @lazyattr - def is_fluoview(self): - """True if page contains FluoView MM_STAMP tag.""" - return 'mm_stamp' in self.tags - - @lazyattr - def is_nih(self): - """True if page contains NIH image header.""" - return 'nih_image_header' in self.tags - - @lazyattr - def is_ome(self): - """True if page contains OME-XML in image_description tag.""" - return ('image_description' in self.tags and self.tags[ - 'image_description'].value.startswith(b' parent.offset_size or code in CUSTOM_TAGS: - pos = fh.tell() - tof = {4: 'I', 8: 'Q'}[parent.offset_size] - self.value_offset = offset = struct.unpack(byteorder+tof, value)[0] - if offset < 0 or offset > parent._fsize: - raise TiffTag.Error("corrupt file - invalid tag value offset") - elif offset < 4: - raise TiffTag.Error("corrupt value offset for tag %i" % code) - fh.seek(offset) - if code in CUSTOM_TAGS: - readfunc = CUSTOM_TAGS[code][1] - value = readfunc(fh, byteorder, dtype, count) - fh.seek(0, 2) # bug in numpy/Python 3.x ? - if isinstance(value, dict): # numpy.core.records.record - value = Record(value) - elif code in TIFF_TAGS or dtype[-1] == 's': - value = struct.unpack(fmt, fh.read(size)) - else: - value = read_numpy(fh, byteorder, dtype, count) - fh.seek(0, 2) # bug in numpy/Python 3.x ? - fh.seek(pos) - else: - value = struct.unpack(fmt, value[:size]) - - if not code in CUSTOM_TAGS: - if len(value) == 1: - value = value[0] - - if dtype.endswith('s') and isinstance(value, bytes): - value = stripnull(value) - - self.code = code - self.name = name - self.dtype = dtype - self.count = count - self.value = value - - def __str__(self): - """Return string containing information about tag.""" - return ' '.join(str(getattr(self, s)) for s in self.__slots__) - - -class TiffSequence(object): - """Sequence of image files. - - Properties - ---------- - files : list - List of file names. - shape : tuple - Shape of image sequence. - axes : str - Labels of axes in shape. - - Examples - -------- - >>> ims = TiffSequence("test.oif.files/*.tif") - >>> ims = ims.asarray() - >>> ims.shape - (2, 100, 256, 256) - - """ - _axes_pattern = """ - # matches Olympus OIF and Leica TIFF series - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4})) - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - """ - - class _ParseError(Exception): - pass - - def __init__(self, files, imread=TiffFile, pattern='axes'): - """Initialize instance from multiple files. - - Parameters - ---------- - files : str, or sequence of str - Glob pattern or sequence of file names. - imread : function or class - Image read function or class with asarray function returning numpy - array from single file. - pattern : str - Regular expression pattern that matches axes names and sequence - indices in file names. - - """ - if isinstance(files, basestring): - files = natural_sorted(glob.glob(files)) - files = list(files) - if not files: - raise ValueError("no files found") - #if not os.path.isfile(files[0]): - # raise ValueError("file not found") - self.files = files - - if hasattr(imread, 'asarray'): - _imread = imread - - def imread(fname, *args, **kwargs): - with _imread(fname) as im: - return im.asarray(*args, **kwargs) - - self.imread = imread - - self.pattern = self._axes_pattern if pattern == 'axes' else pattern - try: - self._parse() - if not self.axes: - self.axes = 'I' - except self._ParseError: - self.axes = 'I' - self.shape = (len(files),) - self._start_index = (0,) - self._indices = ((i,) for i in range(len(files))) - - def __str__(self): - """Return string with information about image sequence.""" - return "\n".join([ - self.files[0], - '* files: %i' % len(self.files), - '* axes: %s' % self.axes, - '* shape: %s' % str(self.shape)]) - - def __len__(self): - return len(self.files) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - pass - - def asarray(self, *args, **kwargs): - """Read image data from all files and return as single numpy array. - - Raise IndexError if image shapes don't match. - - """ - im = self.imread(self.files[0]) - result_shape = self.shape + im.shape - result = numpy.zeros(result_shape, dtype=im.dtype) - result = result.reshape(-1, *im.shape) - for index, fname in zip(self._indices, self.files): - index = [i-j for i, j in zip(index, self._start_index)] - index = numpy.ravel_multi_index(index, self.shape) - im = self.imread(fname, *args, **kwargs) - result[index] = im - result.shape = result_shape - return result - - def _parse(self): - """Get axes and shape from file names.""" - if not self.pattern: - raise self._ParseError("invalid pattern") - pattern = re.compile(self.pattern, re.IGNORECASE | re.VERBOSE) - matches = pattern.findall(self.files[0]) - if not matches: - raise self._ParseError("pattern doesn't match file names") - matches = matches[-1] - if len(matches) % 2: - raise self._ParseError("pattern doesn't match axis name and index") - axes = ''.join(m for m in matches[::2] if m) - if not axes: - raise self._ParseError("pattern doesn't match file names") - - indices = [] - for fname in self.files: - matches = pattern.findall(fname)[-1] - if axes != ''.join(m for m in matches[::2] if m): - raise ValueError("axes don't match within the image sequence") - indices.append([int(m) for m in matches[1::2] if m]) - shape = tuple(numpy.max(indices, axis=0)) - start_index = tuple(numpy.min(indices, axis=0)) - shape = tuple(i-j+1 for i, j in zip(shape, start_index)) - if numpy.prod(shape) != len(self.files): - warnings.warn("files are missing. Missing data are zeroed") - - self.axes = axes.upper() - self.shape = shape - self._indices = indices - self._start_index = start_index - - -class Record(dict): - """Dictionary with attribute access. - - Can also be initialized with numpy.core.records.record. - - """ - __slots__ = () - - def __init__(self, arg=None, **kwargs): - if kwargs: - arg = kwargs - elif arg is None: - arg = {} - try: - dict.__init__(self, arg) - except (TypeError, ValueError): - for i, name in enumerate(arg.dtype.names): - v = arg[i] - self[name] = v if v.dtype.char != 'S' else stripnull(v) - - def __getattr__(self, name): - return self[name] - - def __setattr__(self, name, value): - self.__setitem__(name, value) - - def __str__(self): - """Pretty print Record.""" - s = [] - lists = [] - for k in sorted(self): - if k.startswith('_'): # does not work with byte - continue - v = self[k] - if isinstance(v, (list, tuple)) and len(v): - if isinstance(v[0], Record): - lists.append((k, v)) - continue - elif isinstance(v[0], TiffPage): - v = [i.index for i in v if i] - s.append( - ("* %s: %s" % (k, str(v))).split("\n", 1)[0] - [:PRINT_LINE_LEN].rstrip()) - for k, v in lists: - l = [] - for i, w in enumerate(v): - l.append("* %s[%i]\n %s" % (k, i, - str(w).replace("\n", "\n "))) - s.append('\n'.join(l)) - return '\n'.join(s) - - -class TiffTags(Record): - """Dictionary of TiffTags with attribute access.""" - def __str__(self): - """Return string with information about all tags.""" - s = [] - for tag in sorted(self.values(), key=lambda x: x.code): - typecode = "%i%s" % (tag.count * int(tag.dtype[0]), tag.dtype[1]) - line = "* %i %s (%s) %s" % (tag.code, tag.name, typecode, - str(tag.value).split('\n', 1)[0]) - s.append(line[:PRINT_LINE_LEN].lstrip()) - return '\n'.join(s) - - -def read_bytes(fh, byteorder, dtype, count): - """Read tag data from file and return as byte string.""" - return numpy_fromfile(fh, byteorder+dtype[-1], count).tostring() - - -def read_numpy(fh, byteorder, dtype, count): - """Read tag data from file and return as numpy array.""" - return numpy_fromfile(fh, byteorder+dtype[-1], count) - - -def read_json(fh, byteorder, dtype, count): - """Read tag data from file and return as object.""" - return json.loads(unicode(stripnull(fh.read(count)), 'utf-8')) - - -def read_mm_header(fh, byteorder, dtype, count): - """Read MM_HEADER tag from file and return as numpy.rec.array.""" - return numpy.rec.fromfile(fh, MM_HEADER, 1, byteorder=byteorder)[0] - - -def read_mm_stamp(fh, byteorder, dtype, count): - """Read MM_STAMP tag from file and return as numpy.array.""" - return numpy_fromfile(fh, byteorder+'8f8', 1)[0] - - -def read_mm_uic1(fh, byteorder, dtype, count): - """Read MM_UIC1 tag from file and return as dictionary.""" - t = fh.read(8*count) - t = struct.unpack('%s%iI' % (byteorder, 2*count), t) - return dict((MM_TAG_IDS[k], v) for k, v in zip(t[::2], t[1::2]) - if k in MM_TAG_IDS) - - -def read_mm_uic2(fh, byteorder, dtype, count): - """Read MM_UIC2 tag from file and return as dictionary.""" - result = {'number_planes': count} - values = numpy_fromfile(fh, byteorder+'I', 6*count) - result['z_distance'] = values[0::6] // values[1::6] - #result['date_created'] = tuple(values[2::6]) - #result['time_created'] = tuple(values[3::6]) - #result['date_modified'] = tuple(values[4::6]) - #result['time_modified'] = tuple(values[5::6]) - return result - - -def read_mm_uic3(fh, byteorder, dtype, count): - """Read MM_UIC3 tag from file and return as dictionary.""" - t = numpy_fromfile(fh, byteorder+'I', 2*count) - return {'wavelengths': t[0::2] // t[1::2]} - - -def read_mm_uic4(fh, byteorder, dtype, count): - """Read MM_UIC4 tag from file and return as dictionary.""" - t = struct.unpack(byteorder + 'hI'*count, fh.read(6*count)) - return dict((MM_TAG_IDS[k], v) for k, v in zip(t[::2], t[1::2]) - if k in MM_TAG_IDS) - - -def read_cz_lsm_info(fh, byteorder, dtype, count): - """Read CS_LSM_INFO tag from file and return as numpy.rec.array.""" - result = numpy.rec.fromfile(fh, CZ_LSM_INFO, 1, - byteorder=byteorder)[0] - {50350412: '1.3', 67127628: '2.0'}[result.magic_number] # validation - return result - - -def read_cz_lsm_time_stamps(fh, byteorder): - """Read LSM time stamps from file and return as list.""" - size, count = struct.unpack(byteorder+'II', fh.read(8)) - if size != (8 + 8 * count): - raise ValueError("lsm_time_stamps block is too short") - return struct.unpack(('%s%dd' % (byteorder, count)), - fh.read(8*count)) - - -def read_cz_lsm_event_list(fh, byteorder): - """Read LSM events from file and return as list of (time, type, text).""" - count = struct.unpack(byteorder+'II', fh.read(8))[1] - events = [] - while count > 0: - esize, etime, etype = struct.unpack(byteorder+'IdI', fh.read(16)) - etext = stripnull(fh.read(esize - 16)) - events.append((etime, etype, etext)) - count -= 1 - return events - - -def read_cz_lsm_scan_info(fh, byteorder): - """Read LSM scan information from file and return as Record.""" - block = Record() - blocks = [block] - unpack = struct.unpack - if 0x10000000 != struct.unpack(byteorder+"I", fh.read(4))[0]: - raise ValueError("not a lsm_scan_info structure") - fh.read(8) - while True: - entry, dtype, size = unpack(byteorder+"III", fh.read(12)) - if dtype == 2: - value = stripnull(fh.read(size)) - elif dtype == 4: - value = unpack(byteorder+"i", fh.read(4))[0] - elif dtype == 5: - value = unpack(byteorder+"d", fh.read(8))[0] - else: - value = 0 - if entry in CZ_LSM_SCAN_INFO_ARRAYS: - blocks.append(block) - name = CZ_LSM_SCAN_INFO_ARRAYS[entry] - newobj = [] - setattr(block, name, newobj) - block = newobj - elif entry in CZ_LSM_SCAN_INFO_STRUCTS: - blocks.append(block) - newobj = Record() - block.append(newobj) - block = newobj - elif entry in CZ_LSM_SCAN_INFO_ATTRIBUTES: - name = CZ_LSM_SCAN_INFO_ATTRIBUTES[entry] - setattr(block, name, value) - elif entry == 0xffffffff: - block = blocks.pop() - else: - setattr(block, "unknown_%x" % entry, value) - if not blocks: - break - return block - - -def read_nih_image_header(fh, byteorder, dtype, count): - """Read NIH_IMAGE_HEADER tag from file and return as numpy.rec.array.""" - a = numpy.rec.fromfile(fh, NIH_IMAGE_HEADER, 1, byteorder=byteorder)[0] - a = a.newbyteorder(byteorder) - a.xunit = a.xunit[:a._xunit_len] - a.um = a.um[:a._um_len] - return a - - -def imagej_metadata(data, bytecounts, byteorder): - """Return dict from ImageJ meta data tag value.""" - - _str = str if sys.version_info[0] < 3 else lambda x: str(x, 'cp1252') - - def read_string(data, byteorder): - return _str(stripnull(data[0 if byteorder == '<' else 1::2])) - - def read_double(data, byteorder): - return struct.unpack(byteorder+('d' * (len(data) // 8)), data) - - def read_bytes(data, byteorder): - #return struct.unpack('b' * len(data), data) - return numpy.fromstring(data, 'uint8') - - metadata_types = { # big endian - b'info': ('info', read_string), - b'labl': ('labels', read_string), - b'rang': ('ranges', read_double), - b'luts': ('luts', read_bytes), - b'roi ': ('roi', read_bytes), - b'over': ('overlays', read_bytes)} - metadata_types.update( # little endian - dict((k[::-1], v) for k, v in metadata_types.items())) - - if not bytecounts: - raise ValueError("no ImageJ meta data") - - if not data[:4] in (b'IJIJ', b'JIJI'): - raise ValueError("invalid ImageJ meta data") - - header_size = bytecounts[0] - if header_size < 12 or header_size > 804: - raise ValueError("invalid ImageJ meta data header size") - - ntypes = (header_size - 4) // 8 - header = struct.unpack(byteorder+'4sI'*ntypes, data[4:4+ntypes*8]) - pos = 4 + ntypes * 8 - counter = 0 - result = {} - for mtype, count in zip(header[::2], header[1::2]): - values = [] - name, func = metadata_types.get(mtype, (_str(mtype), read_bytes)) - for _ in range(count): - counter += 1 - pos1 = pos + bytecounts[counter] - values.append(func(data[pos:pos1], byteorder)) - pos = pos1 - result[name.strip()] = values[0] if count == 1 else values - return result - - -def imagej_description(description): - """Return dict from ImageJ image_description tag.""" - def _bool(val): - return {b'true': True, b'false': False}[val.lower()] - - _str = str if sys.version_info[0] < 3 else lambda x: str(x, 'cp1252') - result = {} - for line in description.splitlines(): - try: - key, val = line.split(b'=') - except Exception: - continue - key = key.strip() - val = val.strip() - for dtype in (int, float, _bool, _str): - try: - val = dtype(val) - break - except Exception: - pass - result[_str(key)] = val - return result - - -def read_micromanager_metadata(fh): - """Read MicroManager non-TIFF settings from open file and return as dict. - - The settings can be used to read image data without parsing the TIFF file. - - Raise ValueError if file does not contain valid MicroManager metadata. - - """ - fh.seek(0) - try: - byteorder = {b'II': '<', b'MM': '>'}[fh.read(2)] - except IndexError: - raise ValueError("not a MicroManager TIFF file") - - results = {} - fh.seek(8) - (index_header, index_offset, display_header, display_offset, - comments_header, comments_offset, summary_header, summary_length - ) = struct.unpack(byteorder + "IIIIIIII", fh.read(32)) - - if summary_header != 2355492: - raise ValueError("invalid MicroManager summary_header") - results['summary'] = read_json(fh, byteorder, None, summary_length) - - if index_header != 54773648: - raise ValueError("invalid MicroManager index_header") - fh.seek(index_offset) - header, count = struct.unpack(byteorder + "II", fh.read(8)) - if header != 3453623: - raise ValueError("invalid MicroManager index_header") - data = struct.unpack(byteorder + "IIIII"*count, fh.read(20*count)) - results['index_map'] = { - 'channel': data[::5], 'slice': data[1::5], 'frame': data[2::5], - 'position': data[3::5], 'offset': data[4::5]} - - if display_header != 483765892: - raise ValueError("invalid MicroManager display_header") - fh.seek(display_offset) - header, count = struct.unpack(byteorder + "II", fh.read(8)) - if header != 347834724: - raise ValueError("invalid MicroManager display_header") - results['display_settings'] = read_json(fh, byteorder, None, count) - - if comments_header != 99384722: - raise ValueError("invalid MicroManager comments_header") - fh.seek(comments_offset) - header, count = struct.unpack(byteorder + "II", fh.read(8)) - if header != 84720485: - raise ValueError("invalid MicroManager comments_header") - results['comments'] = read_json(fh, byteorder, None, count) - - return results - - -def _replace_by(module_function, package=None, warn=True): - """Try replace decorated function by module.function.""" - try: - from importlib import import_module - except ImportError: - warnings.warn('Could not import module importlib') - return lambda func: func - - def decorate(func, module_function=module_function, warn=warn): - try: - module, function = module_function.split('.') - if not package: - module = import_module(module) - else: - module = import_module('.' + module, package=package) - func, oldfunc = getattr(module, function), func - globals()['__old_' + func.__name__] = oldfunc - except Exception: - if warn: - warnings.warn("failed to import %s" % module_function) - return func - - return decorate - - -@_replace_by('_tifffile.decodepackbits') -def decodepackbits(encoded): - """Decompress PackBits encoded byte string. - - PackBits is a simple byte-oriented run-length compression scheme. - - """ - func = ord if sys.version[0] == '2' else lambda x: x - result = [] - result_extend = result.extend - i = 0 - try: - while True: - n = func(encoded[i]) + 1 - i += 1 - if n < 129: - result_extend(encoded[i:i+n]) - i += n - elif n > 129: - result_extend(encoded[i:i+1] * (258-n)) - i += 1 - except IndexError: - pass - return b''.join(result) if sys.version[0] == '2' else bytes(result) - - -@_replace_by('_tifffile.decodelzw') -def decodelzw(encoded): - """Decompress LZW (Lempel-Ziv-Welch) encoded TIFF strip (byte string). - - The strip must begin with a CLEAR code and end with an EOI code. - - This is an implementation of the LZW decoding algorithm described in (1). - It is not compatible with old style LZW compressed files like quad-lzw.tif. - - """ - len_encoded = len(encoded) - bitcount_max = len_encoded * 8 - unpack = struct.unpack - - if sys.version[0] == '2': - newtable = [chr(i) for i in range(256)] - else: - newtable = [bytes([i]) for i in range(256)] - newtable.extend((0, 0)) - - def next_code(): - """Return integer of `bitw` bits at `bitcount` position in encoded.""" - start = bitcount // 8 - s = encoded[start:start+4] - try: - code = unpack('>I', s)[0] - except Exception: - code = unpack('>I', s + b'\x00'*(4-len(s)))[0] - code <<= bitcount % 8 - code &= mask - return code >> shr - - switchbitch = { # code: bit-width, shr-bits, bit-mask - 255: (9, 23, int(9*'1'+'0'*23, 2)), - 511: (10, 22, int(10*'1'+'0'*22, 2)), - 1023: (11, 21, int(11*'1'+'0'*21, 2)), - 2047: (12, 20, int(12*'1'+'0'*20, 2)), } - bitw, shr, mask = switchbitch[255] - bitcount = 0 - - if len_encoded < 4: - raise ValueError("strip must be at least 4 characters long") - - if next_code() != 256: - raise ValueError("strip must begin with CLEAR code") - - code = 0 - oldcode = 0 - result = [] - result_append = result.append - while True: - code = next_code() # ~5% faster when inlining this function - bitcount += bitw - if code == 257 or bitcount >= bitcount_max: # EOI - break - if code == 256: # CLEAR - table = newtable[:] - table_append = table.append - lentable = 258 - bitw, shr, mask = switchbitch[255] - code = next_code() - bitcount += bitw - if code == 257: # EOI - break - result_append(table[code]) - else: - if code < lentable: - decoded = table[code] - newcode = table[oldcode] + decoded[:1] - else: - newcode = table[oldcode] - newcode += newcode[:1] - decoded = newcode - result_append(decoded) - table_append(newcode) - lentable += 1 - oldcode = code - if lentable in switchbitch: - bitw, shr, mask = switchbitch[lentable] - - if code != 257: - warnings.warn( - "decodelzw encountered unexpected end of stream (code %i)" % code) - - return b''.join(result) - - -@_replace_by('_tifffile.unpackints') -def unpackints(data, dtype, itemsize, runlen=0): - """Decompress byte string to array of integers of any bit size <= 32. - - Parameters - ---------- - data : byte str - Data to decompress. - dtype : numpy.dtype or str - A numpy boolean or integer type. - itemsize : int - Number of bits per integer. - runlen : int - Number of consecutive integers, after which to start at next byte. - - """ - if itemsize == 1: # bitarray - data = numpy.fromstring(data, '|B') - data = numpy.unpackbits(data) - if runlen % 8: - data = data.reshape(-1, runlen + (8 - runlen % 8)) - data = data[:, :runlen].reshape(-1) - return data.astype(dtype) - - dtype = numpy.dtype(dtype) - if itemsize in (8, 16, 32, 64): - return numpy.fromstring(data, dtype) - if itemsize < 1 or itemsize > 32: - raise ValueError("itemsize out of range: %i" % itemsize) - if dtype.kind not in "biu": - raise ValueError("invalid dtype") - - itembytes = next(i for i in (1, 2, 4, 8) if 8 * i >= itemsize) - if itembytes != dtype.itemsize: - raise ValueError("dtype.itemsize too small") - if runlen == 0: - runlen = len(data) // itembytes - skipbits = runlen*itemsize % 8 - if skipbits: - skipbits = 8 - skipbits - shrbits = itembytes*8 - itemsize - bitmask = int(itemsize*'1'+'0'*shrbits, 2) - dtypestr = '>' + dtype.char # dtype always big endian? - - unpack = struct.unpack - l = runlen * (len(data)*8 // (runlen*itemsize + skipbits)) - result = numpy.empty((l, ), dtype) - bitcount = 0 - for i in range(len(result)): - start = bitcount // 8 - s = data[start:start+itembytes] - try: - code = unpack(dtypestr, s)[0] - except Exception: - code = unpack(dtypestr, s + b'\x00'*(itembytes-len(s)))[0] - code <<= bitcount % 8 - code &= bitmask - result[i] = code >> shrbits - bitcount += itemsize - if (i+1) % runlen == 0: - bitcount += skipbits - return result - - -def unpackrgb(data, dtype='>> data = struct.pack('BBBB', 0x21, 0x08, 0xff, 0xff) - >>> print(unpackrgb(data, '>> print(unpackrgb(data, '>> print(unpackrgb(data, '= bits) - data = numpy.fromstring(data, dtype.byteorder+dt) - result = numpy.empty((data.size, len(bitspersample)), dtype.char) - for i, bps in enumerate(bitspersample): - t = data >> int(numpy.sum(bitspersample[i+1:])) - t &= int('0b'+'1'*bps, 2) - if rescale: - o = ((dtype.itemsize * 8) // bps + 1) * bps - if o > data.dtype.itemsize * 8: - t = t.astype('I') - t *= (2**o - 1) // (2**bps - 1) - t //= 2**(o - (dtype.itemsize * 8)) - result[:, i] = t - return result.reshape(-1) - - -def reorient(image, orientation): - """Return reoriented view of image array. - - Parameters - ---------- - image : numpy array - Non-squeezed output of asarray() functions. - Axes -3 and -2 must be image length and width respectively. - orientation : int or str - One of TIFF_ORIENTATIONS keys or values. - - """ - o = TIFF_ORIENTATIONS.get(orientation, orientation) - if o == 'top_left': - return image - elif o == 'top_right': - return image[..., ::-1, :] - elif o == 'bottom_left': - return image[..., ::-1, :, :] - elif o == 'bottom_right': - return image[..., ::-1, ::-1, :] - elif o == 'left_top': - return numpy.swapaxes(image, -3, -2) - elif o == 'right_top': - return numpy.swapaxes(image, -3, -2)[..., ::-1, :] - elif o == 'left_bottom': - return numpy.swapaxes(image, -3, -2)[..., ::-1, :, :] - elif o == 'right_bottom': - return numpy.swapaxes(image, -3, -2)[..., ::-1, ::-1, :] - - -def numpy_fromfile(arg, dtype=float, count=-1, sep=''): - """Return array from data in binary file. - - Work around numpy issue #2230, "numpy.fromfile does not accept StringIO - object" https://github.com/numpy/numpy/issues/2230. - - """ - try: - return numpy.fromfile(arg, dtype, count, sep) - except IOError: - if count < 0: - size = 2**30 - else: - size = count * numpy.dtype(dtype).itemsize - data = arg.read(int(size)) - return numpy.fromstring(data, dtype, count, sep) - - -def stripnull(string): - """Return string truncated at first null character.""" - i = string.find(b'\x00') - return string if (i < 0) else string[:i] - - -def format_size(size): - """Return file size as string from byte size.""" - for unit in ('B', 'KB', 'MB', 'GB', 'TB'): - if size < 2048: - return "%.f %s" % (size, unit) - size /= 1024.0 - - -def natural_sorted(iterable): - """Return human sorted list of strings. - - >>> natural_sorted(['f1', 'f2', 'f10']) - ['f1', 'f2', 'f10'] - - """ - def sortkey(x): - return [(int(c) if c.isdigit() else c) for c in re.split(numbers, x)] - numbers = re.compile('(\d+)') - return sorted(iterable, key=sortkey) - - -def datetime_from_timestamp(n, epoch=datetime.datetime.fromordinal(693594)): - """Return datetime object from timestamp in Excel serial format. - - Examples - -------- - >>> datetime_from_timestamp(40237.029999999795) - datetime.datetime(2010, 2, 28, 0, 43, 11, 999982) - - """ - return epoch + datetime.timedelta(n) - - -def test_tifffile(directory='testimages', verbose=True): - """Read all images in directory. Print error message on failure. - - Examples - -------- - >>> test_tifffile(verbose=False) - - """ - successful = 0 - failed = 0 - start = time.time() - for f in glob.glob(os.path.join(directory, '*.*')): - if verbose: - print("\n%s>\n" % f.lower(), end='') - t0 = time.time() - try: - tif = TiffFile(f, multifile=True) - except Exception as e: - if not verbose: - print(f, end=' ') - print("ERROR:", e) - failed += 1 - continue - try: - img = tif.asarray() - except ValueError: - try: - img = tif[0].asarray() - except Exception as e: - if not verbose: - print(f, end=' ') - print("ERROR:", e) - failed += 1 - continue - finally: - tif.close() - successful += 1 - if verbose: - print("%s, %s %s, %s, %.0f ms" % ( - str(tif), str(img.shape), img.dtype, tif[0].compression, - (time.time()-t0) * 1e3)) - if verbose: - print("\nSuccessfully read %i of %i files in %.3f s\n" % ( - successful, successful+failed, time.time()-start)) - - -class TIFF_SUBFILE_TYPES(object): - def __getitem__(self, key): - result = [] - if key & 1: - result.append('reduced_image') - if key & 2: - result.append('page') - if key & 4: - result.append('mask') - return tuple(result) - - -TIFF_PHOTOMETRICS = { - 0: 'miniswhite', - 1: 'minisblack', - 2: 'rgb', - 3: 'palette', - 4: 'mask', - 5: 'separated', - 6: 'cielab', - 7: 'icclab', - 8: 'itulab', - 32844: 'logl', - 32845: 'logluv', -} - -TIFF_COMPESSIONS = { - 1: None, - 2: 'ccittrle', - 3: 'ccittfax3', - 4: 'ccittfax4', - 5: 'lzw', - 6: 'ojpeg', - 7: 'jpeg', - 8: 'adobe_deflate', - 9: 't85', - 10: 't43', - 32766: 'next', - 32771: 'ccittrlew', - 32773: 'packbits', - 32809: 'thunderscan', - 32895: 'it8ctpad', - 32896: 'it8lw', - 32897: 'it8mp', - 32898: 'it8bl', - 32908: 'pixarfilm', - 32909: 'pixarlog', - 32946: 'deflate', - 32947: 'dcs', - 34661: 'jbig', - 34676: 'sgilog', - 34677: 'sgilog24', - 34712: 'jp2000', - 34713: 'nef', -} - -TIFF_DECOMPESSORS = { - None: lambda x: x, - 'adobe_deflate': zlib.decompress, - 'deflate': zlib.decompress, - 'packbits': decodepackbits, - 'lzw': decodelzw, -} - -TIFF_DATA_TYPES = { - 1: '1B', # BYTE 8-bit unsigned integer. - 2: '1s', # ASCII 8-bit byte that contains a 7-bit ASCII code; - # the last byte must be NULL (binary zero). - 3: '1H', # SHORT 16-bit (2-byte) unsigned integer - 4: '1I', # LONG 32-bit (4-byte) unsigned integer. - 5: '2I', # RATIONAL Two LONGs: the first represents the numerator of - # a fraction; the second, the denominator. - 6: '1b', # SBYTE An 8-bit signed (twos-complement) integer. - 7: '1B', # UNDEFINED An 8-bit byte that may contain anything, - # depending on the definition of the field. - 8: '1h', # SSHORT A 16-bit (2-byte) signed (twos-complement) integer. - 9: '1i', # SLONG A 32-bit (4-byte) signed (twos-complement) integer. - 10: '2i', # SRATIONAL Two SLONGs: the first represents the numerator - # of a fraction, the second the denominator. - 11: '1f', # FLOAT Single precision (4-byte) IEEE format. - 12: '1d', # DOUBLE Double precision (8-byte) IEEE format. - 13: '1I', # IFD unsigned 4 byte IFD offset. - #14: '', # UNICODE - #15: '', # COMPLEX - 16: '1Q', # LONG8 unsigned 8 byte integer (BigTiff) - 17: '1q', # SLONG8 signed 8 byte integer (BigTiff) - 18: '1Q', # IFD8 unsigned 8 byte IFD offset (BigTiff) -} - -TIFF_SAMPLE_FORMATS = { - 1: 'uint', - 2: 'int', - 3: 'float', - #4: 'void', - #5: 'complex_int', - 6: 'complex', -} - -TIFF_SAMPLE_DTYPES = { - ('uint', 1): '?', # bitmap - ('uint', 2): 'B', - ('uint', 3): 'B', - ('uint', 4): 'B', - ('uint', 5): 'B', - ('uint', 6): 'B', - ('uint', 7): 'B', - ('uint', 8): 'B', - ('uint', 9): 'H', - ('uint', 10): 'H', - ('uint', 11): 'H', - ('uint', 12): 'H', - ('uint', 13): 'H', - ('uint', 14): 'H', - ('uint', 15): 'H', - ('uint', 16): 'H', - ('uint', 17): 'I', - ('uint', 18): 'I', - ('uint', 19): 'I', - ('uint', 20): 'I', - ('uint', 21): 'I', - ('uint', 22): 'I', - ('uint', 23): 'I', - ('uint', 24): 'I', - ('uint', 25): 'I', - ('uint', 26): 'I', - ('uint', 27): 'I', - ('uint', 28): 'I', - ('uint', 29): 'I', - ('uint', 30): 'I', - ('uint', 31): 'I', - ('uint', 32): 'I', - ('uint', 64): 'Q', - ('int', 8): 'b', - ('int', 16): 'h', - ('int', 32): 'i', - ('int', 64): 'q', - ('float', 16): 'e', - ('float', 32): 'f', - ('float', 64): 'd', - ('complex', 64): 'F', - ('complex', 128): 'D', - ('uint', (5, 6, 5)): 'B', -} - -TIFF_ORIENTATIONS = { - 1: 'top_left', - 2: 'top_right', - 3: 'bottom_right', - 4: 'bottom_left', - 5: 'left_top', - 6: 'right_top', - 7: 'right_bottom', - 8: 'left_bottom', -} - -AXES_LABELS = { - 'X': 'width', - 'Y': 'height', - 'Z': 'depth', - 'S': 'sample', # rgb(a) - 'P': 'plane', # page - 'T': 'time', - 'C': 'channel', # color, emission wavelength - 'A': 'angle', - 'F': 'phase', - 'R': 'tile', # region, point - 'H': 'lifetime', # histogram - 'E': 'lambda', # excitation wavelength - 'L': 'exposure', # lux - 'V': 'event', - 'Q': 'other', -} - -AXES_LABELS.update(dict((v, k) for k, v in AXES_LABELS.items())) - -# NIH Image PicHeader v1.63 -NIH_IMAGE_HEADER = [ - ('fileid', 'a8'), - ('nlines', 'i2'), - ('pixelsperline', 'i2'), - ('version', 'i2'), - ('oldlutmode', 'i2'), - ('oldncolors', 'i2'), - ('colors', 'u1', (3, 32)), - ('oldcolorstart', 'i2'), - ('colorwidth', 'i2'), - ('extracolors', 'u2', (6, 3)), - ('nextracolors', 'i2'), - ('foregroundindex', 'i2'), - ('backgroundindex', 'i2'), - ('xscale', 'f8'), - ('_x0', 'i2'), - ('_x1', 'i2'), - ('units_t', 'i2'), - ('p1', [('x', 'i2'), ('y', 'i2')]), - ('p2', [('x', 'i2'), ('y', 'i2')]), - ('curvefit_t', 'i2'), - ('ncoefficients', 'i2'), - ('coeff', 'f8', 6), - ('_um_len', 'u1'), - ('um', 'a15'), - ('_x2', 'u1'), - ('binarypic', 'b1'), - ('slicestart', 'i2'), - ('sliceend', 'i2'), - ('scalemagnification', 'f4'), - ('nslices', 'i2'), - ('slicespacing', 'f4'), - ('currentslice', 'i2'), - ('frameinterval', 'f4'), - ('pixelaspectratio', 'f4'), - ('colorstart', 'i2'), - ('colorend', 'i2'), - ('ncolors', 'i2'), - ('fill1', '3u2'), - ('fill2', '3u2'), - ('colortable_t', 'u1'), - ('lutmode_t', 'u1'), - ('invertedtable', 'b1'), - ('zeroclip', 'b1'), - ('_xunit_len', 'u1'), - ('xunit', 'a11'), - ('stacktype_t', 'i2'), -] - -#NIH_COLORTABLE_TYPE = ( -# 'CustomTable', 'AppleDefault', 'Pseudo20', 'Pseudo32', 'Rainbow', -# 'Fire1', 'Fire2', 'Ice', 'Grays', 'Spectrum') -#NIH_LUTMODE_TYPE = ( -# 'PseudoColor', 'OldAppleDefault', 'OldSpectrum', 'GrayScale', -# 'ColorLut', 'CustomGrayscale') -#NIH_CURVEFIT_TYPE = ( -# 'StraightLine', 'Poly2', 'Poly3', 'Poly4', 'Poly5', 'ExpoFit', -# 'PowerFit', 'LogFit', 'RodbardFit', 'SpareFit1', 'Uncalibrated', -# 'UncalibratedOD') -#NIH_UNITS_TYPE = ( -# 'Nanometers', 'Micrometers', 'Millimeters', 'Centimeters', 'Meters', -# 'Kilometers', 'Inches', 'Feet', 'Miles', 'Pixels', 'OtherUnits') -#NIH_STACKTYPE_TYPE = ( -# 'VolumeStack', 'RGBStack', 'MovieStack', 'HSVStack') - -# MetaMorph STK tags -MM_TAG_IDS = { - 0: 'auto_scale', - 1: 'min_scale', - 2: 'max_scale', - 3: 'spatial_calibration', - #4: 'x_calibration', - #5: 'y_calibration', - #6: 'calibration_units', - #7: 'name', - 8: 'thresh_state', - 9: 'thresh_state_red', - 11: 'thresh_state_green', - 12: 'thresh_state_blue', - 13: 'thresh_state_lo', - 14: 'thresh_state_hi', - 15: 'zoom', - #16: 'create_time', - #17: 'last_saved_time', - 18: 'current_buffer', - 19: 'gray_fit', - 20: 'gray_point_count', - #21: 'gray_x', - #22: 'gray_y', - #23: 'gray_min', - #24: 'gray_max', - #25: 'gray_unit_name', - 26: 'standard_lut', - 27: 'wavelength', - #28: 'stage_position', - #29: 'camera_chip_offset', - #30: 'overlay_mask', - #31: 'overlay_compress', - #32: 'overlay', - #33: 'special_overlay_mask', - #34: 'special_overlay_compress', - #35: 'special_overlay', - 36: 'image_property', - #37: 'stage_label', - #38: 'autoscale_lo_info', - #39: 'autoscale_hi_info', - #40: 'absolute_z', - #41: 'absolute_z_valid', - #42: 'gamma', - #43: 'gamma_red', - #44: 'gamma_green', - #45: 'gamma_blue', - #46: 'camera_bin', - 47: 'new_lut', - #48: 'image_property_ex', - 49: 'plane_property', - #50: 'user_lut_table', - 51: 'red_autoscale_info', - #52: 'red_autoscale_lo_info', - #53: 'red_autoscale_hi_info', - 54: 'red_minscale_info', - 55: 'red_maxscale_info', - 56: 'green_autoscale_info', - #57: 'green_autoscale_lo_info', - #58: 'green_autoscale_hi_info', - 59: 'green_minscale_info', - 60: 'green_maxscale_info', - 61: 'blue_autoscale_info', - #62: 'blue_autoscale_lo_info', - #63: 'blue_autoscale_hi_info', - 64: 'blue_min_scale_info', - 65: 'blue_max_scale_info', - #66: 'overlay_plane_color' -} - -# Olympus FluoView -MM_DIMENSION = [ - ('name', 'a16'), - ('size', 'i4'), - ('origin', 'f8'), - ('resolution', 'f8'), - ('unit', 'a64'), -] - -MM_HEADER = [ - ('header_flag', 'i2'), - ('image_type', 'u1'), - ('image_name', 'a257'), - ('offset_data', 'u4'), - ('palette_size', 'i4'), - ('offset_palette0', 'u4'), - ('offset_palette1', 'u4'), - ('comment_size', 'i4'), - ('offset_comment', 'u4'), - ('dimensions', MM_DIMENSION, 10), - ('offset_position', 'u4'), - ('map_type', 'i2'), - ('map_min', 'f8'), - ('map_max', 'f8'), - ('min_value', 'f8'), - ('max_value', 'f8'), - ('offset_map', 'u4'), - ('gamma', 'f8'), - ('offset', 'f8'), - ('gray_channel', MM_DIMENSION), - ('offset_thumbnail', 'u4'), - ('voice_field', 'i4'), - ('offset_voice_field', 'u4'), -] - -# Carl Zeiss LSM -CZ_LSM_INFO = [ - ('magic_number', 'i4'), - ('structure_size', 'i4'), - ('dimension_x', 'i4'), - ('dimension_y', 'i4'), - ('dimension_z', 'i4'), - ('dimension_channels', 'i4'), - ('dimension_time', 'i4'), - ('dimension_data_type', 'i4'), - ('thumbnail_x', 'i4'), - ('thumbnail_y', 'i4'), - ('voxel_size_x', 'f8'), - ('voxel_size_y', 'f8'), - ('voxel_size_z', 'f8'), - ('origin_x', 'f8'), - ('origin_y', 'f8'), - ('origin_z', 'f8'), - ('scan_type', 'u2'), - ('spectral_scan', 'u2'), - ('data_type', 'u4'), - ('offset_vector_overlay', 'u4'), - ('offset_input_lut', 'u4'), - ('offset_output_lut', 'u4'), - ('offset_channel_colors', 'u4'), - ('time_interval', 'f8'), - ('offset_channel_data_types', 'u4'), - ('offset_scan_information', 'u4'), - ('offset_ks_data', 'u4'), - ('offset_time_stamps', 'u4'), - ('offset_event_list', 'u4'), - ('offset_roi', 'u4'), - ('offset_bleach_roi', 'u4'), - ('offset_next_recording', 'u4'), - ('display_aspect_x', 'f8'), - ('display_aspect_y', 'f8'), - ('display_aspect_z', 'f8'), - ('display_aspect_time', 'f8'), - ('offset_mean_of_roi_overlay', 'u4'), - ('offset_topo_isoline_overlay', 'u4'), - ('offset_topo_profile_overlay', 'u4'), - ('offset_linescan_overlay', 'u4'), - ('offset_toolbar_flags', 'u4'), -] - -# Import functions for LSM_INFO sub-records -CZ_LSM_INFO_READERS = { - 'scan_information': read_cz_lsm_scan_info, - 'time_stamps': read_cz_lsm_time_stamps, - 'event_list': read_cz_lsm_event_list, -} - -# Map cz_lsm_info.scan_type to dimension order -CZ_SCAN_TYPES = { - 0: 'XYZCT', # x-y-z scan - 1: 'XYZCT', # z scan (x-z plane) - 2: 'XYZCT', # line scan - 3: 'XYTCZ', # time series x-y - 4: 'XYZTC', # time series x-z - 5: 'XYTCZ', # time series 'Mean of ROIs' - 6: 'XYZTC', # time series x-y-z - 7: 'XYCTZ', # spline scan - 8: 'XYCZT', # spline scan x-z - 9: 'XYTCZ', # time series spline plane x-z - 10: 'XYZCT', # point mode -} - -# Map dimension codes to cz_lsm_info attribute -CZ_DIMENSIONS = { - 'X': 'dimension_x', - 'Y': 'dimension_y', - 'Z': 'dimension_z', - 'C': 'dimension_channels', - 'T': 'dimension_time', -} - -# Descriptions of cz_lsm_info.data_type -CZ_DATA_TYPES = { - 0: 'varying data types', - 2: '12 bit unsigned integer', - 5: '32 bit float', -} - -CZ_LSM_SCAN_INFO_ARRAYS = { - 0x20000000: "tracks", - 0x30000000: "lasers", - 0x60000000: "detectionchannels", - 0x80000000: "illuminationchannels", - 0xa0000000: "beamsplitters", - 0xc0000000: "datachannels", - 0x13000000: "markers", - 0x11000000: "timers", -} - -CZ_LSM_SCAN_INFO_STRUCTS = { - 0x40000000: "tracks", - 0x50000000: "lasers", - 0x70000000: "detectionchannels", - 0x90000000: "illuminationchannels", - 0xb0000000: "beamsplitters", - 0xd0000000: "datachannels", - 0x14000000: "markers", - 0x12000000: "timers", -} - -CZ_LSM_SCAN_INFO_ATTRIBUTES = { - 0x10000001: "name", - 0x10000002: "description", - 0x10000003: "notes", - 0x10000004: "objective", - 0x10000005: "processing_summary", - 0x10000006: "special_scan_mode", - 0x10000007: "oledb_recording_scan_type", - 0x10000008: "oledb_recording_scan_mode", - 0x10000009: "number_of_stacks", - 0x1000000a: "lines_per_plane", - 0x1000000b: "samples_per_line", - 0x1000000c: "planes_per_volume", - 0x1000000d: "images_width", - 0x1000000e: "images_height", - 0x1000000f: "images_number_planes", - 0x10000010: "images_number_stacks", - 0x10000011: "images_number_channels", - 0x10000012: "linscan_xy_size", - 0x10000013: "scan_direction", - 0x10000014: "time_series", - 0x10000015: "original_scan_data", - 0x10000016: "zoom_x", - 0x10000017: "zoom_y", - 0x10000018: "zoom_z", - 0x10000019: "sample_0x", - 0x1000001a: "sample_0y", - 0x1000001b: "sample_0z", - 0x1000001c: "sample_spacing", - 0x1000001d: "line_spacing", - 0x1000001e: "plane_spacing", - 0x1000001f: "plane_width", - 0x10000020: "plane_height", - 0x10000021: "volume_depth", - 0x10000023: "nutation", - 0x10000034: "rotation", - 0x10000035: "precession", - 0x10000036: "sample_0time", - 0x10000037: "start_scan_trigger_in", - 0x10000038: "start_scan_trigger_out", - 0x10000039: "start_scan_event", - 0x10000040: "start_scan_time", - 0x10000041: "stop_scan_trigger_in", - 0x10000042: "stop_scan_trigger_out", - 0x10000043: "stop_scan_event", - 0x10000044: "stop_scan_time", - 0x10000045: "use_rois", - 0x10000046: "use_reduced_memory_rois", - 0x10000047: "user", - 0x10000048: "use_bccorrection", - 0x10000049: "position_bccorrection1", - 0x10000050: "position_bccorrection2", - 0x10000051: "interpolation_y", - 0x10000052: "camera_binning", - 0x10000053: "camera_supersampling", - 0x10000054: "camera_frame_width", - 0x10000055: "camera_frame_height", - 0x10000056: "camera_offset_x", - 0x10000057: "camera_offset_y", - # lasers - 0x50000001: "name", - 0x50000002: "acquire", - 0x50000003: "power", - # tracks - 0x40000001: "multiplex_type", - 0x40000002: "multiplex_order", - 0x40000003: "sampling_mode", - 0x40000004: "sampling_method", - 0x40000005: "sampling_number", - 0x40000006: "acquire", - 0x40000007: "sample_observation_time", - 0x4000000b: "time_between_stacks", - 0x4000000c: "name", - 0x4000000d: "collimator1_name", - 0x4000000e: "collimator1_position", - 0x4000000f: "collimator2_name", - 0x40000010: "collimator2_position", - 0x40000011: "is_bleach_track", - 0x40000012: "is_bleach_after_scan_number", - 0x40000013: "bleach_scan_number", - 0x40000014: "trigger_in", - 0x40000015: "trigger_out", - 0x40000016: "is_ratio_track", - 0x40000017: "bleach_count", - 0x40000018: "spi_center_wavelength", - 0x40000019: "pixel_time", - 0x40000021: "condensor_frontlens", - 0x40000023: "field_stop_value", - 0x40000024: "id_condensor_aperture", - 0x40000025: "condensor_aperture", - 0x40000026: "id_condensor_revolver", - 0x40000027: "condensor_filter", - 0x40000028: "id_transmission_filter1", - 0x40000029: "id_transmission1", - 0x40000030: "id_transmission_filter2", - 0x40000031: "id_transmission2", - 0x40000032: "repeat_bleach", - 0x40000033: "enable_spot_bleach_pos", - 0x40000034: "spot_bleach_posx", - 0x40000035: "spot_bleach_posy", - 0x40000036: "spot_bleach_posz", - 0x40000037: "id_tubelens", - 0x40000038: "id_tubelens_position", - 0x40000039: "transmitted_light", - 0x4000003a: "reflected_light", - 0x4000003b: "simultan_grab_and_bleach", - 0x4000003c: "bleach_pixel_time", - # detection_channels - 0x70000001: "integration_mode", - 0x70000002: "special_mode", - 0x70000003: "detector_gain_first", - 0x70000004: "detector_gain_last", - 0x70000005: "amplifier_gain_first", - 0x70000006: "amplifier_gain_last", - 0x70000007: "amplifier_offs_first", - 0x70000008: "amplifier_offs_last", - 0x70000009: "pinhole_diameter", - 0x7000000a: "counting_trigger", - 0x7000000b: "acquire", - 0x7000000c: "point_detector_name", - 0x7000000d: "amplifier_name", - 0x7000000e: "pinhole_name", - 0x7000000f: "filter_set_name", - 0x70000010: "filter_name", - 0x70000013: "integrator_name", - 0x70000014: "detection_channel_name", - 0x70000015: "detection_detector_gain_bc1", - 0x70000016: "detection_detector_gain_bc2", - 0x70000017: "detection_amplifier_gain_bc1", - 0x70000018: "detection_amplifier_gain_bc2", - 0x70000019: "detection_amplifier_offset_bc1", - 0x70000020: "detection_amplifier_offset_bc2", - 0x70000021: "detection_spectral_scan_channels", - 0x70000022: "detection_spi_wavelength_start", - 0x70000023: "detection_spi_wavelength_stop", - 0x70000026: "detection_dye_name", - 0x70000027: "detection_dye_folder", - # illumination_channels - 0x90000001: "name", - 0x90000002: "power", - 0x90000003: "wavelength", - 0x90000004: "aquire", - 0x90000005: "detchannel_name", - 0x90000006: "power_bc1", - 0x90000007: "power_bc2", - # beam_splitters - 0xb0000001: "filter_set", - 0xb0000002: "filter", - 0xb0000003: "name", - # data_channels - 0xd0000001: "name", - 0xd0000003: "acquire", - 0xd0000004: "color", - 0xd0000005: "sample_type", - 0xd0000006: "bits_per_sample", - 0xd0000007: "ratio_type", - 0xd0000008: "ratio_track1", - 0xd0000009: "ratio_track2", - 0xd000000a: "ratio_channel1", - 0xd000000b: "ratio_channel2", - 0xd000000c: "ratio_const1", - 0xd000000d: "ratio_const2", - 0xd000000e: "ratio_const3", - 0xd000000f: "ratio_const4", - 0xd0000010: "ratio_const5", - 0xd0000011: "ratio_const6", - 0xd0000012: "ratio_first_images1", - 0xd0000013: "ratio_first_images2", - 0xd0000014: "dye_name", - 0xd0000015: "dye_folder", - 0xd0000016: "spectrum", - 0xd0000017: "acquire", - # markers - 0x14000001: "name", - 0x14000002: "description", - 0x14000003: "trigger_in", - 0x14000004: "trigger_out", - # timers - 0x12000001: "name", - 0x12000002: "description", - 0x12000003: "interval", - 0x12000004: "trigger_in", - 0x12000005: "trigger_out", - 0x12000006: "activation_time", - 0x12000007: "activation_number", -} - -# Map TIFF tag code to attribute name, default value, type, count, validator -TIFF_TAGS = { - 254: ('new_subfile_type', 0, 4, 1, TIFF_SUBFILE_TYPES()), - 255: ('subfile_type', None, 3, 1, - {0: 'undefined', 1: 'image', 2: 'reduced_image', 3: 'page'}), - 256: ('image_width', None, 4, 1, None), - 257: ('image_length', None, 4, 1, None), - 258: ('bits_per_sample', 1, 3, 1, None), - 259: ('compression', 1, 3, 1, TIFF_COMPESSIONS), - 262: ('photometric', None, 3, 1, TIFF_PHOTOMETRICS), - 266: ('fill_order', 1, 3, 1, {1: 'msb2lsb', 2: 'lsb2msb'}), - 269: ('document_name', None, 2, None, None), - 270: ('image_description', None, 2, None, None), - 271: ('make', None, 2, None, None), - 272: ('model', None, 2, None, None), - 273: ('strip_offsets', None, 4, None, None), - 274: ('orientation', 1, 3, 1, TIFF_ORIENTATIONS), - 277: ('samples_per_pixel', 1, 3, 1, None), - 278: ('rows_per_strip', 2**32-1, 4, 1, None), - 279: ('strip_byte_counts', None, 4, None, None), - 280: ('min_sample_value', None, 3, None, None), - 281: ('max_sample_value', None, 3, None, None), # 2**bits_per_sample - 282: ('x_resolution', None, 5, 1, None), - 283: ('y_resolution', None, 5, 1, None), - 284: ('planar_configuration', 1, 3, 1, {1: 'contig', 2: 'separate'}), - 285: ('page_name', None, 2, None, None), - 286: ('x_position', None, 5, 1, None), - 287: ('y_position', None, 5, 1, None), - 296: ('resolution_unit', 2, 4, 1, {1: 'none', 2: 'inch', 3: 'centimeter'}), - 297: ('page_number', None, 3, 2, None), - 305: ('software', None, 2, None, None), - 306: ('datetime', None, 2, None, None), - 315: ('artist', None, 2, None, None), - 316: ('host_computer', None, 2, None, None), - 317: ('predictor', 1, 3, 1, {1: None, 2: 'horizontal'}), - 320: ('color_map', None, 3, None, None), - 322: ('tile_width', None, 4, 1, None), - 323: ('tile_length', None, 4, 1, None), - 324: ('tile_offsets', None, 4, None, None), - 325: ('tile_byte_counts', None, 4, None, None), - 338: ('extra_samples', None, 3, None, - {0: 'unspecified', 1: 'assocalpha', 2: 'unassalpha'}), - 339: ('sample_format', 1, 3, 1, TIFF_SAMPLE_FORMATS), - 347: ('jpeg_tables', None, None, None, None), - 530: ('ycbcr_subsampling', 1, 3, 2, None), - 531: ('ycbcr_positioning', 1, 3, 1, None), - 32997: ('image_depth', None, 4, 1, None), - 32998: ('tile_depth', None, 4, 1, None), - 33432: ('copyright', None, 1, None, None), - 33445: ('md_file_tag', None, 4, 1, None), - 33446: ('md_scale_pixel', None, 5, 1, None), - 33447: ('md_color_table', None, 3, None, None), - 33448: ('md_lab_name', None, 2, None, None), - 33449: ('md_sample_info', None, 2, None, None), - 33450: ('md_prep_date', None, 2, None, None), - 33451: ('md_prep_time', None, 2, None, None), - 33452: ('md_file_units', None, 2, None, None), - 33550: ('model_pixel_scale', None, 12, 3, None), - 33922: ('model_tie_point', None, 12, None, None), - 37510: ('user_comment', None, None, None, None), - 34665: ('exif_ifd', None, None, 1, None), - 34735: ('geo_key_directory', None, 3, None, None), - 34736: ('geo_double_params', None, 12, None, None), - 34737: ('geo_ascii_params', None, 2, None, None), - 34853: ('gps_ifd', None, None, 1, None), - 42112: ('gdal_metadata', None, 2, None, None), - 42113: ('gdal_nodata', None, 2, None, None), - 50838: ('imagej_byte_counts', None, None, None, None), - 50289: ('mc_xy_position', None, 12, 2, None), - 50290: ('mc_z_position', None, 12, 1, None), - 50291: ('mc_xy_calibration', None, 12, 3, None), - 50292: ('mc_lens_lem_na_n', None, 12, 3, None), - 50293: ('mc_channel_name', None, 1, None, None), - 50294: ('mc_ex_wavelength', None, 12, 1, None), - 50295: ('mc_time_stamp', None, 12, 1, None), - 65200: ('flex_xml', None, 2, None, None), - # code: (attribute name, default value, type, count, validator) -} - -# Map custom TIFF tag codes to attribute names and import functions -CUSTOM_TAGS = { - 700: ('xmp', read_bytes), - 34377: ('photoshop', read_numpy), - 33723: ('iptc', read_bytes), - 34675: ('icc_profile', read_numpy), - 33628: ('mm_uic1', read_mm_uic1), - 33629: ('mm_uic2', read_mm_uic2), - 33630: ('mm_uic3', read_mm_uic3), - 33631: ('mm_uic4', read_mm_uic4), - 34361: ('mm_header', read_mm_header), - 34362: ('mm_stamp', read_mm_stamp), - 34386: ('mm_user_block', read_bytes), - 34412: ('cz_lsm_info', read_cz_lsm_info), - 43314: ('nih_image_header', read_nih_image_header), - # 40001: ('mc_ipwinscal', read_bytes), - 40100: ('mc_id_old', read_bytes), - 50288: ('mc_id', read_bytes), - 50296: ('mc_frame_properties', read_bytes), - 50839: ('imagej_metadata', read_bytes), - 51123: ('micromanager_metadata', read_json), -} - -# Max line length of printed output -PRINT_LINE_LEN = 79 - - -def imshow(data, title=None, vmin=0, vmax=None, cmap=None, - bitspersample=None, photometric='rgb', interpolation='nearest', - dpi=96, figure=None, subplot=111, maxdim=8192, **kwargs): - """Plot n-dimensional images using matplotlib.pyplot. - - Return figure, subplot and plot axis. - Requires pyplot already imported ``from matplotlib import pyplot``. - - Parameters - ---------- - bitspersample : int or None - Number of bits per channel in integer RGB images. - photometric : {'miniswhite', 'minisblack', 'rgb', or 'palette'} - The color space of the image data. - title : str - Window and subplot title. - figure : matplotlib.figure.Figure (optional). - Matplotlib to use for plotting. - subplot : int - A matplotlib.pyplot.subplot axis. - maxdim : int - maximum image size in any dimension. - kwargs : optional - Arguments for matplotlib.pyplot.imshow. - - """ - #if photometric not in ('miniswhite', 'minisblack', 'rgb', 'palette'): - # raise ValueError("Can't handle %s photometrics" % photometric) - # TODO: handle photometric == 'separated' (CMYK) - isrgb = photometric in ('rgb', 'palette') - data = numpy.atleast_2d(data.squeeze()) - data = data[(slice(0, maxdim), ) * len(data.shape)] - - dims = data.ndim - if dims < 2: - raise ValueError("not an image") - elif dims == 2: - dims = 0 - isrgb = False - else: - if isrgb and data.shape[-3] in (3, 4): - data = numpy.swapaxes(data, -3, -2) - data = numpy.swapaxes(data, -2, -1) - elif not isrgb and data.shape[-1] in (3, 4): - data = numpy.swapaxes(data, -3, -1) - data = numpy.swapaxes(data, -2, -1) - isrgb = isrgb and data.shape[-1] in (3, 4) - dims -= 3 if isrgb else 2 - - if photometric == 'palette' and isrgb: - datamax = data.max() - if datamax > 255: - data >>= 8 # possible precision loss - data = data.astype('B') - elif data.dtype.kind in 'ui': - if not (isrgb and data.dtype.itemsize <= 1) or bitspersample is None: - try: - bitspersample = int(math.ceil(math.log(data.max(), 2))) - except Exception: - bitspersample = data.dtype.itemsize * 8 - elif not isinstance(bitspersample, int): - # bitspersample can be tuple, e.g. (5, 6, 5) - bitspersample = data.dtype.itemsize * 8 - datamax = 2**bitspersample - if isrgb: - if bitspersample < 8: - data <<= 8 - bitspersample - elif bitspersample > 8: - data >>= bitspersample - 8 # precision loss - data = data.astype('B') - elif data.dtype.kind == 'f': - datamax = data.max() - if isrgb and datamax > 1.0: - if data.dtype.char == 'd': - data = data.astype('f') - data /= datamax - elif data.dtype.kind == 'b': - datamax = 1 - elif data.dtype.kind == 'c': - raise NotImplementedError("complex type") # TODO: handle complex types - - if not isrgb: - if vmax is None: - vmax = datamax - if vmin is None: - if data.dtype.kind == 'i': - dtmin = numpy.iinfo(data.dtype).min - vmin = numpy.min(data) - if vmin == dtmin: - vmin = numpy.min(data > dtmin) - if data.dtype.kind == 'f': - dtmin = numpy.finfo(data.dtype).min - vmin = numpy.min(data) - if vmin == dtmin: - vmin = numpy.min(data > dtmin) - else: - vmin = 0 - - pyplot = sys.modules['matplotlib.pyplot'] - - if figure is None: - pyplot.rc('font', family='sans-serif', weight='normal', size=8) - figure = pyplot.figure(dpi=dpi, figsize=(10.3, 6.3), frameon=True, - facecolor='1.0', edgecolor='w') - try: - figure.canvas.manager.window.title(title) - except Exception: - pass - pyplot.subplots_adjust(bottom=0.03*(dims+2), top=0.9, - left=0.1, right=0.95, hspace=0.05, wspace=0.0) - subplot = pyplot.subplot(subplot) - - if title: - try: - title = unicode(title, 'Windows-1252') - except TypeError: - pass - pyplot.title(title, size=11) - - if cmap is None: - if data.dtype.kind in 'ub' and vmin == 0: - cmap = 'gray' - else: - cmap = 'coolwarm' - if photometric == 'miniswhite': - cmap += '_r' - - image = pyplot.imshow(data[(0, ) * dims].squeeze(), vmin=vmin, vmax=vmax, - cmap=cmap, interpolation=interpolation, **kwargs) - - if not isrgb: - pyplot.colorbar() # panchor=(0.55, 0.5), fraction=0.05 - - def format_coord(x, y): - # callback function to format coordinate display in toolbar - x = int(x + 0.5) - y = int(y + 0.5) - try: - if dims: - return "%s @ %s [%4i, %4i]" % (cur_ax_dat[1][y, x], - current, x, y) - else: - return "%s @ [%4i, %4i]" % (data[y, x], x, y) - except IndexError: - return "" - - pyplot.gca().format_coord = format_coord - - if dims: - current = list((0, ) * dims) - cur_ax_dat = [0, data[tuple(current)].squeeze()] - sliders = [pyplot.Slider( - pyplot.axes([0.125, 0.03*(axis+1), 0.725, 0.025]), - 'Dimension %i' % axis, 0, data.shape[axis]-1, 0, facecolor='0.5', - valfmt='%%.0f [%i]' % data.shape[axis]) for axis in range(dims)] - for slider in sliders: - slider.drawon = False - - def set_image(current, sliders=sliders, data=data): - # change image and redraw canvas - cur_ax_dat[1] = data[tuple(current)].squeeze() - image.set_data(cur_ax_dat[1]) - for ctrl, index in zip(sliders, current): - ctrl.eventson = False - ctrl.set_val(index) - ctrl.eventson = True - figure.canvas.draw() - - def on_changed(index, axis, data=data, current=current): - # callback function for slider change event - index = int(round(index)) - cur_ax_dat[0] = axis - if index == current[axis]: - return - if index >= data.shape[axis]: - index = 0 - elif index < 0: - index = data.shape[axis] - 1 - current[axis] = index - set_image(current) - - def on_keypressed(event, data=data, current=current): - # callback function for key press event - key = event.key - axis = cur_ax_dat[0] - if str(key) in '0123456789': - on_changed(key, axis) - elif key == 'right': - on_changed(current[axis] + 1, axis) - elif key == 'left': - on_changed(current[axis] - 1, axis) - elif key == 'up': - cur_ax_dat[0] = 0 if axis == len(data.shape)-1 else axis + 1 - elif key == 'down': - cur_ax_dat[0] = len(data.shape)-1 if axis == 0 else axis - 1 - elif key == 'end': - on_changed(data.shape[axis] - 1, axis) - elif key == 'home': - on_changed(0, axis) - - figure.canvas.mpl_connect('key_press_event', on_keypressed) - for axis, ctrl in enumerate(sliders): - ctrl.on_changed(lambda k, a=axis: on_changed(k, a)) - - return figure, subplot, image - - -def _app_show(): - """Block the GUI. For use as skimage plugin.""" - pyplot = sys.modules['matplotlib.pyplot'] - pyplot.show() - - -def main(argv=None): - """Command line usage main function.""" - if float(sys.version[0:3]) < 2.6: - print("This script requires Python version 2.6 or better.") - print("This is Python version %s" % sys.version) - return 0 - if argv is None: - argv = sys.argv - - import optparse - - search_doc = lambda r, d: re.search(r, __doc__).group(1) if __doc__ else d - parser = optparse.OptionParser( - usage="usage: %prog [options] path", - description=search_doc("\n\n([^|]*?)\n\n", ''), - version="%%prog %s" % search_doc(":Version: (.*)", "Unknown")) - opt = parser.add_option - opt('-p', '--page', dest='page', type='int', default=-1, - help="display single page") - opt('-s', '--series', dest='series', type='int', default=-1, - help="display series of pages of same shape") - opt('--nomultifile', dest='nomultifile', action='store_true', - default=False, help="don't read OME series from multiple files") - opt('--noplot', dest='noplot', action='store_true', default=False, - help="don't display images") - opt('--interpol', dest='interpol', metavar='INTERPOL', default='bilinear', - help="image interpolation method") - opt('--dpi', dest='dpi', type='int', default=96, - help="set plot resolution") - opt('--debug', dest='debug', action='store_true', default=False, - help="raise exception on failures") - opt('--test', dest='test', action='store_true', default=False, - help="try read all images in path") - opt('--doctest', dest='doctest', action='store_true', default=False, - help="runs the internal tests") - opt('-v', '--verbose', dest='verbose', action='store_true', default=True) - opt('-q', '--quiet', dest='verbose', action='store_false') - - settings, path = parser.parse_args() - path = ' '.join(path) - - if settings.doctest: - import doctest - doctest.testmod() - return 0 - if not path: - parser.error("No file specified") - if settings.test: - test_tifffile(path, settings.verbose) - return 0 - - if any(i in path for i in '?*'): - path = glob.glob(path) - if not path: - print('no files match the pattern') - return 0 - # TODO: handle image sequences - #if len(path) == 1: - path = path[0] - - print("Reading file structure...", end=' ') - start = time.time() - try: - tif = TiffFile(path, multifile=not settings.nomultifile) - except Exception as e: - if settings.debug: - raise - else: - print("\n", e) - sys.exit(0) - print("%.3f ms" % ((time.time()-start) * 1e3)) - - if tif.is_ome: - settings.norgb = True - - images = [(None, tif[0 if settings.page < 0 else settings.page])] - if not settings.noplot: - print("Reading image data... ", end=' ') - - def notnone(x): - return next(i for i in x if i is not None) - start = time.time() - try: - if settings.page >= 0: - images = [(tif.asarray(key=settings.page), - tif[settings.page])] - elif settings.series >= 0: - images = [(tif.asarray(series=settings.series), - notnone(tif.series[settings.series].pages))] - else: - images = [] - for i, s in enumerate(tif.series): - try: - images.append( - (tif.asarray(series=i), notnone(s.pages))) - except ValueError as e: - images.append((None, notnone(s.pages))) - if settings.debug: - raise - else: - print("\n* series %i failed: %s... " % (i, e), - end='') - print("%.3f ms" % ((time.time()-start) * 1e3)) - except Exception as e: - if settings.debug: - raise - else: - print(e) - - tif.close() - - print("\nTIFF file:", tif) - print() - for i, s in enumerate(tif.series): - print ("Series %i" % i) - print(s) - print() - for i, page in images: - print(page) - print(page.tags) - if page.is_palette: - print("\nColor Map:", page.color_map.shape, page.color_map.dtype) - for attr in ('cz_lsm_info', 'cz_lsm_scan_information', 'mm_uic_tags', - 'mm_header', 'imagej_tags', 'micromanager_metadata', - 'nih_image_header'): - if hasattr(page, attr): - print("", attr.upper(), Record(getattr(page, attr)), sep="\n") - print() - if page.is_micromanager: - print('MICROMANAGER_FILE_METADATA') - print(Record(tif.micromanager_metadata)) - - if images and not settings.noplot: - try: - import matplotlib - matplotlib.use('TkAgg') - from matplotlib import pyplot - except ImportError as e: - warnings.warn("failed to import matplotlib.\n%s" % e) - else: - for img, page in images: - if img is None: - continue - vmin, vmax = None, None - if 'gdal_nodata' in page.tags: - vmin = numpy.min(img[img > float(page.gdal_nodata)]) - if page.is_stk: - try: - vmin = page.mm_uic_tags['min_scale'] - vmax = page.mm_uic_tags['max_scale'] - except KeyError: - pass - else: - if vmax <= vmin: - vmin, vmax = None, None - title = "%s\n %s" % (str(tif), str(page)) - imshow(img, title=title, vmin=vmin, vmax=vmax, - bitspersample=page.bits_per_sample, - photometric=page.photometric, - interpolation=settings.interpol, - dpi=settings.dpi) - pyplot.show() - - -TIFFfile = TiffFile # backwards compatibility - -if sys.version_info[0] > 2: - basestring = str, bytes - unicode = str - -if __name__ == "__main__": - sys.exit(main()) diff --git a/c_source_code/dezing/tifwrite.c b/c_source_code/dezing/tifwrite.c deleted file mode 100644 index a252ac53b..000000000 --- a/c_source_code/dezing/tifwrite.c +++ /dev/null @@ -1,318 +0,0 @@ -#define TIFWRITE_C -#include -#include -#include -#include - -#include "machine.h" -#include "tifwrite.h" - -#ifndef MAX_MESSAGE -#define MAX_MESSAGE (1024) -#endif /*MAX_MESSAGE*/ -/*$Id: tifwrite.c 465 2016-02-16 11:02:36Z kny48981 $*/ - -/* compile time option to activate some verbose printing */ - -#ifdef TIF_VERBOSE -#define VBPRINT(...) printf(__VA_ARGS__) -#else -#define VBPRINT(...) -#endif - - -#ifdef FIX_SLITS -# ifndef SLITROWS -# define SLITROWS (100) -# endif -#endif - -int tiffree(Mytiff * mytiff){ - #ifdef INMEM - free (mytiff->data); - #endif -return(0); -} - - -void myhandler( const char * module, const char * fmt, va_list ap){; -#ifdef LOGWARNINGS - fprintf(warnlog, "%s ",module); - vfprintf(warnlog,fmt,ap); - fprintf(warnlog,"\n"); -#endif - return; - -} - - - -int tifread_into_buffer(Mytiff * mytiff, void ** buffer){ - /* just a stub, maybe not useful?*/ -} - -/* obtain some values from the tiff and check if they are what was expected */ -int tifgettags(Mytiff * mytiff){ - int row,cval; - int32_t ww=0,hh=0,bb=0; - - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_IMAGEWIDTH,&ww); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading width\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_ROWSPERSTRIP,&hh); - //printf("rowsperstrip: %i\n",hh); - mytiff->stripnum=TIFFNumberOfStrips(mytiff->tiffp); - mytiff->stripsize=TIFFRawStripSize(mytiff->tiffp,0); - - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_STRIPOFFSETS,&(mytiff->offsets)); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading offsets\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_STRIPBYTECOUNTS,&(mytiff->bytecounts)); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading bytecounts\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_IMAGELENGTH,&hh); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading length\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_BITSPERSAMPLE,&bb); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading bitspersample\n",__func__); - return(103); - } - - /* check validity of this tiff for the job */ - /* height and width should always match */ - /* unless zero then it's unknown */ - /* and the new value used */ - - - if (mytiff->wd != 0) { - if(ww != mytiff->wd){ - fprintf(stderr,"ERROR: data mismatch in %s!\n found ww=%i hh=%i bb=%i \n",__func__,ww,hh,bb); - fprintf(stderr,"expected wd=%i ht=%i bits=%i \n",mytiff->wd,mytiff->ht,mytiff->bits); - return(102); - } - } - - if (mytiff->ht != 0) { - if(hh != mytiff->ht){ - fprintf(stderr,"ERROR: data mismatch in %s!\n found ww=%i hh=%i bb=%i \n",__func__,ww,hh,bb); - fprintf(stderr,"expected wd=%i ht=%i bits=%i \n",mytiff->wd,mytiff->ht,mytiff->bits); - return(102); - } - } - - if (mytiff->bits != 0) { - if(bb != mytiff->bits){ - fprintf(stderr,"ERROR: data mismatch in %s!\n found ww=%i hh=%i bb=%i \n",__func__,ww,hh,bb); - fprintf(stderr,"expected wd=%i ht=%i bits=%i \n",mytiff->wd,mytiff->ht,mytiff->bits); - return(102); - } - } - - - mytiff->ht = hh; - mytiff->wd = ww; - mytiff->bits=(bb); - mytiff->bytes=(bb/8); - mytiff->ndata=mytiff->wd * mytiff->ht; - mytiff->nbytes = mytiff->ndata * mytiff->bytes; - - /* obtain the raw file io descriptor number */ - mytiff->tiffno=TIFFFileno(mytiff->tiffp); - -return(0); -} - -int tifclose(Mytiff * mytiff){ - int cval; - TIFFClose(mytiff->tiffp); - tiffree (mytiff); - return(0); -} - -/* just open the tiff and keep the pointer in a structure */ -/* this does not read the data into the buffer */ -/* need to call tiffgetstripsdata */ - -int tifread(Mytiff * mytiff, const char * const filename){ - int cval; - - mytiff->tiffp=TIFFOpen(filename,"rc"); - - if (mytiff->tiffp == NULL ){ - fprintf(stderr,"%s: TIFFOpen function failed (returned NULL) for %s!\n",__func__,filename); - return(101); - } - - cval=tifgettags(mytiff); - return(cval); -} - -void tifgetstripsdata(Mytiff * mytiff,char * buf){ -/* buf is already allocated */ - int i; - char * bstart; - - bstart=buf; - for (i=0;istripnum;i++){ - TIFFReadRawStrip(mytiff->tiffp,i,bstart,mytiff->stripsize); - bstart+=mytiff->stripsize; - } -#ifdef FIX_SLITS - { - int slitrows; - int thisrow; - int startrow; - slitrows=SLITROWS; - startrow=mytiff->ht - slitrows; - - for (i=0;iwd * mytiff->bytes), buf+startrow*(mytiff->wd * mytiff->bytes) ,mytiff->wd * mytiff->bytes); - } - } -#endif /*FIX_SLITS */ -} - -int tifwritestrips(Mytiff * mytiff, const char * const filename){ - /* write the strips by assembling the strip and calling the routine */ - /* this is probably not useful, I think TIFF library handles it better if*/ - /* you just call the scanline routine */ - int i; - int r; - char * datap; - int row; - tsize_t thisstrip; - row=mytiff->wd*mytiff->bytes; - - datap=mytiff->data; - thisstrip=TIFFVStripSize(mytiff->tiffp,mytiff->stripsize); - for (i=0;istripnum-1;i++){ - TIFFWriteEncodedStrip(mytiff->tiffp,i,datap,thisstrip); - datap += ( thisstrip ); - } - - TIFFWriteEncodedStrip(mytiff->tiffp,i,datap,mytiff->nbytes - (mytiff->stripnum - 1)*(thisstrip)); - - TIFFClose(mytiff->tiffp); -return(0); -} - -/* write the tiff by scanlines. This allows tiff library functions to handle strip transitions, encoding ,etc. */ -int tifwrite(Mytiff * mytiff, const char * const filename){ - int i; - char * datap; - int row; - row=mytiff->wd*mytiff->bytes; - - datap=mytiff->data; - for (i=0;iht;i++){ - TIFFWriteScanline(mytiff->tiffp,datap,i,0); - datap += ( row ); - } - TIFFClose(mytiff->tiffp); -return(0); -} - -int tifinit(Mytiff * mytiff,const char * const filename){ - int myerror; - char * Stripbytes=NULL; - u_int32_t stripbytes,estsize,estbytes; - - - myerror=0; - mytiff->ndata=mytiff->wd * mytiff->ht; - mytiff->nbytes = mytiff->ndata * mytiff->bytes; - mytiff->tiffp= TIFFOpen(filename,"wl"); - if (mytiff->tiffp == 0 ){ - fprintf(stderr,"ERROR: %s: %i: failed tiff open of %s!\n",__func__,__LINE__,filename); - fprintf(stderr,"ERROR: %s: tried to open with TIFFOpen(%s,\"wl\"); \n",__func__,filename); - return(101); - } - TIFFSetField(mytiff->tiffp,TIFFTAG_IMAGEWIDTH,mytiff->wd); - TIFFSetField(mytiff->tiffp,TIFFTAG_IMAGELENGTH,mytiff->ht); - TIFFSetField(mytiff->tiffp,TIFFTAG_BITSPERSAMPLE,mytiff->bytes * 8); - TIFFSetField(mytiff->tiffp,TIFFTAG_PLANARCONFIG,1); - TIFFSetField(mytiff->tiffp,TIFFTAG_PHOTOMETRIC,1); - - /* only 4-byte float or 2-byte int so far */ - - if (mytiff->bytes == 4){ - TIFFSetField(mytiff->tiffp,TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); - }else if (mytiff->bytes == 2){ - TIFFSetField(mytiff->tiffp,TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); - } - - /* set the number of rows per strip , default or overridden by the environment variable */ - - Stripbytes=getenv("I12STRIPBYTES"); - if (Stripbytes == NULL ){ - stripbytes=(D_STRIPBYTES); - }else{ - stripbytes=atoi(Stripbytes); - } - - estbytes=(stripbytes / (mytiff->wd * mytiff->bytes)); - estsize=TIFFDefaultStripSize(mytiff->tiffp,estbytes); - TIFFSetField(mytiff->tiffp,TIFFTAG_ROWSPERSTRIP,estsize); - mytiff->stripnum=TIFFNumberOfStrips(mytiff->tiffp); - mytiff->bytesperstrip=TIFFVStripSize(mytiff->tiffp,mytiff->stripnum); - if (! mytiff->isalloc){ - mytiff->buf=(char *) malloc(mytiff->bytesperstrip); - mytiff->isalloc=1; - } - - VBPRINT("stripbytes %s requested, stripsize set to: %i rows\n",Stripbytes,estsize); - VBPRINT("bytes per strip is: %i \n",mytiff->bytesperstrip); - - return(0); -} - - -#ifdef MAIN -/* a test main-procedure to see if it works */ -int main (int argc,char **argv){ - char * filename; - Mytiff * mytiff; - int i,j; - u_int32_t loc; - int retval; - - retval=0; - mytiff = (Mytiff * ) calloc(1,sizeof (Mytiff)); - mytiff->isalloc=0; - filename = strdup(argv[1]); - mytiff->wd=1024; - mytiff->ht=768; - mytiff->bytes=2; - //tifinit(&mytiff,argv[1]); - #ifdef INMEM - for (j=0;j<768;j++){ - for(i=0;i<1024;i++){ - loc=j*1024+i; - loc *= 2; - mytiff.data[loc]=(char)(i); - mytiff.data[loc + 1]=(char)(j); - } - } - #endif - - retval = tifread(mytiff,filename); -return(retval); -} -#endif diff --git a/c_source_code/dezing/tifwrite.h b/c_source_code/dezing/tifwrite.h deleted file mode 100644 index eaab302a9..000000000 --- a/c_source_code/dezing/tifwrite.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef TIFWRITE_H -#define TIFWRITE_H -#include -#define MAX_MESSAGE (1024) -#define D_STRIPBYTES (2097152) -/*$Id: tifwrite.h 465 2016-02-16 11:02:36Z kny48981 $*/ -typedef struct mytiff_str{ - - u_int32_t wd; - u_int32_t ht; - u_int32_t bytes; - u_int32_t bits; - u_int32_t nbytes; - u_int32_t ndata; - u_int32_t stripnum; - u_int32_t stripsize; - tsize_t bytesperstrip; - u_int32_t * offsets; - u_int32_t * bytecounts; - u_int16_t mypage,npages; - int tiffno; - - char * data; - char * buf; - u_int8_t isalloc; - TIFF * tiffp; -} Mytiff; - -#ifndef TIFWRITE_C -extern int tifread(Mytiff * mytiff, const char * const filename); -extern int tifwrite(Mytiff * mytiff, const char * const filename); -extern int tifwritestrips(Mytiff * mytiff, const char * const filename); -extern int tifinit(Mytiff * mytiff, const char * const filename); -extern int tiffree(Mytiff * mytiff); -extern int tifgettags(Mytiff * mytiff); -extern int tifclose(Mytiff * mytiff); -int tifgetstripsdata(Mytiff * mytiff,char * buf); -#endif - -#endif /*TIFWRITE_H*/ - diff --git a/c_source_code/dezing/timestamp.c b/c_source_code/dezing/timestamp.c deleted file mode 100644 index d063ec4e5..000000000 --- a/c_source_code/dezing/timestamp.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "timestamp.h" -#include "sys/time.h" -FILE * logfp; -struct timeval mystime; -double oldtime=0; - - -int logprint(const char *const message,const int loglevel){ - int retval=0; - int myerror=0; - char outmessage[MAX_MESSAGE]; - snprintf(outmessage,MAX_MESSAGE,"C: dezing: %s",message); - - // debug the logging ! - // printf("%s\n",outmessage); - // return(0); - // - switch (loglevel){ - case(LEVEL_DEBUG): - pydebug(outmessage); - break; - case(LEVEL_INFO): - pyinfo(outmessage); - break; - case(LEVEL_WARN): - pywarn(outmessage); - break; - case(LEVEL_ERR): - pyerr(outmessage); - break; - - default: - /* fallthru */ - case(LEVEL_USER): - pyuser(outmessage); - break; - } - - //retval=fprintf(logfp,"%s",message); - - -// #ifdef FLUSH_LOG_FILE - if( fflush(logfp) == EOF ){ - myerror=errno; - fprintf(stderr,"ERROR: log file flush failed!\n"); - fprintf(stderr,"%s\n",strerror(myerror)); - return(151); - }; -//#endif -return(retval); -} - - -void timestamp_open(const char * const logname){ - logfp=fopen(logname,"w"); -} - -void timestamp_close(void){ - fclose(logfp); -} - -void timestamp_init(){ - struct timeval now; - time_t etimes; - double nowtime,etime,itime; - suseconds_t etimeu; - char message[MAX_MESSAGE]; - - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - oldtime=nowtime; - itime=nowtime-oldtime; - snprintf(message,MAX_MESSAGE,"%f %f %f %s",etime,nowtime,itime,"Time stamp reset"); - logprint(message,LEVEL_INFO); -} - -void timestamp(const char *const stampmsg,const int loglevel){ - struct timeval now; - time_t etimes; - double nowtime,etime,itime; - suseconds_t etimeu; - char message[MAX_MESSAGE]; - - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - itime=nowtime-oldtime; - snprintf(message,MAX_MESSAGE,"%f %f %f %s",etime,nowtime,itime,stampmsg); - logprint(message,loglevel); - oldtime=nowtime; -} - - -int errprint(const char * const message,const int loglevel){ - int retval; - /* print the message with the program name prefixed, and also echo to the log file */ - - if (logfp != NULL){ - retval=fprintf(logfp,"\n*****: %s\n",message); - } - - retval=fprintf(stderr,"%s\n",message); - return(retval); -} - -int vprint(const char * const message){ - int retval=0; - if (vflag != 0 ){ - printf("verbose %i: %s\n",vflag,message); - retval=fprintf(logfp,"%s\n",message); - } - return(retval); -} - - - diff --git a/c_source_code/dezing/timestamp.h b/c_source_code/dezing/timestamp.h deleted file mode 100644 index 4822a259e..000000000 --- a/c_source_code/dezing/timestamp.h +++ /dev/null @@ -1,29 +0,0 @@ - - -#include -#include -#include -#include -#include "machine.h" -extern FILE * logfp; -extern struct timeval mystime; -extern double oldtime; -extern unsigned char vflag; -extern int logprint(const char *const message,const int level); -extern void timestamp_init(void); -extern void timestamp_open(const char * const logname); -extern void timestamp_close(void); -extern void timestamp(const char *const stampmsg,const int level); -extern int errprint(const char * const message,const int level); -extern int vprint(const char * const message); -extern void pydebug(char * message); -extern void pyinfo(char * message); -extern void pyuser(char * message); -extern void pywarn(char * message); -extern void pyerr(char * message); - -#define LEVEL_DEBUG (0) -#define LEVEL_INFO (1) -#define LEVEL_USER (2) -#define LEVEL_WARN (3) -#define LEVEL_ERR (4) diff --git a/c_source_code/distortion/.gitignore b/c_source_code/distortion/.gitignore deleted file mode 100644 index 62872da04..000000000 --- a/c_source_code/distortion/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.* -unwarp.cpp -!/.gitignore - diff --git a/c_source_code/distortion/Makefile b/c_source_code/distortion/Makefile deleted file mode 100644 index b1c1843b0..000000000 --- a/c_source_code/distortion/Makefile +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/local/bin/gnumake - -CXX := g++ -CC := gcc -LINK := gcc -.SUFFIXES : .c .cpp .cu .o - - -#FFTWPREFIX := ${FFTWDIR} - -OPTIMIZER = -O3 - -#include all warnings .. -#FLAGS = $(OPTIMIZER) -DPCO_4000_FIX_BCD #-Wall -FLAGS = $(OPTIMIZER) #-DDEBUG_ALGORITHM # -DDEBUG_DEZING_FIX # -DDEBUG_INDEX # -DTESTRAW #-Wall - -FLAGS += $(CFLAGS) - -#location of the library folders - -LIBDIRS = - -#-L$(FFTWPREFIX)/lib - -INCDIRS := - -#-I$(FFTWPREFIX)/include/ - -#library flags required -# -# - - -LIBS = -lm -ldl -lrt \ --pthread -Wl,-rpath `pwd` - -#-Wl,-rpath $(FFTWPREFIX)/lib \ - -# add this flag to get lots of linker output -#-Wl,--verbose - - -CPPSOURCES=\ - unwarp_functions.cpp -CSOURCES=\ - timestamp.c - -CPPMAIN=\ - unwarp_functions.cpp -CMAIN=\ - tifwrite.c - -CSALL=$(CSOURCES) $(CMAIN) $(CPPSOURCES) $(CPPMAIN) - - -COBJECTS=$(CSOURCES:%.c=%.o) $(CPPSOURCES:%.cpp=%.o) - -COBJLIB=$(CSOURCES:%.c=%.o) $(CPPSOURCES:%.cpp=%.o) - - -COBJMAIN=$(CMAIN:%.c=%.o) - - -PROGNAME=unwarp_batch - -SHARENAME=libunwarp.so -STATICNAME=libunwarp.a - -DFFLAGS = -DDEBUGALL - -# the dependencies -default: $(PROGNAME) - -debug: OPTIMIZER := -ggdb -debug: FLAGS += -lefence -debug: clean $(COBJECTS) - $(CXX) -o $@ $(COBJECTS) $(LIBDIRS) $(LIBS) $(FLAGS) -ltiff - - -debugthread: OPTIMIZER := -ggdb -debugthread: FLAGS += -DSINGLETHREAD -DDEBUG_THREADSCALE -debugthread: clean $(COBJECTS) - $(CXX) -o $@ $(COBJECTS) $(LIBDIRS) $(LIBS) $(FLAGS) - -debugfilt: FLAGS += $(DFFLAGS) -debugfilt: clean $(COBJECTS) - $(CXX) -o $@ $(COBJECTS) $(LIBDIRS) $(LIBS) $(FLAGS) - - -.c.o: - $(CXX) $(INCDIRS) $(FLAGS) -c $< - -.cpp.o: - $(CXX) $(INCDIRS) $(FLAGS) -c $< - - - -$(PROGNAME): $(CUDAOBJECTS) $(COBJMAIN) shared - $(CXX) -o $@ $(COBJMAIN) $(LIBDIRS) $(LIBS) $(FLAGS) $(SHARENAME) -ltiff - -shared: FLAGS+=-fPIC -Wall -shared: $(SHARENAME) - -static: FLAGS+=-fPIC -Wall -static: $(STATICNAME) - - -$(SHARENAME): $(CUDAOBJECTS) $(COBJLIB) - $(CXX) -o $@ $(COBJLIB) $(LIBDIRS) $(LIBS) $(FLAGS) -shared - -$(STATICNAME): $(CUDAOBJECTS) $(COBJLIB) - ar rcs $@ $(COBJLIB) - -# using 'export NVCCFLAGS=-DDEBUGTIME' in the shell -# to activate the extra time print out - -clean: - rm -f $(COBJECTS) $(PROGNAME) debugfilt $(SHARENAME) $(STATICNAME) - - diff --git a/c_source_code/distortion/allclean.sh b/c_source_code/distortion/allclean.sh deleted file mode 100755 index d975e4cef..000000000 --- a/c_source_code/distortion/allclean.sh +++ /dev/null @@ -1,8 +0,0 @@ - -#$Id: allclean.sh 448 2015-12-15 12:14:14Z kny48981 $ -set -x -make clean -rm -f unwarpint16.so unwarp.so unwarpint16.cpp unwarp.cpp -rm -rf build -set +x - diff --git a/c_source_code/distortion/buildfloat.sh b/c_source_code/distortion/buildfloat.sh deleted file mode 100644 index f44c7e912..000000000 --- a/c_source_code/distortion/buildfloat.sh +++ /dev/null @@ -1,17 +0,0 @@ -module add python/ana -#$Id: buildfloat.sh 448 2015-12-15 12:14:14Z kny48981 $ - -#make shared -#make static - -# the setup.py done this way automatically calls the compiler -# no need for building the library explicitly -# but additional source files need to be added in the .pyx file in special comments for distutils - -export CFLAGS="-I . $CFLAGS" -export LDFLAGS="-L . $LDFLAGS" -./clean.sh -python setupfloat.py build_ext -i -#python setup.py cythonize -#make debug - diff --git a/c_source_code/distortion/buildint16.sh b/c_source_code/distortion/buildint16.sh deleted file mode 100755 index d9509114d..000000000 --- a/c_source_code/distortion/buildint16.sh +++ /dev/null @@ -1,16 +0,0 @@ -module add python/ana -#$Id: buildint16.sh 446 2015-12-15 12:08:48Z kny48981 $ - -#make shared -#make static - -# the setup.py done this way automatically calls the compiler -# no need for building the library explicitly -# but additional source files need to be added in the .pyx file in special comments for distutils - -export CFLAGS="-I . $CFLAGS" -export LDFLAGS="-L . $LDFLAGS" -python setupint16.py build_ext -i -#python setup.py cythonize -#make debug - diff --git a/c_source_code/distortion/clean.sh b/c_source_code/distortion/clean.sh deleted file mode 100755 index 57d379e4b..000000000 --- a/c_source_code/distortion/clean.sh +++ /dev/null @@ -1,8 +0,0 @@ - -#$Id: clean.sh 448 2015-12-15 12:14:14Z kny48981 $ -set -x -make clean -rm -f unwarp.cpp unwarp.cpp -rm -rf build -set +x - diff --git a/c_source_code/distortion/cunwarp.pxd b/c_source_code/distortion/cunwarp.pxd deleted file mode 100644 index 46b122fc9..000000000 --- a/c_source_code/distortion/cunwarp.pxd +++ /dev/null @@ -1,29 +0,0 @@ - -#$Id: cunwarp.pxd 444 2015-12-15 11:56:04Z kny48981 $ -cdef extern from "./options.h": - cdef cppclass Options: - #ctypedef struct Options: - unsigned char versionflag - unsigned char pixelflag - unsigned char f_call_num - unsigned int ht; - unsigned int wd; - unsigned int firstslice; - unsigned int lastslice; - float xcentre; - float ycentre; - float acoeff - float bcoeff - float ccoeff - float dcoeff - float ecoeff - -cdef extern from "./timestamp.h": - void timestamp_open(const char * const logname) - void timestamp_close() - void timestamp_init() - void timestamp(const char * const stampmsg,const int level) - -cdef extern from "./unwarp_functions.h": - void runUnwarp(Options * ctrlp, unsigned int thisbatch,unsigned char * inbuf, unsigned char * outbuf ) - diff --git a/c_source_code/distortion/findroot.c b/c_source_code/distortion/findroot.c deleted file mode 100644 index ffa418983..000000000 --- a/c_source_code/distortion/findroot.c +++ /dev/null @@ -1,92 +0,0 @@ - -#include -#include - -#define MAXROOT 3000000 -#define FOURPI_BY_THREE -#define MINROOT -3000000 -#define MAX_ITERATIONS 1000 -#define CONVERGE_LIMIT 1e-12 - -/* find the radius using Newton's method , adapted from Numerical Recipes in C by Press and Flannery */ - -double find_new_radius (double a, double b, double c, double d, double r) -{ - double f, df, dx, sigma, rold,rzero; - int i; - rzero=r; - - - for (i = 0; i < MAX_ITERATIONS; i++) { - f = a*r + b*r*r + c*r*r*r +d*r*r*r*r-rzero; - df = a + 2.0*b*r + 3.0*c*r*r + 4*d*r*r*r ; - dx = f / df; - rold = r; - r -= dx; -#ifdef TEST_FINDROOT - printf ("r: %.10g, r-rold %.10g, (r-rold/rold) %.10g\n", r, r-rold, (r - rold)/rold); -#endif - - if ((MAXROOT - r) * (r - MINROOT) < 0.0) { -#ifdef ERROR_EXIT - fprintf (stderr, "ERROR: find_new_radius: exceeded bounds on radius.\n"); - exit (10); -#endif -#ifdef TEST_FINDROOT - printf ("Returning due to bounds on radius.\n"); -#endif - return (r); - } - if (fabs ((r - rold)/rold) < CONVERGE_LIMIT) { -#ifdef TEST_FINDROOT - printf ("Niter: %i\n", i); -#endif -#ifdef TEST_FINDROOT - printf("Returning due to convergence criterion\n"); -#endif - return (r); - } - } -#ifdef ERROR_EXIT - fprintf (stderr, "ERROR: find_new_radius: exceeded maximum iterations.\n"); - exit (10); -#endif - return (r); -} - -#ifdef TEST_FINDROOT_MAIN -void main () -{ - double a,b,c,d, r, rNew; - double f; - float rin; - a=.99; - b=1e-5; - c=1e-7; - d=1e-9; - - - for (;;) { - printf ("r_dist:\n"); - scanf ("%f", &rin); - r=(double)(rin); - printf ("Rold = %.5g\n", r); - rNew = find_new_radius (a,b,c,d, r); - f = a*rNew + b*rNew*rNew + c*rNew*rNew*rNew +d*rNew*rNew*rNew*rNew; - printf ("Rnew = %g f=%g\n", rNew,f); - } - -} -#endif /*TEST_FINDROOT_MAIN*/ - -/* Little subroutine to get rcs id into the object code */ -/* so you can use ident on the compiled program */ -/* also you can call this to print out or include the rcs id in a file */ -char const *rcs_id_findroot_c () -{ - static char const rcsid[] = "$Id: findroot.c 393 2015-10-05 14:02:11Z kny48981 $"; - - return (rcsid); -} - -/* end of rcs_id_subroutine */ diff --git a/c_source_code/distortion/imagenorm.h b/c_source_code/distortion/imagenorm.h deleted file mode 100644 index 5e085907d..000000000 --- a/c_source_code/distortion/imagenorm.h +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include - -// If your GPU has less memory, then you will need to decrease this data size. - #define MAX_DATA_SIZE 1024*1024*172 -//#define MAX_DATA_SIZE 256 * 8 -// The max data size must be an integer multiple of 128*256, because each block will have 256 threads, -// and the block grid width will be 128. These are arbitrary numbers I choose. -#define THREADS_PER_BLOCK 400 -#define RTHREADS 256 -//#define BLOCKS_PER_GRID_ROW 8 -#define BLOCKS_PER_GRID_ROW 128 -#define DEBUGBLOCK (18) diff --git a/c_source_code/distortion/machine.h b/c_source_code/distortion/machine.h deleted file mode 100644 index f0a7a26e2..000000000 --- a/c_source_code/distortion/machine.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MACHINE_H -#define MACHINE_H -#define MAX_MESSAGE (1024) -#define Day (86400) -#define Hour (3600) -#define Minute (60) -#endif diff --git a/c_source_code/distortion/options.h b/c_source_code/distortion/options.h deleted file mode 100644 index ae7fc377b..000000000 --- a/c_source_code/distortion/options.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef OPTIONS_H -#define OPTIONS_H -#include "stdio.h" -#define SVN_ID_OPTIONS_H "$Id: options.h 444 2015-12-15 11:56:04Z kny48981 $" -#define SVN_URL_OPTIONS_H "$URL: file:///home/kny48981/SVN/progs/unwarp_cython/options.h $" -typedef struct Options_str { - char *indir, *outdir, *jobname, *fname; - char *infmt, *outfmt; - unsigned int ht; - unsigned int wd; - unsigned int firstslice; - unsigned int lastslice; - float xcentre; - float ycentre; - u_int32_t nlines; - u_int32_t bytes; - u_int32_t nperseg; - u_int32_t nproj; - u_int32_t timeout; - u_int32_t interval; - u_int32_t avnum; - u_int32_t nchunks; - u_int32_t mychunk; - u_int8_t Dtype; - u_int8_t Usegpu; - unsigned char f_call_num; - unsigned char versionflag; - unsigned char pixelflag; - float dcoeff,acoeff,bcoeff,ccoeff,ecoeff; - -} Options; - -#endif /*OPTIONS_H*/ diff --git a/c_source_code/distortion/setupfloat.py b/c_source_code/distortion/setupfloat.py deleted file mode 100644 index 99df906d7..000000000 --- a/c_source_code/distortion/setupfloat.py +++ /dev/null @@ -1,10 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext -from Cython.Build import cythonize -#$Id: setupfloat.py 447 2015-12-15 12:09:51Z kny48981 $ -setup( - name = "unwarp_app", - ext_modules = cythonize('unwarp.pyx'), - ) - diff --git a/c_source_code/distortion/setupint16.py b/c_source_code/distortion/setupint16.py deleted file mode 100644 index 75a50a4eb..000000000 --- a/c_source_code/distortion/setupint16.py +++ /dev/null @@ -1,10 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext -from Cython.Build import cythonize -#$Id: setupint16.py 446 2015-12-15 12:08:48Z kny48981 $ -setup( - name = "unwarpint16_app", - ext_modules = cythonize('unwarpint16.pyx'), - ) - diff --git a/c_source_code/distortion/test_f.py b/c_source_code/distortion/test_f.py deleted file mode 100644 index 8e8db78b9..000000000 --- a/c_source_code/distortion/test_f.py +++ /dev/null @@ -1,47 +0,0 @@ -import tifffile -import numpy as np -import sys -import os -import unwarp -nbatch=100 - -def get_image_array(): - global nbatch - #inim=np.expand_dims(tifffile.imread("index-1.tif"),0) - #inim=np.expand_dims(tifffile.imread("p_00600.tif"),0) - inim=np.expand_dims(tifffile.imread("i32.tif"),0) - inimt=np.tile(inim,(nbatch,1,1)) - inim3=np.ascontiguousarray(inimt.astype(np.float32)) - print "shape: ",inim3.shape - outim=np.empty_like(inim3) - return(inim3,outim) -#end of get_image_array - -(inarray,outarray)=get_image_array() - -#set the coefficients -- this coudl be rolled into setup with additional args? -unwarp.setcoeff(1,-1e-3,-6e-7,5e-10,-4e-13) -unwarp.setctr(1000,1000) - -#call setup routine -unwarp.setup(inarray,outarray) - -unwarp.run(inarray,outarray) -#multiple calls so long as centre and parameters are fixed -#could be different data solong as it is same type/size/etc -unwarp.run(inarray,outarray) - - -unwarp.cleanup() - -print("Writing the files to /dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out") -try: - os.makedirs("/dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out") - print ("Creating Folder") -except: - print ("Folder already exists") - - -for i in range(0,1): - tifffile.imsave( "/dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out/p_%05d.tif"%i,outarray[i,:,:]) - diff --git a/c_source_code/distortion/test_u.py b/c_source_code/distortion/test_u.py deleted file mode 100644 index 309b671a6..000000000 --- a/c_source_code/distortion/test_u.py +++ /dev/null @@ -1,47 +0,0 @@ -import tifffile -import numpy as np -import sys -import os -import unwarpint16 as unwarp -nbatch=100 - -def get_image_array(): - global nbatch - #inim=np.expand_dims(tifffile.imread("index-1.tif"),0) - #inim=np.expand_dims(tifffile.imread("p_00600.tif"),0) - inim=np.expand_dims(tifffile.imread("i32.tif"),0) - inimt=np.tile(inim,(nbatch,1,1)) - inim3=np.ascontiguousarray(inimt.astype(np.uint16)) - print "shape: ",inim3.shape - outim=np.empty_like(inim3) - return(inim3,outim) -#end of get_image_array - -(inarray,outarray)=get_image_array() - -#set the coefficients -- this coudl be rolled into setup with additional args? -unwarp.setcoeff(1,-1e-3,-6e-7,5e-10,-4e-13) -unwarp.setctr(1000,1000) - -#call setup routine -unwarp.setup(inarray,outarray) - -unwarp.run(inarray,outarray) -#multiple calls so long as centre and parameters are fixed -#could be different data solong as it is same type/size/etc -unwarp.run(inarray,outarray) - - -unwarp.cleanup() - -print("Writing the files to /dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out") -try: - os.makedirs("/dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out") - print ("Creating Folder") -except: - print ("Folder already exists") - - -for i in range(0,1): - tifffile.imsave( "/dls/i12/data/2015/cm12163-5/tmp/unwarptest/cython_out/p_%05d.tif"%i,outarray[i,:,:]) - diff --git a/c_source_code/distortion/testmain.cpp b/c_source_code/distortion/testmain.cpp deleted file mode 100644 index 873b2e4ef..000000000 --- a/c_source_code/distortion/testmain.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "options.h" -#include "timestamp.h" -#include "unwarp_functions.h" -#define SVN_ID_TEST_MAIN "$Id: testmain.cpp 444 2015-12-15 11:56:04Z kny48981 $" - -Options ctrl; - -void setcoeff(float a, float b, float c, float d, float e){ - ctrl.acoeff=a; - ctrl.bcoeff=b; - ctrl.ccoeff=c; - ctrl.dcoeff=d; - ctrl.ecoeff=e; -} - -int main(int argc,char **argv){ - unsigned char * inarray; - unsigned char * outarray; - unsigned int batchsize; - batchsize=atoi(argv[1]); - ctrl.wd=2000; - ctrl.ht=2000; - int k; - - inarray=(unsigned char * )calloc(batchsize * ctrl.wd*ctrl.ht,2); - outarray=(unsigned char * )calloc(batchsize * ctrl.wd*ctrl.ht,2); - timestamp_open("test.log"); - timestamp_init(); - - ctrl.versionflag=0; - - for (k=0;k<10000;k++){ - setcoeff(1,-1e-5,0,0,0); - ctrl.xcentre=1000; - ctrl.ycentre=1000; - ctrl.f_call_num=0; - runUnwarp(&ctrl,batchsize,inarray,outarray); - ctrl.f_call_num=1; - runUnwarp(&ctrl,batchsize,inarray,outarray); - } - - ctrl.f_call_num=2; - runUnwarp(&ctrl,batchsize,inarray,outarray); - timestamp_close(); - - // run twice to check persistance of the lookup tables - // runUnwarp(&ctrl,batchsize,inarray,outarray); - - free(inarray); - free(outarray); - -} diff --git a/c_source_code/distortion/tifffile.py b/c_source_code/distortion/tifffile.py deleted file mode 100644 index b852eba7f..000000000 --- a/c_source_code/distortion/tifffile.py +++ /dev/null @@ -1,3668 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# tifffile.py - -# Copyright (c) 2008-2014, Christoph Gohlke -# Copyright (c) 2008-2014, The Regents of the University of California -# Produced at the Laboratory for Fluorescence Dynamics -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the copyright holders nor the names of any -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -"""Read and write image data from and to TIFF files. - -Image and meta-data can be read from TIFF, BigTIFF, OME-TIFF, STK, LSM, NIH, -ImageJ, MicroManager, FluoView, SEQ and GEL files. -Only a subset of the TIFF specification is supported, mainly uncompressed -and losslessly compressed 2**(0 to 6) bit integer, 16, 32 and 64-bit float, -grayscale and RGB(A) images, which are commonly used in bio-scientific imaging. -Specifically, reading JPEG/CCITT compressed image data or EXIF/IPTC/GPS/XMP -meta-data is not implemented. Only primary info records are read for STK, -FluoView, MicroManager, and NIH image formats. - -TIFF, the Tagged Image File Format, is under the control of Adobe Systems. -BigTIFF allows for files greater than 4 GB. STK, LSM, FluoView, SEQ, GEL, -and OME-TIFF, are custom extensions defined by MetaMorph, Carl Zeiss -MicroImaging, Olympus, Media Cybernetics, Molecular Dynamics, and the Open -Microscopy Environment consortium respectively. - -For command line usage run ``python tifffile.py --help`` - -:Author: - `Christoph Gohlke `_ - -:Organization: - Laboratory for Fluorescence Dynamics, University of California, Irvine - -:Version: 2014.02.05 - -Requirements ------------- -* `CPython 2.7 or 3.3 `_ -* `Numpy 1.7 `_ -* `Matplotlib 1.3 `_ (optional for plotting) -* `Tifffile.c 2013.01.18 `_ - (recommended for faster decoding of PackBits and LZW encoded strings) - -Notes ------ -The API is not stable yet and might change between revisions. - -Tested on little-endian platforms only. - -Other Python packages and modules for reading bio-scientific TIFF files: -* `Imread `_ -* `PyLibTiff `_ -* `SimpleITK `_ -* `PyLSM `_ -* `PyMca.TiffIO.py `_ -* `BioImageXD.Readers `_ -* `Cellcognition.io `_ -* `CellProfiler.bioformats `_ - -Acknowledgements ----------------- -* Egor Zindy, University of Manchester, for cz_lsm_scan_info specifics. -* Wim Lewis for a bug fix and some read_cz_lsm functions. -* Hadrien Mary for help on reading MicroManager files. - -References ----------- -(1) TIFF 6.0 Specification and Supplements. Adobe Systems Incorporated. - http://partners.adobe.com/public/developer/tiff/ -(2) TIFF File Format FAQ. http://www.awaresystems.be/imaging/tiff/faq.html -(3) MetaMorph Stack (STK) Image File Format. - http://support.meta.moleculardevices.com/docs/t10243.pdf -(4) File Format Description - LSM 5xx Release 2.0. - http://ibb.gsf.de/homepage/karsten.rodenacker/IDL/Lsmfile.doc -(5) BioFormats. http://www.loci.wisc.edu/ome/formats.html -(6) The OME-TIFF format. - http://www.openmicroscopy.org/site/support/file-formats/ome-tiff -(7) TiffDecoder.java - http://rsbweb.nih.gov/ij/developer/source/ij/io/TiffDecoder.java.html -(8) UltraQuant(r) Version 6.0 for Windows Start-Up Guide. - http://www.ultralum.com/images%20ultralum/pdf/UQStart%20Up%20Guide.pdf -(9) Micro-Manager File Formats. - http://www.micro-manager.org/wiki/Micro-Manager_File_Formats - -Examples --------- ->>> data = numpy.random.rand(301, 219) ->>> imsave('temp.tif', data) ->>> image = imread('temp.tif') ->>> assert numpy.all(image == data) - ->>> tif = TiffFile('test.tif') ->>> images = tif.asarray() ->>> image0 = tif[0].asarray() ->>> for page in tif: -... for tag in page.tags.values(): -... t = tag.name, tag.value -... image = page.asarray() -... if page.is_rgb: pass -... if page.is_palette: -... t = page.color_map -... if page.is_stk: -... t = page.mm_uic_tags.number_planes -... if page.is_lsm: -... t = page.cz_lsm_info ->>> tif.close() - -""" - -from __future__ import division, print_function - -import sys -import os -import re -import glob -import math -import zlib -import time -import json -import struct -import warnings -import datetime -import collections -from fractions import Fraction -from xml.etree import cElementTree as ElementTree - -import numpy - -__version__ = '2014.02.05' -__docformat__ = 'restructuredtext en' -__all__ = ['imsave', 'imread', 'imshow', 'TiffFile', 'TiffSequence'] - - -def imsave(filename, data, photometric=None, planarconfig=None, - resolution=None, description=None, software='tifffile.py', - byteorder=None, bigtiff=False, compress=0, extratags=()): - """Write image data to TIFF file. - - Image data are written in one stripe per plane. - Dimensions larger than 2 or 3 (depending on photometric mode and - planar configuration) are flattened and saved as separate pages. - The 'sample_format' and 'bits_per_sample' TIFF tags are derived from - the data type. - - Parameters - ---------- - filename : str - Name of file to write. - data : array_like - Input image. The last dimensions are assumed to be image height, - width, and samples. - photometric : {'minisblack', 'miniswhite', 'rgb'} - The color space of the image data. - By default this setting is inferred from the data shape. - planarconfig : {'contig', 'planar'} - Specifies if samples are stored contiguous or in separate planes. - By default this setting is inferred from the data shape. - 'contig': last dimension contains samples. - 'planar': third last dimension contains samples. - resolution : (float, float) or ((int, int), (int, int)) - X and Y resolution in dots per inch as float or rational numbers. - description : str - The subject of the image. Saved with the first page only. - software : str - Name of the software used to create the image. - Saved with the first page only. - byteorder : {'<', '>'} - The endianness of the data in the file. - By default this is the system's native byte order. - bigtiff : bool - If True, the BigTIFF format is used. - By default the standard TIFF format is used for data less than 2000 MB. - compress : int - Values from 0 to 9 controlling the level of zlib compression. - If 0, data are written uncompressed (default). - extratags: sequence of tuples - Additional tags as [(code, dtype, count, value, writeonce)]. - code : int - The TIFF tag Id. - dtype : str - Data type of items in `value` in Python struct format. - One of B, s, H, I, 2I, b, h, i, f, d, Q, or q. - count : int - Number of data values. Not used for string values. - value : sequence - `Count` values compatible with `dtype`. - writeonce : bool - If True, the tag is written to the first page only. - - Examples - -------- - >>> data = numpy.ones((2, 5, 3, 301, 219), 'float32') * 0.5 - >>> imsave('temp.tif', data, compress=6) - - >>> data = numpy.ones((5, 301, 219, 3), 'uint8') + 127 - >>> value = u'{"shape": %s}' % str(list(data.shape)) - >>> imsave('temp.tif', data, extratags=[(270, 's', 0, value, True)]) - - """ - assert(photometric in (None, 'minisblack', 'miniswhite', 'rgb')) - assert(planarconfig in (None, 'contig', 'planar')) - assert(byteorder in (None, '<', '>')) - assert(0 <= compress <= 9) - - if byteorder is None: - byteorder = '<' if sys.byteorder == 'little' else '>' - - data = numpy.asarray(data, dtype=byteorder+data.dtype.char, order='C') - data_shape = shape = data.shape - data = numpy.atleast_2d(data) - - if not bigtiff and data.size * data.dtype.itemsize < 2000*2**20: - bigtiff = False - offset_size = 4 - tag_size = 12 - numtag_format = 'H' - offset_format = 'I' - val_format = '4s' - else: - bigtiff = True - offset_size = 8 - tag_size = 20 - numtag_format = 'Q' - offset_format = 'Q' - val_format = '8s' - - # unify shape of data - samplesperpixel = 1 - extrasamples = 0 - if photometric is None: - if data.ndim > 2 and (shape[-3] in (3, 4) or shape[-1] in (3, 4)): - photometric = 'rgb' - else: - photometric = 'minisblack' - if photometric == 'rgb': - if len(shape) < 3: - raise ValueError("not a RGB(A) image") - if planarconfig is None: - planarconfig = 'planar' if shape[-3] in (3, 4) else 'contig' - if planarconfig == 'contig': - if shape[-1] not in (3, 4): - raise ValueError("not a contiguous RGB(A) image") - data = data.reshape((-1, 1) + shape[-3:]) - samplesperpixel = shape[-1] - else: - if shape[-3] not in (3, 4): - raise ValueError("not a planar RGB(A) image") - data = data.reshape((-1, ) + shape[-3:] + (1, )) - samplesperpixel = shape[-3] - if samplesperpixel == 4: - extrasamples = 1 - elif planarconfig and len(shape) > 2: - if planarconfig == 'contig': - data = data.reshape((-1, 1) + shape[-3:]) - samplesperpixel = shape[-1] - else: - data = data.reshape((-1, ) + shape[-3:] + (1, )) - samplesperpixel = shape[-3] - extrasamples = samplesperpixel - 1 - else: - planarconfig = None - # remove trailing 1s - while len(shape) > 2 and shape[-1] == 1: - shape = shape[:-1] - data = data.reshape((-1, 1) + shape[-2:] + (1, )) - - shape = data.shape # (pages, planes, height, width, contig samples) - - bytestr = bytes if sys.version[0] == '2' else ( - lambda x: bytes(x, 'utf-8') if isinstance(x, str) else x) - tifftypes = {'B': 1, 's': 2, 'H': 3, 'I': 4, '2I': 5, 'b': 6, - 'h': 8, 'i': 9, 'f': 11, 'd': 12, 'Q': 16, 'q': 17} - tifftags = { - 'new_subfile_type': 254, 'subfile_type': 255, - 'image_width': 256, 'image_length': 257, 'bits_per_sample': 258, - 'compression': 259, 'photometric': 262, 'fill_order': 266, - 'document_name': 269, 'image_description': 270, 'strip_offsets': 273, - 'orientation': 274, 'samples_per_pixel': 277, 'rows_per_strip': 278, - 'strip_byte_counts': 279, 'x_resolution': 282, 'y_resolution': 283, - 'planar_configuration': 284, 'page_name': 285, 'resolution_unit': 296, - 'software': 305, 'datetime': 306, 'predictor': 317, 'color_map': 320, - 'extra_samples': 338, 'sample_format': 339} - tags = [] # list of (code, ifdentry, ifdvalue, writeonce) - - def pack(fmt, *val): - return struct.pack(byteorder+fmt, *val) - - def addtag(code, dtype, count, value, writeonce=False): - # compute ifdentry and ifdvalue bytes from code, dtype, count, value - # append (code, ifdentry, ifdvalue, writeonce) to tags list - code = tifftags[code] if code in tifftags else int(code) - if dtype not in tifftypes: - raise ValueError("unknown dtype %s" % dtype) - tifftype = tifftypes[dtype] - rawcount = count - if dtype == 's': - value = bytestr(value) + b'\0' - count = rawcount = len(value) - value = (value, ) - if len(dtype) > 1: - count *= int(dtype[:-1]) - dtype = dtype[-1] - ifdentry = [pack('HH', code, tifftype), - pack(offset_format, rawcount)] - ifdvalue = None - if count == 1: - if isinstance(value, (tuple, list)): - value = value[0] - ifdentry.append(pack(val_format, pack(dtype, value))) - elif struct.calcsize(dtype) * count <= offset_size: - ifdentry.append(pack(val_format, pack(str(count)+dtype, *value))) - else: - ifdentry.append(pack(offset_format, 0)) - ifdvalue = pack(str(count)+dtype, *value) - tags.append((code, b''.join(ifdentry), ifdvalue, writeonce)) - - def rational(arg, max_denominator=1000000): - # return nominator and denominator from float or two integers - try: - f = Fraction.from_float(arg) - except TypeError: - f = Fraction(arg[0], arg[1]) - f = f.limit_denominator(max_denominator) - return f.numerator, f.denominator - - if software: - addtag('software', 's', 0, software, writeonce=True) - if description: - addtag('image_description', 's', 0, description, writeonce=True) - elif shape != data_shape: - addtag('image_description', 's', 0, - "shape=(%s)" % (",".join('%i' % i for i in data_shape)), - writeonce=True) - addtag('datetime', 's', 0, - datetime.datetime.now().strftime("%Y:%m:%d %H:%M:%S"), - writeonce=True) - addtag('compression', 'H', 1, 32946 if compress else 1) - addtag('orientation', 'H', 1, 1) - addtag('image_width', 'I', 1, shape[-2]) - addtag('image_length', 'I', 1, shape[-3]) - addtag('new_subfile_type', 'I', 1, 0 if shape[0] == 1 else 2) - addtag('sample_format', 'H', 1, - {'u': 1, 'i': 2, 'f': 3, 'c': 6}[data.dtype.kind]) - addtag('photometric', 'H', 1, - {'miniswhite': 0, 'minisblack': 1, 'rgb': 2}[photometric]) - addtag('samples_per_pixel', 'H', 1, samplesperpixel) - if planarconfig: - addtag('planar_configuration', 'H', 1, 1 if planarconfig=='contig' - else 2) - addtag('bits_per_sample', 'H', samplesperpixel, - (data.dtype.itemsize * 8, ) * samplesperpixel) - else: - addtag('bits_per_sample', 'H', 1, data.dtype.itemsize * 8) - if extrasamples: - if photometric == 'rgb': - addtag('extra_samples', 'H', 1, 1) # alpha channel - else: - addtag('extra_samples', 'H', extrasamples, (0, ) * extrasamples) - if resolution: - addtag('x_resolution', '2I', 1, rational(resolution[0])) - addtag('y_resolution', '2I', 1, rational(resolution[1])) - addtag('resolution_unit', 'H', 1, 2) - addtag('rows_per_strip', 'I', 1, shape[-3]) - - # use one strip per plane - strip_byte_counts = (data[0, 0].size * data.dtype.itemsize, ) * shape[1] - addtag('strip_byte_counts', offset_format, shape[1], strip_byte_counts) - addtag('strip_offsets', offset_format, shape[1], (0, ) * shape[1]) - - # add extra tags from users - for t in extratags: - addtag(*t) - - # the entries in an IFD must be sorted in ascending order by tag code - tags = sorted(tags, key=lambda x: x[0]) - - with open(filename, 'wb') as fh: - seek = fh.seek - tell = fh.tell - - def write(arg, *args): - fh.write(pack(arg, *args) if args else arg) - - write({'<': b'II', '>': b'MM'}[byteorder]) - if bigtiff: - write('HHH', 43, 8, 0) - else: - write('H', 42) - ifd_offset = tell() - write(offset_format, 0) # first IFD - - for pageindex in range(shape[0]): - # update pointer at ifd_offset - pos = tell() - seek(ifd_offset) - write(offset_format, pos) - seek(pos) - - # write ifdentries - write(numtag_format, len(tags)) - tag_offset = tell() - write(b''.join(t[1] for t in tags)) - ifd_offset = tell() - write(offset_format, 0) # offset to next IFD - - # write tag values and patch offsets in ifdentries, if necessary - for tagindex, tag in enumerate(tags): - if tag[2]: - pos = tell() - seek(tag_offset + tagindex*tag_size + offset_size + 4) - write(offset_format, pos) - seek(pos) - if tag[0] == 273: - strip_offsets_offset = pos - elif tag[0] == 279: - strip_byte_counts_offset = pos - write(tag[2]) - - # write image data - data_offset = tell() - if compress: - strip_byte_counts = [] - for plane in data[pageindex]: - plane = zlib.compress(plane, compress) - strip_byte_counts.append(len(plane)) - fh.write(plane) - else: - # if this fails try update Python/numpy - data[pageindex].tofile(fh) - fh.flush() - - # update strip_offsets and strip_byte_counts if necessary - pos = tell() - for tagindex, tag in enumerate(tags): - if tag[0] == 273: # strip_offsets - if tag[2]: - seek(strip_offsets_offset) - strip_offset = data_offset - for size in strip_byte_counts: - write(offset_format, strip_offset) - strip_offset += size - else: - seek(tag_offset + tagindex*tag_size + offset_size + 4) - write(offset_format, data_offset) - elif tag[0] == 279: # strip_byte_counts - if compress: - if tag[2]: - seek(strip_byte_counts_offset) - for size in strip_byte_counts: - write(offset_format, size) - else: - seek(tag_offset + tagindex*tag_size + - offset_size + 4) - write(offset_format, strip_byte_counts[0]) - break - seek(pos) - fh.flush() - # remove tags that should be written only once - if pageindex == 0: - tags = [t for t in tags if not t[-1]] - - -def imread(files, *args, **kwargs): - """Return image data from TIFF file(s) as numpy array. - - The first image series is returned if no arguments are provided. - - Parameters - ---------- - files : str or list - File name, glob pattern, or list of file names. - key : int, slice, or sequence of page indices - Defines which pages to return as array. - series : int - Defines which series of pages in file to return as array. - multifile : bool - If True (default), OME-TIFF data may include pages from multiple files. - pattern : str - Regular expression pattern that matches axes names and indices in - file names. - - Examples - -------- - >>> im = imread('test.tif', 0) - >>> im.shape - (256, 256, 4) - >>> ims = imread(['test.tif', 'test.tif']) - >>> ims.shape - (2, 256, 256, 4) - - """ - kwargs_file = {} - if 'multifile' in kwargs: - kwargs_file['multifile'] = kwargs['multifile'] - del kwargs['multifile'] - else: - kwargs_file['multifile'] = True - kwargs_seq = {} - if 'pattern' in kwargs: - kwargs_seq['pattern'] = kwargs['pattern'] - del kwargs['pattern'] - - if isinstance(files, basestring) and any(i in files for i in '?*'): - files = glob.glob(files) - if not files: - raise ValueError('no files found') - if len(files) == 1: - files = files[0] - - if isinstance(files, basestring): - with TiffFile(files, **kwargs_file) as tif: - return tif.asarray(*args, **kwargs) - else: - with TiffSequence(files, **kwargs_seq) as imseq: - return imseq.asarray(*args, **kwargs) - - -class lazyattr(object): - """Lazy object attribute whose value is computed on first access.""" - __slots__ = ('func', ) - - def __init__(self, func): - self.func = func - - def __get__(self, instance, owner): - if instance is None: - return self - value = self.func(instance) - if value is NotImplemented: - return getattr(super(owner, instance), self.func.__name__) - setattr(instance, self.func.__name__, value) - return value - - -class TiffFile(object): - """Read image and meta-data from TIFF, STK, LSM, and FluoView files. - - TiffFile instances must be closed using the close method, which is - automatically called when using the 'with' statement. - - Attributes - ---------- - pages : list - All TIFF pages in file. - series : list of Records(shape, dtype, axes, TiffPages) - TIFF pages with compatible shapes and types. - micromanager_metadata: dict - Extra MicroManager non-TIFF metadata in the file, if exists. - - All attributes are read-only. - - Examples - -------- - >>> tif = TiffFile('test.tif') - ... try: - ... images = tif.asarray() - ... except Exception as e: - ... print(e) - ... finally: - ... tif.close() - - """ - def __init__(self, arg, name=None, multifile=False): - """Initialize instance from file. - - Parameters - ---------- - arg : str or open file - Name of file or open file object. - The file objects are closed in TiffFile.close(). - name : str - Human readable label of open file. - multifile : bool - If True, series may include pages from multiple files. - - """ - if isinstance(arg, basestring): - filename = os.path.abspath(arg) - self._fh = open(filename, 'rb') - else: - filename = str(name) - self._fh = arg - - self._fh.seek(0, 2) - self._fsize = self._fh.tell() - self._fh.seek(0) - self.fname = os.path.basename(filename) - self.fpath = os.path.dirname(filename) - self._tiffs = {self.fname: self} # cache of TiffFiles - self.offset_size = None - self.pages = [] - self._multifile = bool(multifile) - try: - self._fromfile() - except Exception: - self._fh.close() - raise - - def close(self): - """Close open file handle(s).""" - for tif in self._tiffs.values(): - if tif._fh: - tif._fh.close() - tif._fh = None - self._tiffs = {} - - def _fromfile(self): - """Read TIFF header and all page records from file.""" - self._fh.seek(0) - try: - self.byteorder = {b'II': '<', b'MM': '>'}[self._fh.read(2)] - except KeyError: - raise ValueError("not a valid TIFF file") - version = struct.unpack(self.byteorder+'H', self._fh.read(2))[0] - if version == 43: # BigTiff - self.offset_size, zero = struct.unpack(self.byteorder+'HH', - self._fh.read(4)) - if zero or self.offset_size != 8: - raise ValueError("not a valid BigTIFF file") - elif version == 42: - self.offset_size = 4 - else: - raise ValueError("not a TIFF file") - self.pages = [] - while True: - try: - page = TiffPage(self) - self.pages.append(page) - except StopIteration: - break - if not self.pages: - raise ValueError("empty TIFF file") - - if self.is_micromanager: - # MicroManager files contain metadata not stored in TIFF tags. - self.micromanager_metadata = read_micromanager_metadata(self._fh) - - @lazyattr - def series(self): - """Return series of TiffPage with compatible shape and properties.""" - series = [] - if self.is_ome: - series = self._omeseries() - elif self.is_fluoview: - dims = {b'X': 'X', b'Y': 'Y', b'Z': 'Z', b'T': 'T', - b'WAVELENGTH': 'C', b'TIME': 'T', b'XY': 'R', - b'EVENT': 'V', b'EXPOSURE': 'L'} - mmhd = list(reversed(self.pages[0].mm_header.dimensions)) - series = [Record( - axes=''.join(dims.get(i[0].strip().upper(), 'Q') - for i in mmhd if i[1] > 1), - shape=tuple(int(i[1]) for i in mmhd if i[1] > 1), - pages=self.pages, dtype=numpy.dtype(self.pages[0].dtype))] - elif self.is_lsm: - lsmi = self.pages[0].cz_lsm_info - axes = CZ_SCAN_TYPES[lsmi.scan_type] - if self.pages[0].is_rgb: - axes = axes.replace('C', '').replace('XY', 'XYC') - axes = axes[::-1] - shape = [getattr(lsmi, CZ_DIMENSIONS[i]) for i in axes] - pages = [p for p in self.pages if not p.is_reduced] - series = [Record(axes=axes, shape=shape, pages=pages, - dtype=numpy.dtype(pages[0].dtype))] - if len(pages) != len(self.pages): # reduced RGB pages - pages = [p for p in self.pages if p.is_reduced] - cp = 1 - i = 0 - while cp < len(pages) and i < len(shape)-2: - cp *= shape[i] - i += 1 - shape = shape[:i] + list(pages[0].shape) - axes = axes[:i] + 'CYX' - series.append(Record(axes=axes, shape=shape, pages=pages, - dtype=numpy.dtype(pages[0].dtype))) - elif self.is_imagej: - shape = [] - axes = [] - ij = self.pages[0].imagej_tags - if 'frames' in ij: - shape.append(ij['frames']) - axes.append('T') - if 'slices' in ij: - shape.append(ij['slices']) - axes.append('Z') - if 'channels' in ij and not self.is_rgb: - shape.append(ij['channels']) - axes.append('C') - remain = len(self.pages) // (numpy.prod(shape) if shape else 1) - if remain > 1: - shape.append(remain) - axes.append('I') - shape.extend(self.pages[0].shape) - axes.extend(self.pages[0].axes) - axes = ''.join(axes) - series = [Record(pages=self.pages, shape=shape, axes=axes, - dtype=numpy.dtype(self.pages[0].dtype))] - elif self.is_nih: - series = [Record(pages=self.pages, - shape=(len(self.pages),) + self.pages[0].shape, - axes='I' + self.pages[0].axes, - dtype=numpy.dtype(self.pages[0].dtype))] - elif self.pages[0].is_shaped: - shape = self.pages[0].tags['image_description'].value[7:-1] - shape = tuple(int(i) for i in shape.split(b',')) - series = [Record(pages=self.pages, shape=shape, - axes='Q' * len(shape), - dtype=numpy.dtype(self.pages[0].dtype))] - - if not series: - shapes = [] - pages = {} - for page in self.pages: - if not page.shape: - continue - shape = page.shape + (page.axes, - page.compression in TIFF_DECOMPESSORS) - if not shape in pages: - shapes.append(shape) - pages[shape] = [page] - else: - pages[shape].append(page) - series = [Record(pages=pages[s], - axes=(('I' + s[-2]) - if len(pages[s]) > 1 else s[-2]), - dtype=numpy.dtype(pages[s][0].dtype), - shape=((len(pages[s]), ) + s[:-2] - if len(pages[s]) > 1 else s[:-2])) - for s in shapes] - return series - - def asarray(self, key=None, series=None, memmap=False): - """Return image data of multiple TIFF pages as numpy array. - - By default the first image series is returned. - - Parameters - ---------- - key : int, slice, or sequence of page indices - Defines which pages to return as array. - series : int - Defines which series of pages to return as array. - memmap : bool - If True, use numpy.memmap to read arrays from file if possible. - - """ - if key is None and series is None: - series = 0 - if series is not None: - pages = self.series[series].pages - else: - pages = self.pages - - if key is None: - pass - elif isinstance(key, int): - pages = [pages[key]] - elif isinstance(key, slice): - pages = pages[key] - elif isinstance(key, collections.Iterable): - pages = [pages[k] for k in key] - else: - raise TypeError("key must be an int, slice, or sequence") - - if len(pages) == 1: - return pages[0].asarray(memmap=memmap) - elif self.is_nih: - result = numpy.vstack( - p.asarray(colormapped=False, squeeze=False, memmap=memmap) - for p in pages) - if pages[0].is_palette: - result = numpy.take(pages[0].color_map, result, axis=1) - result = numpy.swapaxes(result, 0, 1) - else: - if self.is_ome and any(p is None for p in pages): - firstpage = next(p for p in pages if p) - nopage = numpy.zeros_like(firstpage.asarray(memmap=memmap)) - result = numpy.vstack((p.asarray(memmap=memmap) if p else nopage) - for p in pages) - if key is None: - try: - result.shape = self.series[series].shape - except ValueError: - warnings.warn("failed to reshape %s to %s" % ( - result.shape, self.series[series].shape)) - result.shape = (-1,) + pages[0].shape - else: - result.shape = (-1,) + pages[0].shape - return result - - def _omeseries(self): - """Return image series in OME-TIFF file(s).""" - root = ElementTree.XML(self.pages[0].tags['image_description'].value) - uuid = root.attrib.get('UUID', None) - self._tiffs = {uuid: self} - modulo = {} - result = [] - for element in root: - if element.tag.endswith('BinaryOnly'): - warnings.warn("not an OME-TIFF master file") - break - if element.tag.endswith('StructuredAnnotations'): - for annot in element: - if not annot.attrib.get('Namespace', - '').endswith('modulo'): - continue - for value in annot: - for modul in value: - for along in modul: - if not along.tag[:-1].endswith('Along'): - continue - axis = along.tag[-1] - newaxis = along.attrib.get('Type', 'other') - newaxis = AXES_LABELS[newaxis] - if 'Start' in along.attrib: - labels = range( - int(along.attrib['Start']), - int(along.attrib['End']) + 1, - int(along.attrib.get('Step', 1))) - else: - labels = [label.text for label in along - if label.tag.endswith('Label')] - modulo[axis] = (newaxis, labels) - if not element.tag.endswith('Image'): - continue - for pixels in element: - if not pixels.tag.endswith('Pixels'): - continue - atr = pixels.attrib - axes = "".join(reversed(atr['DimensionOrder'])) - shape = list(int(atr['Size'+ax]) for ax in axes) - size = numpy.prod(shape[:-2]) - ifds = [None] * size - for data in pixels: - if not data.tag.endswith('TiffData'): - continue - atr = data.attrib - ifd = int(atr.get('IFD', 0)) - num = int(atr.get('NumPlanes', 1 if 'IFD' in atr else 0)) - num = int(atr.get('PlaneCount', num)) - idx = [int(atr.get('First'+ax, 0)) for ax in axes[:-2]] - idx = numpy.ravel_multi_index(idx, shape[:-2]) - for uuid in data: - if uuid.tag.endswith('UUID'): - if uuid.text not in self._tiffs: - if not self._multifile: - # abort reading multi file OME series - return [] - fn = uuid.attrib['FileName'] - try: - tf = TiffFile(os.path.join(self.fpath, fn)) - except (IOError, ValueError): - warnings.warn("failed to read %s" % fn) - break - self._tiffs[uuid.text] = tf - pages = self._tiffs[uuid.text].pages - try: - for i in range(num if num else len(pages)): - ifds[idx + i] = pages[ifd + i] - except IndexError: - warnings.warn("ome-xml: index out of range") - break - else: - pages = self.pages - try: - for i in range(num if num else len(pages)): - ifds[idx + i] = pages[ifd + i] - except IndexError: - warnings.warn("ome-xml: index out of range") - result.append(Record(axes=axes, shape=shape, pages=ifds, - dtype=numpy.dtype(ifds[0].dtype))) - - for record in result: - for axis, (newaxis, labels) in modulo.items(): - i = record.axes.index(axis) - size = len(labels) - if record.shape[i] == size: - record.axes = record.axes.replace(axis, newaxis, 1) - else: - record.shape[i] //= size - record.shape.insert(i+1, size) - record.axes = record.axes.replace(axis, axis+newaxis, 1) - - return result - - def __len__(self): - """Return number of image pages in file.""" - return len(self.pages) - - def __getitem__(self, key): - """Return specified page.""" - return self.pages[key] - - def __iter__(self): - """Return iterator over pages.""" - return iter(self.pages) - - def __str__(self): - """Return string containing information about file.""" - result = [ - self.fname.capitalize(), - format_size(self._fsize), - {'<': 'little endian', '>': 'big endian'}[self.byteorder]] - if self.is_bigtiff: - result.append("bigtiff") - if len(self.pages) > 1: - result.append("%i pages" % len(self.pages)) - if len(self.series) > 1: - result.append("%i series" % len(self.series)) - if len(self._tiffs) > 1: - result.append("%i files" % (len(self._tiffs))) - return ", ".join(result) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - @lazyattr - def fstat(self): - try: - return os.fstat(self._fh.fileno()) - except Exception: # io.UnsupportedOperation - return None - - @lazyattr - def is_bigtiff(self): - return self.offset_size != 4 - - @lazyattr - def is_rgb(self): - return all(p.is_rgb for p in self.pages) - - @lazyattr - def is_palette(self): - return all(p.is_palette for p in self.pages) - - @lazyattr - def is_mdgel(self): - return any(p.is_mdgel for p in self.pages) - - @lazyattr - def is_mediacy(self): - return any(p.is_mediacy for p in self.pages) - - @lazyattr - def is_stk(self): - return all(p.is_stk for p in self.pages) - - @lazyattr - def is_lsm(self): - return self.pages[0].is_lsm - - @lazyattr - def is_imagej(self): - return self.pages[0].is_imagej - - @lazyattr - def is_micromanager(self): - return self.pages[0].is_micromanager - - @lazyattr - def is_nih(self): - return self.pages[0].is_nih - - @lazyattr - def is_fluoview(self): - return self.pages[0].is_fluoview - - @lazyattr - def is_ome(self): - return self.pages[0].is_ome - - -class TiffPage(object): - """A TIFF image file directory (IFD). - - Attributes - ---------- - index : int - Index of page in file. - dtype : str {TIFF_SAMPLE_DTYPES} - Data type of image, colormapped if applicable. - shape : tuple - Dimensions of the image array in TIFF page, - colormapped and with one alpha channel if applicable. - axes : str - Axes label codes: - 'X' width, 'Y' height, 'S' sample, 'P' plane, 'I' image series, - 'Z' depth, 'C' color|em-wavelength|channel, 'E' ex-wavelength|lambda, - 'T' time, 'R' region|tile, 'A' angle, 'F' phase, 'H' lifetime, - 'L' exposure, 'V' event, 'Q' unknown, '_' missing - tags : TiffTags - Dictionary of tags in page. - Tag values are also directly accessible as attributes. - color_map : numpy array - Color look up table, if exists. - mm_uic_tags: Record(dict) - Consolidated MetaMorph mm_uic# tags, if exists. - cz_lsm_scan_info: Record(dict) - LSM scan info attributes, if exists. - imagej_tags: Record(dict) - Consolidated ImageJ description and metadata tags, if exists. - - All attributes are read-only. - - """ - def __init__(self, parent): - """Initialize instance from file.""" - self.parent = parent - self.index = len(parent.pages) - self.shape = self._shape = () - self.dtype = self._dtype = None - self.axes = "" - self.tags = TiffTags() - - self._fromfile() - self._process_tags() - - def _fromfile(self): - """Read TIFF IFD structure and its tags from file. - - File cursor must be at storage position of IFD offset and is left at - offset to next IFD. - - Raises StopIteration if offset (first bytes read) is 0. - - """ - fh = self.parent._fh - byteorder = self.parent.byteorder - offset_size = self.parent.offset_size - - fmt = {4: 'I', 8: 'Q'}[offset_size] - offset = struct.unpack(byteorder + fmt, fh.read(offset_size))[0] - if not offset: - raise StopIteration() - - # read standard tags - tags = self.tags - fh.seek(offset) - fmt, size = {4: ('H', 2), 8: ('Q', 8)}[offset_size] - try: - numtags = struct.unpack(byteorder + fmt, fh.read(size))[0] - except Exception: - warnings.warn("corrupted page list") - raise StopIteration() - - tagcode = 0 - for _ in range(numtags): - try: - tag = TiffTag(self.parent) - except TiffTag.Error as e: - warnings.warn(str(e)) - finally: - if tagcode > tag.code: - warnings.warn("tags are not ordered by code") - tagcode = tag.code - if not tag.name in tags: - tags[tag.name] = tag - else: - # some files contain multiple IFD with same code - # e.g. MicroManager files contain two image_description - for ext in ('_1', '_2', '_3'): - name = tag.name + ext - if not name in tags: - tags[name] = tag - break - - # read LSM info subrecords - if self.is_lsm: - pos = fh.tell() - for name, reader in CZ_LSM_INFO_READERS.items(): - try: - offset = self.cz_lsm_info['offset_'+name] - except KeyError: - continue - if not offset: - continue - fh.seek(offset) - try: - setattr(self, 'cz_lsm_'+name, reader(fh, byteorder)) - except ValueError: - pass - fh.seek(pos) - - def _process_tags(self): - """Validate standard tags and initialize attributes. - - Raise ValueError if tag values are not supported. - - """ - tags = self.tags - for code, (name, default, dtype, count, validate) in TIFF_TAGS.items(): - if not (name in tags or default is None): - tags[name] = TiffTag(code, dtype=dtype, count=count, - value=default, name=name) - if name in tags and validate: - try: - if tags[name].count == 1: - setattr(self, name, validate[tags[name].value]) - else: - setattr(self, name, tuple( - validate[value] for value in tags[name].value)) - except KeyError: - raise ValueError("%s.value (%s) not supported" % - (name, tags[name].value)) - - tag = tags['bits_per_sample'] - if tag.count == 1: - self.bits_per_sample = tag.value - else: - value = tag.value[:self.samples_per_pixel] - if any((v-value[0] for v in value)): - self.bits_per_sample = value - else: - self.bits_per_sample = value[0] - - tag = tags['sample_format'] - if tag.count == 1: - self.sample_format = TIFF_SAMPLE_FORMATS[tag.value] - else: - value = tag.value[:self.samples_per_pixel] - if any((v-value[0] for v in value)): - self.sample_format = [TIFF_SAMPLE_FORMATS[v] for v in value] - else: - self.sample_format = TIFF_SAMPLE_FORMATS[value[0]] - - if not 'photometric' in tags: - self.photometric = None - - if 'image_length' in tags: - self.strips_per_image = int(math.floor( - float(self.image_length + self.rows_per_strip - 1) / - self.rows_per_strip)) - else: - self.strips_per_image = 0 - - key = (self.sample_format, self.bits_per_sample) - self.dtype = self._dtype = TIFF_SAMPLE_DTYPES.get(key, None) - - if self.is_imagej: - # consolidate imagej meta data - if 'image_description_1' in self.tags: # MicroManager - adict = imagej_description(tags['image_description_1'].value) - else: - adict = imagej_description(tags['image_description'].value) - if 'imagej_metadata' in tags: - try: - adict.update(imagej_metadata( - tags['imagej_metadata'].value, - tags['imagej_byte_counts'].value, - self.parent.byteorder)) - except Exception as e: - warnings.warn(str(e)) - self.imagej_tags = Record(adict) - - if not 'image_length' in self.tags or not 'image_width' in self.tags: - # some GEL file pages are missing image data - self.image_length = 0 - self.image_width = 0 - self.strip_offsets = 0 - self._shape = () - self.shape = () - self.axes = '' - - if self.is_palette: - self.dtype = self.tags['color_map'].dtype[1] - self.color_map = numpy.array(self.color_map, self.dtype) - dmax = self.color_map.max() - if dmax < 256: - self.dtype = numpy.uint8 - self.color_map = self.color_map.astype(self.dtype) - #else: - # self.dtype = numpy.uint8 - # self.color_map >>= 8 - # self.color_map = self.color_map.astype(self.dtype) - self.color_map.shape = (3, -1) - - if self.is_stk: - # consolidate mm_uci tags - planes = tags['mm_uic2'].count - self.mm_uic_tags = Record(tags['mm_uic2'].value) - for key in ('mm_uic3', 'mm_uic4', 'mm_uic1'): - if key in tags: - self.mm_uic_tags.update(tags[key].value) - if self.planar_configuration == 'contig': - self._shape = (planes, 1, self.image_length, self.image_width, - self.samples_per_pixel) - self.shape = tuple(self._shape[i] for i in (0, 2, 3, 4)) - self.axes = 'PYXS' - else: - self._shape = (planes, self.samples_per_pixel, - self.image_length, self.image_width, 1) - self.shape = self._shape[:4] - self.axes = 'PSYX' - if self.is_palette and (self.color_map.shape[1] - >= 2**self.bits_per_sample): - self.shape = (3, planes, self.image_length, self.image_width) - self.axes = 'CPYX' - else: - warnings.warn("palette cannot be applied") - self.is_palette = False - elif self.is_palette: - samples = 1 - if 'extra_samples' in self.tags: - samples += len(self.extra_samples) - if self.planar_configuration == 'contig': - self._shape = ( - 1, 1, self.image_length, self.image_width, samples) - else: - self._shape = ( - 1, samples, self.image_length, self.image_width, 1) - if self.color_map.shape[1] >= 2**self.bits_per_sample: - self.shape = (3, self.image_length, self.image_width) - self.axes = 'CYX' - else: - warnings.warn("palette cannot be applied") - self.is_palette = False - self.shape = (self.image_length, self.image_width) - self.axes = 'YX' - elif self.is_rgb or self.samples_per_pixel > 1: - if self.planar_configuration == 'contig': - self._shape = (1, 1, self.image_length, self.image_width, - self.samples_per_pixel) - self.shape = (self.image_length, self.image_width, - self.samples_per_pixel) - self.axes = 'YXS' - else: - self._shape = (1, self.samples_per_pixel, self.image_length, - self.image_width, 1) - self.shape = self._shape[1:-1] - self.axes = 'SYX' - if self.is_rgb and 'extra_samples' in self.tags: - extra_samples = self.extra_samples - if self.tags['extra_samples'].count == 1: - extra_samples = (extra_samples, ) - for exs in extra_samples: - if exs in ('unassalpha', 'assocalpha', 'unspecified'): - if self.planar_configuration == 'contig': - self.shape = self.shape[:2] + (4,) - else: - self.shape = (4,) + self.shape[1:] - break - else: - self._shape = (1, 1, self.image_length, self.image_width, 1) - self.shape = self._shape[2:4] - self.axes = 'YX' - - if not self.compression and not 'strip_byte_counts' in tags: - self.strip_byte_counts = numpy.prod(self.shape) * ( - self.bits_per_sample // 8) - - def asarray(self, squeeze=True, colormapped=True, rgbonly=True, - memmap=False): - """Read image data from file and return as numpy array. - - Raise ValueError if format is unsupported. - If any argument is False, the shape of the returned array might be - different from the page shape. - - Parameters - ---------- - squeeze : bool - If True, all length-1 dimensions (except X and Y) are - squeezed out from result. - colormapped : bool - If True, color mapping is applied for palette-indexed images. - rgbonly : bool - If True, return RGB(A) image without additional extra samples. - memmap : bool - If True, use numpy.memmap to read array if possible. - - """ - fh = self.parent._fh - if not fh: - raise IOError("TIFF file is not open") - if self.dtype is None: - raise ValueError("data type not supported: %s%i" % ( - self.sample_format, self.bits_per_sample)) - if self.compression not in TIFF_DECOMPESSORS: - raise ValueError("cannot decompress %s" % self.compression) - if ('ycbcr_subsampling' in self.tags - and self.tags['ycbcr_subsampling'].value not in (1, (1, 1))): - raise ValueError("YCbCr subsampling not supported") - tag = self.tags['sample_format'] - if tag.count != 1 and any((i-tag.value[0] for i in tag.value)): - raise ValueError("sample formats don't match %s" % str(tag.value)) - - dtype = self._dtype - shape = self._shape - - if not shape: - return None - - image_width = self.image_width - image_length = self.image_length - typecode = self.parent.byteorder + dtype - bits_per_sample = self.bits_per_sample - byteorder_is_native = ({'big': '>', 'little': '<'}[sys.byteorder] == - self.parent.byteorder) - - if self.is_tiled: - if 'tile_offsets' in self.tags: - byte_counts = self.tile_byte_counts - offsets = self.tile_offsets - else: - byte_counts = self.strip_byte_counts - offsets = self.strip_offsets - tile_width = self.tile_width - tile_length = self.tile_length - tw = (image_width + tile_width - 1) // tile_width - tl = (image_length + tile_length - 1) // tile_length - shape = shape[:-3] + (tl*tile_length, tw*tile_width, shape[-1]) - tile_shape = (tile_length, tile_width, shape[-1]) - runlen = tile_width - else: - byte_counts = self.strip_byte_counts - offsets = self.strip_offsets - runlen = image_width - - try: - offsets[0] - except TypeError: - offsets = (offsets, ) - byte_counts = (byte_counts, ) - if any(o < 2 for o in offsets): - raise ValueError("corrupted page") - - if (not self.is_tiled and (self.is_stk or (not self.compression - and bits_per_sample in (8, 16, 32, 64) - and all(offsets[i] == offsets[i+1] - byte_counts[i] - for i in range(len(offsets)-1))))): - # contiguous data - if (memmap and not (self.is_tiled or self.predictor or - ('extra_samples' in self.tags) or - (colormapped and self.is_palette) or - (not byteorder_is_native))): - result = numpy.memmap(fh, typecode, 'r', offsets[0], shape) - else: - fh.seek(offsets[0]) - result = numpy_fromfile(fh, typecode, numpy.prod(shape)) - result = result.astype('=' + dtype) - else: - if self.planar_configuration == 'contig': - runlen *= self.samples_per_pixel - if bits_per_sample in (8, 16, 32, 64, 128): - if (bits_per_sample * runlen) % 8: - raise ValueError("data and sample size mismatch") - - def unpack(x): - return numpy.fromstring(x, typecode) - elif isinstance(bits_per_sample, tuple): - def unpack(x): - return unpackrgb(x, typecode, bits_per_sample) - else: - def unpack(x): - return unpackints(x, typecode, bits_per_sample, runlen) - decompress = TIFF_DECOMPESSORS[self.compression] - if self.is_tiled: - result = numpy.empty(shape, dtype) - tw, tl, pl = 0, 0, 0 - for offset, bytecount in zip(offsets, byte_counts): - fh.seek(offset) - tile = unpack(decompress(fh.read(bytecount))) - tile.shape = tile_shape - if self.predictor == 'horizontal': - numpy.cumsum(tile, axis=-2, dtype=dtype, out=tile) - result[0, pl, tl:tl+tile_length, - tw:tw+tile_width, :] = tile - del tile - tw += tile_width - if tw >= shape[-2]: - tw, tl = 0, tl + tile_length - if tl >= shape[-3]: - tl, pl = 0, pl + 1 - result = result[..., :image_length, :image_width, :] - else: - strip_size = (self.rows_per_strip * self.image_width * - self.samples_per_pixel) - result = numpy.empty(shape, dtype).reshape(-1) - index = 0 - for offset, bytecount in zip(offsets, byte_counts): - fh.seek(offset) - strip = fh.read(bytecount) - strip = unpack(decompress(strip)) - size = min(result.size, strip.size, strip_size, - result.size - index) - result[index:index+size] = strip[:size] - del strip - index += size - - result.shape = self._shape - - if self.predictor == 'horizontal' and not self.is_tiled: - # work around bug in LSM510 software - if not (self.parent.is_lsm and not self.compression): - numpy.cumsum(result, axis=-2, dtype=dtype, out=result) - - if colormapped and self.is_palette: - if self.color_map.shape[1] >= 2**bits_per_sample: - # FluoView and LSM might fail here - result = numpy.take(self.color_map, - result[:, 0, :, :, 0], axis=1) - elif rgbonly and self.is_rgb and 'extra_samples' in self.tags: - # return only RGB and first alpha channel if exists - extra_samples = self.extra_samples - if self.tags['extra_samples'].count == 1: - extra_samples = (extra_samples, ) - for i, exs in enumerate(extra_samples): - if exs in ('unassalpha', 'assocalpha', 'unspecified'): - if self.planar_configuration == 'contig': - result = result[..., [0, 1, 2, 3+i]] - else: - result = result[:, [0, 1, 2, 3+i]] - break - else: - if self.planar_configuration == 'contig': - result = result[..., :3] - else: - result = result[:, :3] - - if squeeze: - try: - result.shape = self.shape - except ValueError: - warnings.warn("failed to reshape from %s to %s" % ( - str(result.shape), str(self.shape))) - - return result - - def __str__(self): - """Return string containing information about page.""" - s = ', '.join(s for s in ( - ' x '.join(str(i) for i in self.shape), - str(numpy.dtype(self.dtype)), - '%s bit' % str(self.bits_per_sample), - self.photometric if 'photometric' in self.tags else '', - self.compression if self.compression else 'raw', - '|'.join(t[3:] for t in ( - 'is_stk', 'is_lsm', 'is_nih', 'is_ome', 'is_imagej', - 'is_micromanager', 'is_fluoview', 'is_mdgel', 'is_mediacy', - 'is_reduced', 'is_tiled') if getattr(self, t))) if s) - return "Page %i: %s" % (self.index, s) - - def __getattr__(self, name): - """Return tag value.""" - if name in self.tags: - value = self.tags[name].value - setattr(self, name, value) - return value - raise AttributeError(name) - - @lazyattr - def is_rgb(self): - """True if page contains a RGB image.""" - return ('photometric' in self.tags and - self.tags['photometric'].value == 2) - - @lazyattr - def is_palette(self): - """True if page contains a palette-colored image.""" - return ('photometric' in self.tags and - self.tags['photometric'].value == 3) - - @lazyattr - def is_tiled(self): - """True if page contains tiled image.""" - return 'tile_width' in self.tags - - @lazyattr - def is_reduced(self): - """True if page is a reduced image of another image.""" - return bool(self.tags['new_subfile_type'].value & 1) - - @lazyattr - def is_mdgel(self): - """True if page contains md_file_tag tag.""" - return 'md_file_tag' in self.tags - - @lazyattr - def is_mediacy(self): - """True if page contains Media Cybernetics Id tag.""" - return ('mc_id' in self.tags and - self.tags['mc_id'].value.startswith(b'MC TIFF')) - - @lazyattr - def is_stk(self): - """True if page contains MM_UIC2 tag.""" - return 'mm_uic2' in self.tags - - @lazyattr - def is_lsm(self): - """True if page contains LSM CZ_LSM_INFO tag.""" - return 'cz_lsm_info' in self.tags - - @lazyattr - def is_fluoview(self): - """True if page contains FluoView MM_STAMP tag.""" - return 'mm_stamp' in self.tags - - @lazyattr - def is_nih(self): - """True if page contains NIH image header.""" - return 'nih_image_header' in self.tags - - @lazyattr - def is_ome(self): - """True if page contains OME-XML in image_description tag.""" - return ('image_description' in self.tags and self.tags[ - 'image_description'].value.startswith(b' parent.offset_size or code in CUSTOM_TAGS: - pos = fh.tell() - tof = {4: 'I', 8: 'Q'}[parent.offset_size] - self.value_offset = offset = struct.unpack(byteorder+tof, value)[0] - if offset < 0 or offset > parent._fsize: - raise TiffTag.Error("corrupt file - invalid tag value offset") - elif offset < 4: - raise TiffTag.Error("corrupt value offset for tag %i" % code) - fh.seek(offset) - if code in CUSTOM_TAGS: - readfunc = CUSTOM_TAGS[code][1] - value = readfunc(fh, byteorder, dtype, count) - fh.seek(0, 2) # bug in numpy/Python 3.x ? - if isinstance(value, dict): # numpy.core.records.record - value = Record(value) - elif code in TIFF_TAGS or dtype[-1] == 's': - value = struct.unpack(fmt, fh.read(size)) - else: - value = read_numpy(fh, byteorder, dtype, count) - fh.seek(0, 2) # bug in numpy/Python 3.x ? - fh.seek(pos) - else: - value = struct.unpack(fmt, value[:size]) - - if not code in CUSTOM_TAGS: - if len(value) == 1: - value = value[0] - - if dtype.endswith('s') and isinstance(value, bytes): - value = stripnull(value) - - self.code = code - self.name = name - self.dtype = dtype - self.count = count - self.value = value - - def __str__(self): - """Return string containing information about tag.""" - return ' '.join(str(getattr(self, s)) for s in self.__slots__) - - -class TiffSequence(object): - """Sequence of image files. - - Properties - ---------- - files : list - List of file names. - shape : tuple - Shape of image sequence. - axes : str - Labels of axes in shape. - - Examples - -------- - >>> ims = TiffSequence("test.oif.files/*.tif") - >>> ims = ims.asarray() - >>> ims.shape - (2, 100, 256, 256) - - """ - _axes_pattern = """ - # matches Olympus OIF and Leica TIFF series - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4})) - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\d{1,4}))? - """ - - class _ParseError(Exception): - pass - - def __init__(self, files, imread=TiffFile, pattern='axes'): - """Initialize instance from multiple files. - - Parameters - ---------- - files : str, or sequence of str - Glob pattern or sequence of file names. - imread : function or class - Image read function or class with asarray function returning numpy - array from single file. - pattern : str - Regular expression pattern that matches axes names and sequence - indices in file names. - - """ - if isinstance(files, basestring): - files = natural_sorted(glob.glob(files)) - files = list(files) - if not files: - raise ValueError("no files found") - #if not os.path.isfile(files[0]): - # raise ValueError("file not found") - self.files = files - - if hasattr(imread, 'asarray'): - _imread = imread - - def imread(fname, *args, **kwargs): - with _imread(fname) as im: - return im.asarray(*args, **kwargs) - - self.imread = imread - - self.pattern = self._axes_pattern if pattern == 'axes' else pattern - try: - self._parse() - if not self.axes: - self.axes = 'I' - except self._ParseError: - self.axes = 'I' - self.shape = (len(files),) - self._start_index = (0,) - self._indices = ((i,) for i in range(len(files))) - - def __str__(self): - """Return string with information about image sequence.""" - return "\n".join([ - self.files[0], - '* files: %i' % len(self.files), - '* axes: %s' % self.axes, - '* shape: %s' % str(self.shape)]) - - def __len__(self): - return len(self.files) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - pass - - def asarray(self, *args, **kwargs): - """Read image data from all files and return as single numpy array. - - Raise IndexError if image shapes don't match. - - """ - im = self.imread(self.files[0]) - result_shape = self.shape + im.shape - result = numpy.zeros(result_shape, dtype=im.dtype) - result = result.reshape(-1, *im.shape) - for index, fname in zip(self._indices, self.files): - index = [i-j for i, j in zip(index, self._start_index)] - index = numpy.ravel_multi_index(index, self.shape) - im = self.imread(fname, *args, **kwargs) - result[index] = im - result.shape = result_shape - return result - - def _parse(self): - """Get axes and shape from file names.""" - if not self.pattern: - raise self._ParseError("invalid pattern") - pattern = re.compile(self.pattern, re.IGNORECASE | re.VERBOSE) - matches = pattern.findall(self.files[0]) - if not matches: - raise self._ParseError("pattern doesn't match file names") - matches = matches[-1] - if len(matches) % 2: - raise self._ParseError("pattern doesn't match axis name and index") - axes = ''.join(m for m in matches[::2] if m) - if not axes: - raise self._ParseError("pattern doesn't match file names") - - indices = [] - for fname in self.files: - matches = pattern.findall(fname)[-1] - if axes != ''.join(m for m in matches[::2] if m): - raise ValueError("axes don't match within the image sequence") - indices.append([int(m) for m in matches[1::2] if m]) - shape = tuple(numpy.max(indices, axis=0)) - start_index = tuple(numpy.min(indices, axis=0)) - shape = tuple(i-j+1 for i, j in zip(shape, start_index)) - if numpy.prod(shape) != len(self.files): - warnings.warn("files are missing. Missing data are zeroed") - - self.axes = axes.upper() - self.shape = shape - self._indices = indices - self._start_index = start_index - - -class Record(dict): - """Dictionary with attribute access. - - Can also be initialized with numpy.core.records.record. - - """ - __slots__ = () - - def __init__(self, arg=None, **kwargs): - if kwargs: - arg = kwargs - elif arg is None: - arg = {} - try: - dict.__init__(self, arg) - except (TypeError, ValueError): - for i, name in enumerate(arg.dtype.names): - v = arg[i] - self[name] = v if v.dtype.char != 'S' else stripnull(v) - - def __getattr__(self, name): - return self[name] - - def __setattr__(self, name, value): - self.__setitem__(name, value) - - def __str__(self): - """Pretty print Record.""" - s = [] - lists = [] - for k in sorted(self): - if k.startswith('_'): # does not work with byte - continue - v = self[k] - if isinstance(v, (list, tuple)) and len(v): - if isinstance(v[0], Record): - lists.append((k, v)) - continue - elif isinstance(v[0], TiffPage): - v = [i.index for i in v if i] - s.append( - ("* %s: %s" % (k, str(v))).split("\n", 1)[0] - [:PRINT_LINE_LEN].rstrip()) - for k, v in lists: - l = [] - for i, w in enumerate(v): - l.append("* %s[%i]\n %s" % (k, i, - str(w).replace("\n", "\n "))) - s.append('\n'.join(l)) - return '\n'.join(s) - - -class TiffTags(Record): - """Dictionary of TiffTags with attribute access.""" - def __str__(self): - """Return string with information about all tags.""" - s = [] - for tag in sorted(self.values(), key=lambda x: x.code): - typecode = "%i%s" % (tag.count * int(tag.dtype[0]), tag.dtype[1]) - line = "* %i %s (%s) %s" % (tag.code, tag.name, typecode, - str(tag.value).split('\n', 1)[0]) - s.append(line[:PRINT_LINE_LEN].lstrip()) - return '\n'.join(s) - - -def read_bytes(fh, byteorder, dtype, count): - """Read tag data from file and return as byte string.""" - return numpy_fromfile(fh, byteorder+dtype[-1], count).tostring() - - -def read_numpy(fh, byteorder, dtype, count): - """Read tag data from file and return as numpy array.""" - return numpy_fromfile(fh, byteorder+dtype[-1], count) - - -def read_json(fh, byteorder, dtype, count): - """Read tag data from file and return as object.""" - return json.loads(unicode(stripnull(fh.read(count)), 'utf-8')) - - -def read_mm_header(fh, byteorder, dtype, count): - """Read MM_HEADER tag from file and return as numpy.rec.array.""" - return numpy.rec.fromfile(fh, MM_HEADER, 1, byteorder=byteorder)[0] - - -def read_mm_stamp(fh, byteorder, dtype, count): - """Read MM_STAMP tag from file and return as numpy.array.""" - return numpy_fromfile(fh, byteorder+'8f8', 1)[0] - - -def read_mm_uic1(fh, byteorder, dtype, count): - """Read MM_UIC1 tag from file and return as dictionary.""" - t = fh.read(8*count) - t = struct.unpack('%s%iI' % (byteorder, 2*count), t) - return dict((MM_TAG_IDS[k], v) for k, v in zip(t[::2], t[1::2]) - if k in MM_TAG_IDS) - - -def read_mm_uic2(fh, byteorder, dtype, count): - """Read MM_UIC2 tag from file and return as dictionary.""" - result = {'number_planes': count} - values = numpy_fromfile(fh, byteorder+'I', 6*count) - result['z_distance'] = values[0::6] // values[1::6] - #result['date_created'] = tuple(values[2::6]) - #result['time_created'] = tuple(values[3::6]) - #result['date_modified'] = tuple(values[4::6]) - #result['time_modified'] = tuple(values[5::6]) - return result - - -def read_mm_uic3(fh, byteorder, dtype, count): - """Read MM_UIC3 tag from file and return as dictionary.""" - t = numpy_fromfile(fh, byteorder+'I', 2*count) - return {'wavelengths': t[0::2] // t[1::2]} - - -def read_mm_uic4(fh, byteorder, dtype, count): - """Read MM_UIC4 tag from file and return as dictionary.""" - t = struct.unpack(byteorder + 'hI'*count, fh.read(6*count)) - return dict((MM_TAG_IDS[k], v) for k, v in zip(t[::2], t[1::2]) - if k in MM_TAG_IDS) - - -def read_cz_lsm_info(fh, byteorder, dtype, count): - """Read CS_LSM_INFO tag from file and return as numpy.rec.array.""" - result = numpy.rec.fromfile(fh, CZ_LSM_INFO, 1, - byteorder=byteorder)[0] - {50350412: '1.3', 67127628: '2.0'}[result.magic_number] # validation - return result - - -def read_cz_lsm_time_stamps(fh, byteorder): - """Read LSM time stamps from file and return as list.""" - size, count = struct.unpack(byteorder+'II', fh.read(8)) - if size != (8 + 8 * count): - raise ValueError("lsm_time_stamps block is too short") - return struct.unpack(('%s%dd' % (byteorder, count)), - fh.read(8*count)) - - -def read_cz_lsm_event_list(fh, byteorder): - """Read LSM events from file and return as list of (time, type, text).""" - count = struct.unpack(byteorder+'II', fh.read(8))[1] - events = [] - while count > 0: - esize, etime, etype = struct.unpack(byteorder+'IdI', fh.read(16)) - etext = stripnull(fh.read(esize - 16)) - events.append((etime, etype, etext)) - count -= 1 - return events - - -def read_cz_lsm_scan_info(fh, byteorder): - """Read LSM scan information from file and return as Record.""" - block = Record() - blocks = [block] - unpack = struct.unpack - if 0x10000000 != struct.unpack(byteorder+"I", fh.read(4))[0]: - raise ValueError("not a lsm_scan_info structure") - fh.read(8) - while True: - entry, dtype, size = unpack(byteorder+"III", fh.read(12)) - if dtype == 2: - value = stripnull(fh.read(size)) - elif dtype == 4: - value = unpack(byteorder+"i", fh.read(4))[0] - elif dtype == 5: - value = unpack(byteorder+"d", fh.read(8))[0] - else: - value = 0 - if entry in CZ_LSM_SCAN_INFO_ARRAYS: - blocks.append(block) - name = CZ_LSM_SCAN_INFO_ARRAYS[entry] - newobj = [] - setattr(block, name, newobj) - block = newobj - elif entry in CZ_LSM_SCAN_INFO_STRUCTS: - blocks.append(block) - newobj = Record() - block.append(newobj) - block = newobj - elif entry in CZ_LSM_SCAN_INFO_ATTRIBUTES: - name = CZ_LSM_SCAN_INFO_ATTRIBUTES[entry] - setattr(block, name, value) - elif entry == 0xffffffff: - block = blocks.pop() - else: - setattr(block, "unknown_%x" % entry, value) - if not blocks: - break - return block - - -def read_nih_image_header(fh, byteorder, dtype, count): - """Read NIH_IMAGE_HEADER tag from file and return as numpy.rec.array.""" - a = numpy.rec.fromfile(fh, NIH_IMAGE_HEADER, 1, byteorder=byteorder)[0] - a = a.newbyteorder(byteorder) - a.xunit = a.xunit[:a._xunit_len] - a.um = a.um[:a._um_len] - return a - - -def imagej_metadata(data, bytecounts, byteorder): - """Return dict from ImageJ meta data tag value.""" - - _str = str if sys.version_info[0] < 3 else lambda x: str(x, 'cp1252') - - def read_string(data, byteorder): - return _str(stripnull(data[0 if byteorder == '<' else 1::2])) - - def read_double(data, byteorder): - return struct.unpack(byteorder+('d' * (len(data) // 8)), data) - - def read_bytes(data, byteorder): - #return struct.unpack('b' * len(data), data) - return numpy.fromstring(data, 'uint8') - - metadata_types = { # big endian - b'info': ('info', read_string), - b'labl': ('labels', read_string), - b'rang': ('ranges', read_double), - b'luts': ('luts', read_bytes), - b'roi ': ('roi', read_bytes), - b'over': ('overlays', read_bytes)} - metadata_types.update( # little endian - dict((k[::-1], v) for k, v in metadata_types.items())) - - if not bytecounts: - raise ValueError("no ImageJ meta data") - - if not data[:4] in (b'IJIJ', b'JIJI'): - raise ValueError("invalid ImageJ meta data") - - header_size = bytecounts[0] - if header_size < 12 or header_size > 804: - raise ValueError("invalid ImageJ meta data header size") - - ntypes = (header_size - 4) // 8 - header = struct.unpack(byteorder+'4sI'*ntypes, data[4:4+ntypes*8]) - pos = 4 + ntypes * 8 - counter = 0 - result = {} - for mtype, count in zip(header[::2], header[1::2]): - values = [] - name, func = metadata_types.get(mtype, (_str(mtype), read_bytes)) - for _ in range(count): - counter += 1 - pos1 = pos + bytecounts[counter] - values.append(func(data[pos:pos1], byteorder)) - pos = pos1 - result[name.strip()] = values[0] if count == 1 else values - return result - - -def imagej_description(description): - """Return dict from ImageJ image_description tag.""" - def _bool(val): - return {b'true': True, b'false': False}[val.lower()] - - _str = str if sys.version_info[0] < 3 else lambda x: str(x, 'cp1252') - result = {} - for line in description.splitlines(): - try: - key, val = line.split(b'=') - except Exception: - continue - key = key.strip() - val = val.strip() - for dtype in (int, float, _bool, _str): - try: - val = dtype(val) - break - except Exception: - pass - result[_str(key)] = val - return result - - -def read_micromanager_metadata(fh): - """Read MicroManager non-TIFF settings from open file and return as dict. - - The settings can be used to read image data without parsing the TIFF file. - - Raise ValueError if file does not contain valid MicroManager metadata. - - """ - fh.seek(0) - try: - byteorder = {b'II': '<', b'MM': '>'}[fh.read(2)] - except IndexError: - raise ValueError("not a MicroManager TIFF file") - - results = {} - fh.seek(8) - (index_header, index_offset, display_header, display_offset, - comments_header, comments_offset, summary_header, summary_length - ) = struct.unpack(byteorder + "IIIIIIII", fh.read(32)) - - if summary_header != 2355492: - raise ValueError("invalid MicroManager summary_header") - results['summary'] = read_json(fh, byteorder, None, summary_length) - - if index_header != 54773648: - raise ValueError("invalid MicroManager index_header") - fh.seek(index_offset) - header, count = struct.unpack(byteorder + "II", fh.read(8)) - if header != 3453623: - raise ValueError("invalid MicroManager index_header") - data = struct.unpack(byteorder + "IIIII"*count, fh.read(20*count)) - results['index_map'] = { - 'channel': data[::5], 'slice': data[1::5], 'frame': data[2::5], - 'position': data[3::5], 'offset': data[4::5]} - - if display_header != 483765892: - raise ValueError("invalid MicroManager display_header") - fh.seek(display_offset) - header, count = struct.unpack(byteorder + "II", fh.read(8)) - if header != 347834724: - raise ValueError("invalid MicroManager display_header") - results['display_settings'] = read_json(fh, byteorder, None, count) - - if comments_header != 99384722: - raise ValueError("invalid MicroManager comments_header") - fh.seek(comments_offset) - header, count = struct.unpack(byteorder + "II", fh.read(8)) - if header != 84720485: - raise ValueError("invalid MicroManager comments_header") - results['comments'] = read_json(fh, byteorder, None, count) - - return results - - -def _replace_by(module_function, package=None, warn=True): - """Try replace decorated function by module.function.""" - try: - from importlib import import_module - except ImportError: - warnings.warn('Could not import module importlib') - return lambda func: func - - def decorate(func, module_function=module_function, warn=warn): - try: - module, function = module_function.split('.') - if not package: - module = import_module(module) - else: - module = import_module('.' + module, package=package) - func, oldfunc = getattr(module, function), func - globals()['__old_' + func.__name__] = oldfunc - except Exception: - if warn: - warnings.warn("failed to import %s" % module_function) - return func - - return decorate - - -@_replace_by('_tifffile.decodepackbits') -def decodepackbits(encoded): - """Decompress PackBits encoded byte string. - - PackBits is a simple byte-oriented run-length compression scheme. - - """ - func = ord if sys.version[0] == '2' else lambda x: x - result = [] - result_extend = result.extend - i = 0 - try: - while True: - n = func(encoded[i]) + 1 - i += 1 - if n < 129: - result_extend(encoded[i:i+n]) - i += n - elif n > 129: - result_extend(encoded[i:i+1] * (258-n)) - i += 1 - except IndexError: - pass - return b''.join(result) if sys.version[0] == '2' else bytes(result) - - -@_replace_by('_tifffile.decodelzw') -def decodelzw(encoded): - """Decompress LZW (Lempel-Ziv-Welch) encoded TIFF strip (byte string). - - The strip must begin with a CLEAR code and end with an EOI code. - - This is an implementation of the LZW decoding algorithm described in (1). - It is not compatible with old style LZW compressed files like quad-lzw.tif. - - """ - len_encoded = len(encoded) - bitcount_max = len_encoded * 8 - unpack = struct.unpack - - if sys.version[0] == '2': - newtable = [chr(i) for i in range(256)] - else: - newtable = [bytes([i]) for i in range(256)] - newtable.extend((0, 0)) - - def next_code(): - """Return integer of `bitw` bits at `bitcount` position in encoded.""" - start = bitcount // 8 - s = encoded[start:start+4] - try: - code = unpack('>I', s)[0] - except Exception: - code = unpack('>I', s + b'\x00'*(4-len(s)))[0] - code <<= bitcount % 8 - code &= mask - return code >> shr - - switchbitch = { # code: bit-width, shr-bits, bit-mask - 255: (9, 23, int(9*'1'+'0'*23, 2)), - 511: (10, 22, int(10*'1'+'0'*22, 2)), - 1023: (11, 21, int(11*'1'+'0'*21, 2)), - 2047: (12, 20, int(12*'1'+'0'*20, 2)), } - bitw, shr, mask = switchbitch[255] - bitcount = 0 - - if len_encoded < 4: - raise ValueError("strip must be at least 4 characters long") - - if next_code() != 256: - raise ValueError("strip must begin with CLEAR code") - - code = 0 - oldcode = 0 - result = [] - result_append = result.append - while True: - code = next_code() # ~5% faster when inlining this function - bitcount += bitw - if code == 257 or bitcount >= bitcount_max: # EOI - break - if code == 256: # CLEAR - table = newtable[:] - table_append = table.append - lentable = 258 - bitw, shr, mask = switchbitch[255] - code = next_code() - bitcount += bitw - if code == 257: # EOI - break - result_append(table[code]) - else: - if code < lentable: - decoded = table[code] - newcode = table[oldcode] + decoded[:1] - else: - newcode = table[oldcode] - newcode += newcode[:1] - decoded = newcode - result_append(decoded) - table_append(newcode) - lentable += 1 - oldcode = code - if lentable in switchbitch: - bitw, shr, mask = switchbitch[lentable] - - if code != 257: - warnings.warn( - "decodelzw encountered unexpected end of stream (code %i)" % code) - - return b''.join(result) - - -@_replace_by('_tifffile.unpackints') -def unpackints(data, dtype, itemsize, runlen=0): - """Decompress byte string to array of integers of any bit size <= 32. - - Parameters - ---------- - data : byte str - Data to decompress. - dtype : numpy.dtype or str - A numpy boolean or integer type. - itemsize : int - Number of bits per integer. - runlen : int - Number of consecutive integers, after which to start at next byte. - - """ - if itemsize == 1: # bitarray - data = numpy.fromstring(data, '|B') - data = numpy.unpackbits(data) - if runlen % 8: - data = data.reshape(-1, runlen + (8 - runlen % 8)) - data = data[:, :runlen].reshape(-1) - return data.astype(dtype) - - dtype = numpy.dtype(dtype) - if itemsize in (8, 16, 32, 64): - return numpy.fromstring(data, dtype) - if itemsize < 1 or itemsize > 32: - raise ValueError("itemsize out of range: %i" % itemsize) - if dtype.kind not in "biu": - raise ValueError("invalid dtype") - - itembytes = next(i for i in (1, 2, 4, 8) if 8 * i >= itemsize) - if itembytes != dtype.itemsize: - raise ValueError("dtype.itemsize too small") - if runlen == 0: - runlen = len(data) // itembytes - skipbits = runlen*itemsize % 8 - if skipbits: - skipbits = 8 - skipbits - shrbits = itembytes*8 - itemsize - bitmask = int(itemsize*'1'+'0'*shrbits, 2) - dtypestr = '>' + dtype.char # dtype always big endian? - - unpack = struct.unpack - l = runlen * (len(data)*8 // (runlen*itemsize + skipbits)) - result = numpy.empty((l, ), dtype) - bitcount = 0 - for i in range(len(result)): - start = bitcount // 8 - s = data[start:start+itembytes] - try: - code = unpack(dtypestr, s)[0] - except Exception: - code = unpack(dtypestr, s + b'\x00'*(itembytes-len(s)))[0] - code <<= bitcount % 8 - code &= bitmask - result[i] = code >> shrbits - bitcount += itemsize - if (i+1) % runlen == 0: - bitcount += skipbits - return result - - -def unpackrgb(data, dtype='>> data = struct.pack('BBBB', 0x21, 0x08, 0xff, 0xff) - >>> print(unpackrgb(data, '>> print(unpackrgb(data, '>> print(unpackrgb(data, '= bits) - data = numpy.fromstring(data, dtype.byteorder+dt) - result = numpy.empty((data.size, len(bitspersample)), dtype.char) - for i, bps in enumerate(bitspersample): - t = data >> int(numpy.sum(bitspersample[i+1:])) - t &= int('0b'+'1'*bps, 2) - if rescale: - o = ((dtype.itemsize * 8) // bps + 1) * bps - if o > data.dtype.itemsize * 8: - t = t.astype('I') - t *= (2**o - 1) // (2**bps - 1) - t //= 2**(o - (dtype.itemsize * 8)) - result[:, i] = t - return result.reshape(-1) - - -def reorient(image, orientation): - """Return reoriented view of image array. - - Parameters - ---------- - image : numpy array - Non-squeezed output of asarray() functions. - Axes -3 and -2 must be image length and width respectively. - orientation : int or str - One of TIFF_ORIENTATIONS keys or values. - - """ - o = TIFF_ORIENTATIONS.get(orientation, orientation) - if o == 'top_left': - return image - elif o == 'top_right': - return image[..., ::-1, :] - elif o == 'bottom_left': - return image[..., ::-1, :, :] - elif o == 'bottom_right': - return image[..., ::-1, ::-1, :] - elif o == 'left_top': - return numpy.swapaxes(image, -3, -2) - elif o == 'right_top': - return numpy.swapaxes(image, -3, -2)[..., ::-1, :] - elif o == 'left_bottom': - return numpy.swapaxes(image, -3, -2)[..., ::-1, :, :] - elif o == 'right_bottom': - return numpy.swapaxes(image, -3, -2)[..., ::-1, ::-1, :] - - -def numpy_fromfile(arg, dtype=float, count=-1, sep=''): - """Return array from data in binary file. - - Work around numpy issue #2230, "numpy.fromfile does not accept StringIO - object" https://github.com/numpy/numpy/issues/2230. - - """ - try: - return numpy.fromfile(arg, dtype, count, sep) - except IOError: - if count < 0: - size = 2**30 - else: - size = count * numpy.dtype(dtype).itemsize - data = arg.read(int(size)) - return numpy.fromstring(data, dtype, count, sep) - - -def stripnull(string): - """Return string truncated at first null character.""" - i = string.find(b'\x00') - return string if (i < 0) else string[:i] - - -def format_size(size): - """Return file size as string from byte size.""" - for unit in ('B', 'KB', 'MB', 'GB', 'TB'): - if size < 2048: - return "%.f %s" % (size, unit) - size /= 1024.0 - - -def natural_sorted(iterable): - """Return human sorted list of strings. - - >>> natural_sorted(['f1', 'f2', 'f10']) - ['f1', 'f2', 'f10'] - - """ - def sortkey(x): - return [(int(c) if c.isdigit() else c) for c in re.split(numbers, x)] - numbers = re.compile('(\d+)') - return sorted(iterable, key=sortkey) - - -def datetime_from_timestamp(n, epoch=datetime.datetime.fromordinal(693594)): - """Return datetime object from timestamp in Excel serial format. - - Examples - -------- - >>> datetime_from_timestamp(40237.029999999795) - datetime.datetime(2010, 2, 28, 0, 43, 11, 999982) - - """ - return epoch + datetime.timedelta(n) - - -def test_tifffile(directory='testimages', verbose=True): - """Read all images in directory. Print error message on failure. - - Examples - -------- - >>> test_tifffile(verbose=False) - - """ - successful = 0 - failed = 0 - start = time.time() - for f in glob.glob(os.path.join(directory, '*.*')): - if verbose: - print("\n%s>\n" % f.lower(), end='') - t0 = time.time() - try: - tif = TiffFile(f, multifile=True) - except Exception as e: - if not verbose: - print(f, end=' ') - print("ERROR:", e) - failed += 1 - continue - try: - img = tif.asarray() - except ValueError: - try: - img = tif[0].asarray() - except Exception as e: - if not verbose: - print(f, end=' ') - print("ERROR:", e) - failed += 1 - continue - finally: - tif.close() - successful += 1 - if verbose: - print("%s, %s %s, %s, %.0f ms" % ( - str(tif), str(img.shape), img.dtype, tif[0].compression, - (time.time()-t0) * 1e3)) - if verbose: - print("\nSuccessfully read %i of %i files in %.3f s\n" % ( - successful, successful+failed, time.time()-start)) - - -class TIFF_SUBFILE_TYPES(object): - def __getitem__(self, key): - result = [] - if key & 1: - result.append('reduced_image') - if key & 2: - result.append('page') - if key & 4: - result.append('mask') - return tuple(result) - - -TIFF_PHOTOMETRICS = { - 0: 'miniswhite', - 1: 'minisblack', - 2: 'rgb', - 3: 'palette', - 4: 'mask', - 5: 'separated', - 6: 'cielab', - 7: 'icclab', - 8: 'itulab', - 32844: 'logl', - 32845: 'logluv', -} - -TIFF_COMPESSIONS = { - 1: None, - 2: 'ccittrle', - 3: 'ccittfax3', - 4: 'ccittfax4', - 5: 'lzw', - 6: 'ojpeg', - 7: 'jpeg', - 8: 'adobe_deflate', - 9: 't85', - 10: 't43', - 32766: 'next', - 32771: 'ccittrlew', - 32773: 'packbits', - 32809: 'thunderscan', - 32895: 'it8ctpad', - 32896: 'it8lw', - 32897: 'it8mp', - 32898: 'it8bl', - 32908: 'pixarfilm', - 32909: 'pixarlog', - 32946: 'deflate', - 32947: 'dcs', - 34661: 'jbig', - 34676: 'sgilog', - 34677: 'sgilog24', - 34712: 'jp2000', - 34713: 'nef', -} - -TIFF_DECOMPESSORS = { - None: lambda x: x, - 'adobe_deflate': zlib.decompress, - 'deflate': zlib.decompress, - 'packbits': decodepackbits, - 'lzw': decodelzw, -} - -TIFF_DATA_TYPES = { - 1: '1B', # BYTE 8-bit unsigned integer. - 2: '1s', # ASCII 8-bit byte that contains a 7-bit ASCII code; - # the last byte must be NULL (binary zero). - 3: '1H', # SHORT 16-bit (2-byte) unsigned integer - 4: '1I', # LONG 32-bit (4-byte) unsigned integer. - 5: '2I', # RATIONAL Two LONGs: the first represents the numerator of - # a fraction; the second, the denominator. - 6: '1b', # SBYTE An 8-bit signed (twos-complement) integer. - 7: '1B', # UNDEFINED An 8-bit byte that may contain anything, - # depending on the definition of the field. - 8: '1h', # SSHORT A 16-bit (2-byte) signed (twos-complement) integer. - 9: '1i', # SLONG A 32-bit (4-byte) signed (twos-complement) integer. - 10: '2i', # SRATIONAL Two SLONGs: the first represents the numerator - # of a fraction, the second the denominator. - 11: '1f', # FLOAT Single precision (4-byte) IEEE format. - 12: '1d', # DOUBLE Double precision (8-byte) IEEE format. - 13: '1I', # IFD unsigned 4 byte IFD offset. - #14: '', # UNICODE - #15: '', # COMPLEX - 16: '1Q', # LONG8 unsigned 8 byte integer (BigTiff) - 17: '1q', # SLONG8 signed 8 byte integer (BigTiff) - 18: '1Q', # IFD8 unsigned 8 byte IFD offset (BigTiff) -} - -TIFF_SAMPLE_FORMATS = { - 1: 'uint', - 2: 'int', - 3: 'float', - #4: 'void', - #5: 'complex_int', - 6: 'complex', -} - -TIFF_SAMPLE_DTYPES = { - ('uint', 1): '?', # bitmap - ('uint', 2): 'B', - ('uint', 3): 'B', - ('uint', 4): 'B', - ('uint', 5): 'B', - ('uint', 6): 'B', - ('uint', 7): 'B', - ('uint', 8): 'B', - ('uint', 9): 'H', - ('uint', 10): 'H', - ('uint', 11): 'H', - ('uint', 12): 'H', - ('uint', 13): 'H', - ('uint', 14): 'H', - ('uint', 15): 'H', - ('uint', 16): 'H', - ('uint', 17): 'I', - ('uint', 18): 'I', - ('uint', 19): 'I', - ('uint', 20): 'I', - ('uint', 21): 'I', - ('uint', 22): 'I', - ('uint', 23): 'I', - ('uint', 24): 'I', - ('uint', 25): 'I', - ('uint', 26): 'I', - ('uint', 27): 'I', - ('uint', 28): 'I', - ('uint', 29): 'I', - ('uint', 30): 'I', - ('uint', 31): 'I', - ('uint', 32): 'I', - ('uint', 64): 'Q', - ('int', 8): 'b', - ('int', 16): 'h', - ('int', 32): 'i', - ('int', 64): 'q', - ('float', 16): 'e', - ('float', 32): 'f', - ('float', 64): 'd', - ('complex', 64): 'F', - ('complex', 128): 'D', - ('uint', (5, 6, 5)): 'B', -} - -TIFF_ORIENTATIONS = { - 1: 'top_left', - 2: 'top_right', - 3: 'bottom_right', - 4: 'bottom_left', - 5: 'left_top', - 6: 'right_top', - 7: 'right_bottom', - 8: 'left_bottom', -} - -AXES_LABELS = { - 'X': 'width', - 'Y': 'height', - 'Z': 'depth', - 'S': 'sample', # rgb(a) - 'P': 'plane', # page - 'T': 'time', - 'C': 'channel', # color, emission wavelength - 'A': 'angle', - 'F': 'phase', - 'R': 'tile', # region, point - 'H': 'lifetime', # histogram - 'E': 'lambda', # excitation wavelength - 'L': 'exposure', # lux - 'V': 'event', - 'Q': 'other', -} - -AXES_LABELS.update(dict((v, k) for k, v in AXES_LABELS.items())) - -# NIH Image PicHeader v1.63 -NIH_IMAGE_HEADER = [ - ('fileid', 'a8'), - ('nlines', 'i2'), - ('pixelsperline', 'i2'), - ('version', 'i2'), - ('oldlutmode', 'i2'), - ('oldncolors', 'i2'), - ('colors', 'u1', (3, 32)), - ('oldcolorstart', 'i2'), - ('colorwidth', 'i2'), - ('extracolors', 'u2', (6, 3)), - ('nextracolors', 'i2'), - ('foregroundindex', 'i2'), - ('backgroundindex', 'i2'), - ('xscale', 'f8'), - ('_x0', 'i2'), - ('_x1', 'i2'), - ('units_t', 'i2'), - ('p1', [('x', 'i2'), ('y', 'i2')]), - ('p2', [('x', 'i2'), ('y', 'i2')]), - ('curvefit_t', 'i2'), - ('ncoefficients', 'i2'), - ('coeff', 'f8', 6), - ('_um_len', 'u1'), - ('um', 'a15'), - ('_x2', 'u1'), - ('binarypic', 'b1'), - ('slicestart', 'i2'), - ('sliceend', 'i2'), - ('scalemagnification', 'f4'), - ('nslices', 'i2'), - ('slicespacing', 'f4'), - ('currentslice', 'i2'), - ('frameinterval', 'f4'), - ('pixelaspectratio', 'f4'), - ('colorstart', 'i2'), - ('colorend', 'i2'), - ('ncolors', 'i2'), - ('fill1', '3u2'), - ('fill2', '3u2'), - ('colortable_t', 'u1'), - ('lutmode_t', 'u1'), - ('invertedtable', 'b1'), - ('zeroclip', 'b1'), - ('_xunit_len', 'u1'), - ('xunit', 'a11'), - ('stacktype_t', 'i2'), -] - -#NIH_COLORTABLE_TYPE = ( -# 'CustomTable', 'AppleDefault', 'Pseudo20', 'Pseudo32', 'Rainbow', -# 'Fire1', 'Fire2', 'Ice', 'Grays', 'Spectrum') -#NIH_LUTMODE_TYPE = ( -# 'PseudoColor', 'OldAppleDefault', 'OldSpectrum', 'GrayScale', -# 'ColorLut', 'CustomGrayscale') -#NIH_CURVEFIT_TYPE = ( -# 'StraightLine', 'Poly2', 'Poly3', 'Poly4', 'Poly5', 'ExpoFit', -# 'PowerFit', 'LogFit', 'RodbardFit', 'SpareFit1', 'Uncalibrated', -# 'UncalibratedOD') -#NIH_UNITS_TYPE = ( -# 'Nanometers', 'Micrometers', 'Millimeters', 'Centimeters', 'Meters', -# 'Kilometers', 'Inches', 'Feet', 'Miles', 'Pixels', 'OtherUnits') -#NIH_STACKTYPE_TYPE = ( -# 'VolumeStack', 'RGBStack', 'MovieStack', 'HSVStack') - -# MetaMorph STK tags -MM_TAG_IDS = { - 0: 'auto_scale', - 1: 'min_scale', - 2: 'max_scale', - 3: 'spatial_calibration', - #4: 'x_calibration', - #5: 'y_calibration', - #6: 'calibration_units', - #7: 'name', - 8: 'thresh_state', - 9: 'thresh_state_red', - 11: 'thresh_state_green', - 12: 'thresh_state_blue', - 13: 'thresh_state_lo', - 14: 'thresh_state_hi', - 15: 'zoom', - #16: 'create_time', - #17: 'last_saved_time', - 18: 'current_buffer', - 19: 'gray_fit', - 20: 'gray_point_count', - #21: 'gray_x', - #22: 'gray_y', - #23: 'gray_min', - #24: 'gray_max', - #25: 'gray_unit_name', - 26: 'standard_lut', - 27: 'wavelength', - #28: 'stage_position', - #29: 'camera_chip_offset', - #30: 'overlay_mask', - #31: 'overlay_compress', - #32: 'overlay', - #33: 'special_overlay_mask', - #34: 'special_overlay_compress', - #35: 'special_overlay', - 36: 'image_property', - #37: 'stage_label', - #38: 'autoscale_lo_info', - #39: 'autoscale_hi_info', - #40: 'absolute_z', - #41: 'absolute_z_valid', - #42: 'gamma', - #43: 'gamma_red', - #44: 'gamma_green', - #45: 'gamma_blue', - #46: 'camera_bin', - 47: 'new_lut', - #48: 'image_property_ex', - 49: 'plane_property', - #50: 'user_lut_table', - 51: 'red_autoscale_info', - #52: 'red_autoscale_lo_info', - #53: 'red_autoscale_hi_info', - 54: 'red_minscale_info', - 55: 'red_maxscale_info', - 56: 'green_autoscale_info', - #57: 'green_autoscale_lo_info', - #58: 'green_autoscale_hi_info', - 59: 'green_minscale_info', - 60: 'green_maxscale_info', - 61: 'blue_autoscale_info', - #62: 'blue_autoscale_lo_info', - #63: 'blue_autoscale_hi_info', - 64: 'blue_min_scale_info', - 65: 'blue_max_scale_info', - #66: 'overlay_plane_color' -} - -# Olympus FluoView -MM_DIMENSION = [ - ('name', 'a16'), - ('size', 'i4'), - ('origin', 'f8'), - ('resolution', 'f8'), - ('unit', 'a64'), -] - -MM_HEADER = [ - ('header_flag', 'i2'), - ('image_type', 'u1'), - ('image_name', 'a257'), - ('offset_data', 'u4'), - ('palette_size', 'i4'), - ('offset_palette0', 'u4'), - ('offset_palette1', 'u4'), - ('comment_size', 'i4'), - ('offset_comment', 'u4'), - ('dimensions', MM_DIMENSION, 10), - ('offset_position', 'u4'), - ('map_type', 'i2'), - ('map_min', 'f8'), - ('map_max', 'f8'), - ('min_value', 'f8'), - ('max_value', 'f8'), - ('offset_map', 'u4'), - ('gamma', 'f8'), - ('offset', 'f8'), - ('gray_channel', MM_DIMENSION), - ('offset_thumbnail', 'u4'), - ('voice_field', 'i4'), - ('offset_voice_field', 'u4'), -] - -# Carl Zeiss LSM -CZ_LSM_INFO = [ - ('magic_number', 'i4'), - ('structure_size', 'i4'), - ('dimension_x', 'i4'), - ('dimension_y', 'i4'), - ('dimension_z', 'i4'), - ('dimension_channels', 'i4'), - ('dimension_time', 'i4'), - ('dimension_data_type', 'i4'), - ('thumbnail_x', 'i4'), - ('thumbnail_y', 'i4'), - ('voxel_size_x', 'f8'), - ('voxel_size_y', 'f8'), - ('voxel_size_z', 'f8'), - ('origin_x', 'f8'), - ('origin_y', 'f8'), - ('origin_z', 'f8'), - ('scan_type', 'u2'), - ('spectral_scan', 'u2'), - ('data_type', 'u4'), - ('offset_vector_overlay', 'u4'), - ('offset_input_lut', 'u4'), - ('offset_output_lut', 'u4'), - ('offset_channel_colors', 'u4'), - ('time_interval', 'f8'), - ('offset_channel_data_types', 'u4'), - ('offset_scan_information', 'u4'), - ('offset_ks_data', 'u4'), - ('offset_time_stamps', 'u4'), - ('offset_event_list', 'u4'), - ('offset_roi', 'u4'), - ('offset_bleach_roi', 'u4'), - ('offset_next_recording', 'u4'), - ('display_aspect_x', 'f8'), - ('display_aspect_y', 'f8'), - ('display_aspect_z', 'f8'), - ('display_aspect_time', 'f8'), - ('offset_mean_of_roi_overlay', 'u4'), - ('offset_topo_isoline_overlay', 'u4'), - ('offset_topo_profile_overlay', 'u4'), - ('offset_linescan_overlay', 'u4'), - ('offset_toolbar_flags', 'u4'), -] - -# Import functions for LSM_INFO sub-records -CZ_LSM_INFO_READERS = { - 'scan_information': read_cz_lsm_scan_info, - 'time_stamps': read_cz_lsm_time_stamps, - 'event_list': read_cz_lsm_event_list, -} - -# Map cz_lsm_info.scan_type to dimension order -CZ_SCAN_TYPES = { - 0: 'XYZCT', # x-y-z scan - 1: 'XYZCT', # z scan (x-z plane) - 2: 'XYZCT', # line scan - 3: 'XYTCZ', # time series x-y - 4: 'XYZTC', # time series x-z - 5: 'XYTCZ', # time series 'Mean of ROIs' - 6: 'XYZTC', # time series x-y-z - 7: 'XYCTZ', # spline scan - 8: 'XYCZT', # spline scan x-z - 9: 'XYTCZ', # time series spline plane x-z - 10: 'XYZCT', # point mode -} - -# Map dimension codes to cz_lsm_info attribute -CZ_DIMENSIONS = { - 'X': 'dimension_x', - 'Y': 'dimension_y', - 'Z': 'dimension_z', - 'C': 'dimension_channels', - 'T': 'dimension_time', -} - -# Descriptions of cz_lsm_info.data_type -CZ_DATA_TYPES = { - 0: 'varying data types', - 2: '12 bit unsigned integer', - 5: '32 bit float', -} - -CZ_LSM_SCAN_INFO_ARRAYS = { - 0x20000000: "tracks", - 0x30000000: "lasers", - 0x60000000: "detectionchannels", - 0x80000000: "illuminationchannels", - 0xa0000000: "beamsplitters", - 0xc0000000: "datachannels", - 0x13000000: "markers", - 0x11000000: "timers", -} - -CZ_LSM_SCAN_INFO_STRUCTS = { - 0x40000000: "tracks", - 0x50000000: "lasers", - 0x70000000: "detectionchannels", - 0x90000000: "illuminationchannels", - 0xb0000000: "beamsplitters", - 0xd0000000: "datachannels", - 0x14000000: "markers", - 0x12000000: "timers", -} - -CZ_LSM_SCAN_INFO_ATTRIBUTES = { - 0x10000001: "name", - 0x10000002: "description", - 0x10000003: "notes", - 0x10000004: "objective", - 0x10000005: "processing_summary", - 0x10000006: "special_scan_mode", - 0x10000007: "oledb_recording_scan_type", - 0x10000008: "oledb_recording_scan_mode", - 0x10000009: "number_of_stacks", - 0x1000000a: "lines_per_plane", - 0x1000000b: "samples_per_line", - 0x1000000c: "planes_per_volume", - 0x1000000d: "images_width", - 0x1000000e: "images_height", - 0x1000000f: "images_number_planes", - 0x10000010: "images_number_stacks", - 0x10000011: "images_number_channels", - 0x10000012: "linscan_xy_size", - 0x10000013: "scan_direction", - 0x10000014: "time_series", - 0x10000015: "original_scan_data", - 0x10000016: "zoom_x", - 0x10000017: "zoom_y", - 0x10000018: "zoom_z", - 0x10000019: "sample_0x", - 0x1000001a: "sample_0y", - 0x1000001b: "sample_0z", - 0x1000001c: "sample_spacing", - 0x1000001d: "line_spacing", - 0x1000001e: "plane_spacing", - 0x1000001f: "plane_width", - 0x10000020: "plane_height", - 0x10000021: "volume_depth", - 0x10000023: "nutation", - 0x10000034: "rotation", - 0x10000035: "precession", - 0x10000036: "sample_0time", - 0x10000037: "start_scan_trigger_in", - 0x10000038: "start_scan_trigger_out", - 0x10000039: "start_scan_event", - 0x10000040: "start_scan_time", - 0x10000041: "stop_scan_trigger_in", - 0x10000042: "stop_scan_trigger_out", - 0x10000043: "stop_scan_event", - 0x10000044: "stop_scan_time", - 0x10000045: "use_rois", - 0x10000046: "use_reduced_memory_rois", - 0x10000047: "user", - 0x10000048: "use_bccorrection", - 0x10000049: "position_bccorrection1", - 0x10000050: "position_bccorrection2", - 0x10000051: "interpolation_y", - 0x10000052: "camera_binning", - 0x10000053: "camera_supersampling", - 0x10000054: "camera_frame_width", - 0x10000055: "camera_frame_height", - 0x10000056: "camera_offset_x", - 0x10000057: "camera_offset_y", - # lasers - 0x50000001: "name", - 0x50000002: "acquire", - 0x50000003: "power", - # tracks - 0x40000001: "multiplex_type", - 0x40000002: "multiplex_order", - 0x40000003: "sampling_mode", - 0x40000004: "sampling_method", - 0x40000005: "sampling_number", - 0x40000006: "acquire", - 0x40000007: "sample_observation_time", - 0x4000000b: "time_between_stacks", - 0x4000000c: "name", - 0x4000000d: "collimator1_name", - 0x4000000e: "collimator1_position", - 0x4000000f: "collimator2_name", - 0x40000010: "collimator2_position", - 0x40000011: "is_bleach_track", - 0x40000012: "is_bleach_after_scan_number", - 0x40000013: "bleach_scan_number", - 0x40000014: "trigger_in", - 0x40000015: "trigger_out", - 0x40000016: "is_ratio_track", - 0x40000017: "bleach_count", - 0x40000018: "spi_center_wavelength", - 0x40000019: "pixel_time", - 0x40000021: "condensor_frontlens", - 0x40000023: "field_stop_value", - 0x40000024: "id_condensor_aperture", - 0x40000025: "condensor_aperture", - 0x40000026: "id_condensor_revolver", - 0x40000027: "condensor_filter", - 0x40000028: "id_transmission_filter1", - 0x40000029: "id_transmission1", - 0x40000030: "id_transmission_filter2", - 0x40000031: "id_transmission2", - 0x40000032: "repeat_bleach", - 0x40000033: "enable_spot_bleach_pos", - 0x40000034: "spot_bleach_posx", - 0x40000035: "spot_bleach_posy", - 0x40000036: "spot_bleach_posz", - 0x40000037: "id_tubelens", - 0x40000038: "id_tubelens_position", - 0x40000039: "transmitted_light", - 0x4000003a: "reflected_light", - 0x4000003b: "simultan_grab_and_bleach", - 0x4000003c: "bleach_pixel_time", - # detection_channels - 0x70000001: "integration_mode", - 0x70000002: "special_mode", - 0x70000003: "detector_gain_first", - 0x70000004: "detector_gain_last", - 0x70000005: "amplifier_gain_first", - 0x70000006: "amplifier_gain_last", - 0x70000007: "amplifier_offs_first", - 0x70000008: "amplifier_offs_last", - 0x70000009: "pinhole_diameter", - 0x7000000a: "counting_trigger", - 0x7000000b: "acquire", - 0x7000000c: "point_detector_name", - 0x7000000d: "amplifier_name", - 0x7000000e: "pinhole_name", - 0x7000000f: "filter_set_name", - 0x70000010: "filter_name", - 0x70000013: "integrator_name", - 0x70000014: "detection_channel_name", - 0x70000015: "detection_detector_gain_bc1", - 0x70000016: "detection_detector_gain_bc2", - 0x70000017: "detection_amplifier_gain_bc1", - 0x70000018: "detection_amplifier_gain_bc2", - 0x70000019: "detection_amplifier_offset_bc1", - 0x70000020: "detection_amplifier_offset_bc2", - 0x70000021: "detection_spectral_scan_channels", - 0x70000022: "detection_spi_wavelength_start", - 0x70000023: "detection_spi_wavelength_stop", - 0x70000026: "detection_dye_name", - 0x70000027: "detection_dye_folder", - # illumination_channels - 0x90000001: "name", - 0x90000002: "power", - 0x90000003: "wavelength", - 0x90000004: "aquire", - 0x90000005: "detchannel_name", - 0x90000006: "power_bc1", - 0x90000007: "power_bc2", - # beam_splitters - 0xb0000001: "filter_set", - 0xb0000002: "filter", - 0xb0000003: "name", - # data_channels - 0xd0000001: "name", - 0xd0000003: "acquire", - 0xd0000004: "color", - 0xd0000005: "sample_type", - 0xd0000006: "bits_per_sample", - 0xd0000007: "ratio_type", - 0xd0000008: "ratio_track1", - 0xd0000009: "ratio_track2", - 0xd000000a: "ratio_channel1", - 0xd000000b: "ratio_channel2", - 0xd000000c: "ratio_const1", - 0xd000000d: "ratio_const2", - 0xd000000e: "ratio_const3", - 0xd000000f: "ratio_const4", - 0xd0000010: "ratio_const5", - 0xd0000011: "ratio_const6", - 0xd0000012: "ratio_first_images1", - 0xd0000013: "ratio_first_images2", - 0xd0000014: "dye_name", - 0xd0000015: "dye_folder", - 0xd0000016: "spectrum", - 0xd0000017: "acquire", - # markers - 0x14000001: "name", - 0x14000002: "description", - 0x14000003: "trigger_in", - 0x14000004: "trigger_out", - # timers - 0x12000001: "name", - 0x12000002: "description", - 0x12000003: "interval", - 0x12000004: "trigger_in", - 0x12000005: "trigger_out", - 0x12000006: "activation_time", - 0x12000007: "activation_number", -} - -# Map TIFF tag code to attribute name, default value, type, count, validator -TIFF_TAGS = { - 254: ('new_subfile_type', 0, 4, 1, TIFF_SUBFILE_TYPES()), - 255: ('subfile_type', None, 3, 1, - {0: 'undefined', 1: 'image', 2: 'reduced_image', 3: 'page'}), - 256: ('image_width', None, 4, 1, None), - 257: ('image_length', None, 4, 1, None), - 258: ('bits_per_sample', 1, 3, 1, None), - 259: ('compression', 1, 3, 1, TIFF_COMPESSIONS), - 262: ('photometric', None, 3, 1, TIFF_PHOTOMETRICS), - 266: ('fill_order', 1, 3, 1, {1: 'msb2lsb', 2: 'lsb2msb'}), - 269: ('document_name', None, 2, None, None), - 270: ('image_description', None, 2, None, None), - 271: ('make', None, 2, None, None), - 272: ('model', None, 2, None, None), - 273: ('strip_offsets', None, 4, None, None), - 274: ('orientation', 1, 3, 1, TIFF_ORIENTATIONS), - 277: ('samples_per_pixel', 1, 3, 1, None), - 278: ('rows_per_strip', 2**32-1, 4, 1, None), - 279: ('strip_byte_counts', None, 4, None, None), - 280: ('min_sample_value', None, 3, None, None), - 281: ('max_sample_value', None, 3, None, None), # 2**bits_per_sample - 282: ('x_resolution', None, 5, 1, None), - 283: ('y_resolution', None, 5, 1, None), - 284: ('planar_configuration', 1, 3, 1, {1: 'contig', 2: 'separate'}), - 285: ('page_name', None, 2, None, None), - 286: ('x_position', None, 5, 1, None), - 287: ('y_position', None, 5, 1, None), - 296: ('resolution_unit', 2, 4, 1, {1: 'none', 2: 'inch', 3: 'centimeter'}), - 297: ('page_number', None, 3, 2, None), - 305: ('software', None, 2, None, None), - 306: ('datetime', None, 2, None, None), - 315: ('artist', None, 2, None, None), - 316: ('host_computer', None, 2, None, None), - 317: ('predictor', 1, 3, 1, {1: None, 2: 'horizontal'}), - 320: ('color_map', None, 3, None, None), - 322: ('tile_width', None, 4, 1, None), - 323: ('tile_length', None, 4, 1, None), - 324: ('tile_offsets', None, 4, None, None), - 325: ('tile_byte_counts', None, 4, None, None), - 338: ('extra_samples', None, 3, None, - {0: 'unspecified', 1: 'assocalpha', 2: 'unassalpha'}), - 339: ('sample_format', 1, 3, 1, TIFF_SAMPLE_FORMATS), - 347: ('jpeg_tables', None, None, None, None), - 530: ('ycbcr_subsampling', 1, 3, 2, None), - 531: ('ycbcr_positioning', 1, 3, 1, None), - 32997: ('image_depth', None, 4, 1, None), - 32998: ('tile_depth', None, 4, 1, None), - 33432: ('copyright', None, 1, None, None), - 33445: ('md_file_tag', None, 4, 1, None), - 33446: ('md_scale_pixel', None, 5, 1, None), - 33447: ('md_color_table', None, 3, None, None), - 33448: ('md_lab_name', None, 2, None, None), - 33449: ('md_sample_info', None, 2, None, None), - 33450: ('md_prep_date', None, 2, None, None), - 33451: ('md_prep_time', None, 2, None, None), - 33452: ('md_file_units', None, 2, None, None), - 33550: ('model_pixel_scale', None, 12, 3, None), - 33922: ('model_tie_point', None, 12, None, None), - 37510: ('user_comment', None, None, None, None), - 34665: ('exif_ifd', None, None, 1, None), - 34735: ('geo_key_directory', None, 3, None, None), - 34736: ('geo_double_params', None, 12, None, None), - 34737: ('geo_ascii_params', None, 2, None, None), - 34853: ('gps_ifd', None, None, 1, None), - 42112: ('gdal_metadata', None, 2, None, None), - 42113: ('gdal_nodata', None, 2, None, None), - 50838: ('imagej_byte_counts', None, None, None, None), - 50289: ('mc_xy_position', None, 12, 2, None), - 50290: ('mc_z_position', None, 12, 1, None), - 50291: ('mc_xy_calibration', None, 12, 3, None), - 50292: ('mc_lens_lem_na_n', None, 12, 3, None), - 50293: ('mc_channel_name', None, 1, None, None), - 50294: ('mc_ex_wavelength', None, 12, 1, None), - 50295: ('mc_time_stamp', None, 12, 1, None), - 65200: ('flex_xml', None, 2, None, None), - # code: (attribute name, default value, type, count, validator) -} - -# Map custom TIFF tag codes to attribute names and import functions -CUSTOM_TAGS = { - 700: ('xmp', read_bytes), - 34377: ('photoshop', read_numpy), - 33723: ('iptc', read_bytes), - 34675: ('icc_profile', read_numpy), - 33628: ('mm_uic1', read_mm_uic1), - 33629: ('mm_uic2', read_mm_uic2), - 33630: ('mm_uic3', read_mm_uic3), - 33631: ('mm_uic4', read_mm_uic4), - 34361: ('mm_header', read_mm_header), - 34362: ('mm_stamp', read_mm_stamp), - 34386: ('mm_user_block', read_bytes), - 34412: ('cz_lsm_info', read_cz_lsm_info), - 43314: ('nih_image_header', read_nih_image_header), - # 40001: ('mc_ipwinscal', read_bytes), - 40100: ('mc_id_old', read_bytes), - 50288: ('mc_id', read_bytes), - 50296: ('mc_frame_properties', read_bytes), - 50839: ('imagej_metadata', read_bytes), - 51123: ('micromanager_metadata', read_json), -} - -# Max line length of printed output -PRINT_LINE_LEN = 79 - - -def imshow(data, title=None, vmin=0, vmax=None, cmap=None, - bitspersample=None, photometric='rgb', interpolation='nearest', - dpi=96, figure=None, subplot=111, maxdim=8192, **kwargs): - """Plot n-dimensional images using matplotlib.pyplot. - - Return figure, subplot and plot axis. - Requires pyplot already imported ``from matplotlib import pyplot``. - - Parameters - ---------- - bitspersample : int or None - Number of bits per channel in integer RGB images. - photometric : {'miniswhite', 'minisblack', 'rgb', or 'palette'} - The color space of the image data. - title : str - Window and subplot title. - figure : matplotlib.figure.Figure (optional). - Matplotlib to use for plotting. - subplot : int - A matplotlib.pyplot.subplot axis. - maxdim : int - maximum image size in any dimension. - kwargs : optional - Arguments for matplotlib.pyplot.imshow. - - """ - #if photometric not in ('miniswhite', 'minisblack', 'rgb', 'palette'): - # raise ValueError("Can't handle %s photometrics" % photometric) - # TODO: handle photometric == 'separated' (CMYK) - isrgb = photometric in ('rgb', 'palette') - data = numpy.atleast_2d(data.squeeze()) - data = data[(slice(0, maxdim), ) * len(data.shape)] - - dims = data.ndim - if dims < 2: - raise ValueError("not an image") - elif dims == 2: - dims = 0 - isrgb = False - else: - if isrgb and data.shape[-3] in (3, 4): - data = numpy.swapaxes(data, -3, -2) - data = numpy.swapaxes(data, -2, -1) - elif not isrgb and data.shape[-1] in (3, 4): - data = numpy.swapaxes(data, -3, -1) - data = numpy.swapaxes(data, -2, -1) - isrgb = isrgb and data.shape[-1] in (3, 4) - dims -= 3 if isrgb else 2 - - if photometric == 'palette' and isrgb: - datamax = data.max() - if datamax > 255: - data >>= 8 # possible precision loss - data = data.astype('B') - elif data.dtype.kind in 'ui': - if not (isrgb and data.dtype.itemsize <= 1) or bitspersample is None: - try: - bitspersample = int(math.ceil(math.log(data.max(), 2))) - except Exception: - bitspersample = data.dtype.itemsize * 8 - elif not isinstance(bitspersample, int): - # bitspersample can be tuple, e.g. (5, 6, 5) - bitspersample = data.dtype.itemsize * 8 - datamax = 2**bitspersample - if isrgb: - if bitspersample < 8: - data <<= 8 - bitspersample - elif bitspersample > 8: - data >>= bitspersample - 8 # precision loss - data = data.astype('B') - elif data.dtype.kind == 'f': - datamax = data.max() - if isrgb and datamax > 1.0: - if data.dtype.char == 'd': - data = data.astype('f') - data /= datamax - elif data.dtype.kind == 'b': - datamax = 1 - elif data.dtype.kind == 'c': - raise NotImplementedError("complex type") # TODO: handle complex types - - if not isrgb: - if vmax is None: - vmax = datamax - if vmin is None: - if data.dtype.kind == 'i': - dtmin = numpy.iinfo(data.dtype).min - vmin = numpy.min(data) - if vmin == dtmin: - vmin = numpy.min(data > dtmin) - if data.dtype.kind == 'f': - dtmin = numpy.finfo(data.dtype).min - vmin = numpy.min(data) - if vmin == dtmin: - vmin = numpy.min(data > dtmin) - else: - vmin = 0 - - pyplot = sys.modules['matplotlib.pyplot'] - - if figure is None: - pyplot.rc('font', family='sans-serif', weight='normal', size=8) - figure = pyplot.figure(dpi=dpi, figsize=(10.3, 6.3), frameon=True, - facecolor='1.0', edgecolor='w') - try: - figure.canvas.manager.window.title(title) - except Exception: - pass - pyplot.subplots_adjust(bottom=0.03*(dims+2), top=0.9, - left=0.1, right=0.95, hspace=0.05, wspace=0.0) - subplot = pyplot.subplot(subplot) - - if title: - try: - title = unicode(title, 'Windows-1252') - except TypeError: - pass - pyplot.title(title, size=11) - - if cmap is None: - if data.dtype.kind in 'ub' and vmin == 0: - cmap = 'gray' - else: - cmap = 'coolwarm' - if photometric == 'miniswhite': - cmap += '_r' - - image = pyplot.imshow(data[(0, ) * dims].squeeze(), vmin=vmin, vmax=vmax, - cmap=cmap, interpolation=interpolation, **kwargs) - - if not isrgb: - pyplot.colorbar() # panchor=(0.55, 0.5), fraction=0.05 - - def format_coord(x, y): - # callback function to format coordinate display in toolbar - x = int(x + 0.5) - y = int(y + 0.5) - try: - if dims: - return "%s @ %s [%4i, %4i]" % (cur_ax_dat[1][y, x], - current, x, y) - else: - return "%s @ [%4i, %4i]" % (data[y, x], x, y) - except IndexError: - return "" - - pyplot.gca().format_coord = format_coord - - if dims: - current = list((0, ) * dims) - cur_ax_dat = [0, data[tuple(current)].squeeze()] - sliders = [pyplot.Slider( - pyplot.axes([0.125, 0.03*(axis+1), 0.725, 0.025]), - 'Dimension %i' % axis, 0, data.shape[axis]-1, 0, facecolor='0.5', - valfmt='%%.0f [%i]' % data.shape[axis]) for axis in range(dims)] - for slider in sliders: - slider.drawon = False - - def set_image(current, sliders=sliders, data=data): - # change image and redraw canvas - cur_ax_dat[1] = data[tuple(current)].squeeze() - image.set_data(cur_ax_dat[1]) - for ctrl, index in zip(sliders, current): - ctrl.eventson = False - ctrl.set_val(index) - ctrl.eventson = True - figure.canvas.draw() - - def on_changed(index, axis, data=data, current=current): - # callback function for slider change event - index = int(round(index)) - cur_ax_dat[0] = axis - if index == current[axis]: - return - if index >= data.shape[axis]: - index = 0 - elif index < 0: - index = data.shape[axis] - 1 - current[axis] = index - set_image(current) - - def on_keypressed(event, data=data, current=current): - # callback function for key press event - key = event.key - axis = cur_ax_dat[0] - if str(key) in '0123456789': - on_changed(key, axis) - elif key == 'right': - on_changed(current[axis] + 1, axis) - elif key == 'left': - on_changed(current[axis] - 1, axis) - elif key == 'up': - cur_ax_dat[0] = 0 if axis == len(data.shape)-1 else axis + 1 - elif key == 'down': - cur_ax_dat[0] = len(data.shape)-1 if axis == 0 else axis - 1 - elif key == 'end': - on_changed(data.shape[axis] - 1, axis) - elif key == 'home': - on_changed(0, axis) - - figure.canvas.mpl_connect('key_press_event', on_keypressed) - for axis, ctrl in enumerate(sliders): - ctrl.on_changed(lambda k, a=axis: on_changed(k, a)) - - return figure, subplot, image - - -def _app_show(): - """Block the GUI. For use as skimage plugin.""" - pyplot = sys.modules['matplotlib.pyplot'] - pyplot.show() - - -def main(argv=None): - """Command line usage main function.""" - if float(sys.version[0:3]) < 2.6: - print("This script requires Python version 2.6 or better.") - print("This is Python version %s" % sys.version) - return 0 - if argv is None: - argv = sys.argv - - import optparse - - search_doc = lambda r, d: re.search(r, __doc__).group(1) if __doc__ else d - parser = optparse.OptionParser( - usage="usage: %prog [options] path", - description=search_doc("\n\n([^|]*?)\n\n", ''), - version="%%prog %s" % search_doc(":Version: (.*)", "Unknown")) - opt = parser.add_option - opt('-p', '--page', dest='page', type='int', default=-1, - help="display single page") - opt('-s', '--series', dest='series', type='int', default=-1, - help="display series of pages of same shape") - opt('--nomultifile', dest='nomultifile', action='store_true', - default=False, help="don't read OME series from multiple files") - opt('--noplot', dest='noplot', action='store_true', default=False, - help="don't display images") - opt('--interpol', dest='interpol', metavar='INTERPOL', default='bilinear', - help="image interpolation method") - opt('--dpi', dest='dpi', type='int', default=96, - help="set plot resolution") - opt('--debug', dest='debug', action='store_true', default=False, - help="raise exception on failures") - opt('--test', dest='test', action='store_true', default=False, - help="try read all images in path") - opt('--doctest', dest='doctest', action='store_true', default=False, - help="runs the internal tests") - opt('-v', '--verbose', dest='verbose', action='store_true', default=True) - opt('-q', '--quiet', dest='verbose', action='store_false') - - settings, path = parser.parse_args() - path = ' '.join(path) - - if settings.doctest: - import doctest - doctest.testmod() - return 0 - if not path: - parser.error("No file specified") - if settings.test: - test_tifffile(path, settings.verbose) - return 0 - - if any(i in path for i in '?*'): - path = glob.glob(path) - if not path: - print('no files match the pattern') - return 0 - # TODO: handle image sequences - #if len(path) == 1: - path = path[0] - - print("Reading file structure...", end=' ') - start = time.time() - try: - tif = TiffFile(path, multifile=not settings.nomultifile) - except Exception as e: - if settings.debug: - raise - else: - print("\n", e) - sys.exit(0) - print("%.3f ms" % ((time.time()-start) * 1e3)) - - if tif.is_ome: - settings.norgb = True - - images = [(None, tif[0 if settings.page < 0 else settings.page])] - if not settings.noplot: - print("Reading image data... ", end=' ') - - def notnone(x): - return next(i for i in x if i is not None) - start = time.time() - try: - if settings.page >= 0: - images = [(tif.asarray(key=settings.page), - tif[settings.page])] - elif settings.series >= 0: - images = [(tif.asarray(series=settings.series), - notnone(tif.series[settings.series].pages))] - else: - images = [] - for i, s in enumerate(tif.series): - try: - images.append( - (tif.asarray(series=i), notnone(s.pages))) - except ValueError as e: - images.append((None, notnone(s.pages))) - if settings.debug: - raise - else: - print("\n* series %i failed: %s... " % (i, e), - end='') - print("%.3f ms" % ((time.time()-start) * 1e3)) - except Exception as e: - if settings.debug: - raise - else: - print(e) - - tif.close() - - print("\nTIFF file:", tif) - print() - for i, s in enumerate(tif.series): - print ("Series %i" % i) - print(s) - print() - for i, page in images: - print(page) - print(page.tags) - if page.is_palette: - print("\nColor Map:", page.color_map.shape, page.color_map.dtype) - for attr in ('cz_lsm_info', 'cz_lsm_scan_information', 'mm_uic_tags', - 'mm_header', 'imagej_tags', 'micromanager_metadata', - 'nih_image_header'): - if hasattr(page, attr): - print("", attr.upper(), Record(getattr(page, attr)), sep="\n") - print() - if page.is_micromanager: - print('MICROMANAGER_FILE_METADATA') - print(Record(tif.micromanager_metadata)) - - if images and not settings.noplot: - try: - import matplotlib - matplotlib.use('TkAgg') - from matplotlib import pyplot - except ImportError as e: - warnings.warn("failed to import matplotlib.\n%s" % e) - else: - for img, page in images: - if img is None: - continue - vmin, vmax = None, None - if 'gdal_nodata' in page.tags: - vmin = numpy.min(img[img > float(page.gdal_nodata)]) - if page.is_stk: - try: - vmin = page.mm_uic_tags['min_scale'] - vmax = page.mm_uic_tags['max_scale'] - except KeyError: - pass - else: - if vmax <= vmin: - vmin, vmax = None, None - title = "%s\n %s" % (str(tif), str(page)) - imshow(img, title=title, vmin=vmin, vmax=vmax, - bitspersample=page.bits_per_sample, - photometric=page.photometric, - interpolation=settings.interpol, - dpi=settings.dpi) - pyplot.show() - - -TIFFfile = TiffFile # backwards compatibility - -if sys.version_info[0] > 2: - basestring = str, bytes - unicode = str - -if __name__ == "__main__": - sys.exit(main()) diff --git a/c_source_code/distortion/tifwrite.c b/c_source_code/distortion/tifwrite.c deleted file mode 100644 index 1f24b58c1..000000000 --- a/c_source_code/distortion/tifwrite.c +++ /dev/null @@ -1,235 +0,0 @@ -#define TIFWRITE_C -#include -#include -#include -#include - -#include "machine.h" -#include "tifwrite.h" - -#ifndef MAX_MESSAGE -#define MAX_MESSAGE (1024) -#endif /*MAX_MESSAGE*/ - - -int tiffree(Mytiff * mytiff){ - #ifdef INMEM - free (mytiff->data); - #endif -return(0); -} - - - - -int tifread_into_buffer(Mytiff * mytiff, void ** buffer){ - -} -/* obtain some values from the tiff and check if they are what was expected */ -int tifgettags(Mytiff * mytiff){ - int row,cval; - int32_t ww=0,hh=0,bb=0; - - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_IMAGEWIDTH,&ww); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading width\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_ROWSPERSTRIP,&hh); - //printf("rowsperstrip: %i\n",hh); - mytiff->stripnum=TIFFNumberOfStrips(mytiff->tiffp); - mytiff->stripsize=TIFFRawStripSize(mytiff->tiffp,0); - - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_STRIPOFFSETS,&(mytiff->offsets)); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading offsets\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_STRIPBYTECOUNTS,&(mytiff->bytecounts)); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading bytecounts\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_IMAGELENGTH,&hh); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading length\n",__func__); - return(103); - } - - cval=TIFFGetField(mytiff->tiffp,TIFFTAG_BITSPERSAMPLE,&bb); - if(cval != 1 ) { - fprintf(stderr,"ERROR: %s: error reading bitspersample\n",__func__); - return(103); - } - - /* check validity of this tiff for the job */ - /* height and width should always match */ - /* unless zero then it's unknown */ - /* and the new value used */ - - - if (mytiff->wd != 0) { - if(ww != mytiff->wd){ - fprintf(stderr,"ERROR: data mismatch in %s!\n found ww=%i hh=%i bb=%i \n",__func__,ww,hh,bb); - fprintf(stderr,"expected wd=%i ht=%i bits=%i \n",mytiff->wd,mytiff->ht,mytiff->bits); - return(102); - } - } - - if (mytiff->ht != 0) { - if(hh != mytiff->ht){ - fprintf(stderr,"ERROR: data mismatch in %s!\n found ww=%i hh=%i bb=%i \n",__func__,ww,hh,bb); - fprintf(stderr,"expected wd=%i ht=%i bits=%i \n",mytiff->wd,mytiff->ht,mytiff->bits); - return(102); - } - } - - if (mytiff->bits != 0) { - if(bb != mytiff->bits){ - fprintf(stderr,"ERROR: data mismatch in %s!\n found ww=%i hh=%i bb=%i \n",__func__,ww,hh,bb); - fprintf(stderr,"expected wd=%i ht=%i bits=%i \n",mytiff->wd,mytiff->ht,mytiff->bits); - return(102); - } - } - - - mytiff->ht = hh; - mytiff->wd = ww; - mytiff->bits=(bb); - mytiff->bytes=(bb/8); - mytiff->ndata=mytiff->wd * mytiff->ht; - mytiff->nbytes = mytiff->ndata * mytiff->bytes; - - /* obtain the raw file io descriptor number */ - mytiff->tiffno=TIFFFileno(mytiff->tiffp); - - -return(0); -} - -int tifclose(Mytiff * mytiff){ - int cval; - TIFFClose(mytiff->tiffp); - tiffree (mytiff); - return(0); -} - -/* just open the tiff and keep the pointer in a structure */ -int tifread(Mytiff * mytiff, const char * const filename){ - int cval; - - mytiff->tiffp=TIFFOpen(filename,"rc"); - - if (mytiff->tiffp == NULL ){ - fprintf(stderr,"%s: TIFFOpen function failed (returned NULL) for %s!\n",__func__,filename); - return(101); - } - - - cval=tifgettags(mytiff); - return(cval); -} - -void tifgetstripsdata(Mytiff * mytiff,char * buf){ -/* buf is already allocated */ - int i; - char * bstart; - - bstart=buf; - for (i=0;istripnum;i++){ - TIFFReadRawStrip(mytiff->tiffp,i,bstart,mytiff->stripsize); - bstart+=mytiff->stripsize; - } -} - -int tifwrite(Mytiff * mytiff, const char * const filename){ - int i; - char * datap; - int row; - row=mytiff->wd*mytiff->bytes; - - datap=mytiff->data; - for (i=0;iht;i++){ - TIFFWriteScanline(mytiff->tiffp,datap,i,0); - datap += ( row ); - } - TIFFClose(mytiff->tiffp); -return(0); -} - -int tifinit(Mytiff * mytiff,const char * const filename){ - int myerror; - char * Stripbytes=NULL; - u_int32_t stripbytes,estsize,estbytes; - - - myerror=0; - mytiff->ndata=mytiff->wd * mytiff->ht; - mytiff->nbytes = mytiff->ndata * mytiff->bytes; - mytiff->tiffp= TIFFOpen(filename,"wl"); - if (mytiff->tiffp == 0 ){ - fprintf(stderr,"ERROR: %s: %i: failed tiff open of %s!\n",__func__,__LINE__,filename); - fprintf(stderr,"ERROR: %s: tried to open with TIFFOpen(%s,\"wl\"); \n",__func__,filename); - return(101); - } - TIFFSetField(mytiff->tiffp,TIFFTAG_IMAGEWIDTH,mytiff->wd); - TIFFSetField(mytiff->tiffp,TIFFTAG_IMAGELENGTH,mytiff->ht); - TIFFSetField(mytiff->tiffp,TIFFTAG_BITSPERSAMPLE,mytiff->bytes * 8); - TIFFSetField(mytiff->tiffp,TIFFTAG_PLANARCONFIG,1); - TIFFSetField(mytiff->tiffp,TIFFTAG_PHOTOMETRIC,1); - - Stripbytes=getenv("I12STRIPBYTES"); - //printf("stripbytes: %s\n",Stripbytes); - - if (Stripbytes == NULL ){ - TIFFSetField(mytiff->tiffp,TIFFTAG_ROWSPERSTRIP,mytiff->ht); - //printf("stripbytes set to: %i\n",mytiff->ht); - - }else{ - stripbytes=atoi(Stripbytes); - estbytes=(stripbytes / (mytiff->wd * mytiff->bytes)); - estsize=TIFFDefaultStripSize(mytiff->tiffp,estbytes); - TIFFSetField(mytiff->tiffp,TIFFTAG_ROWSPERSTRIP,estsize); - //printf("stripbytes set to: %i\n",estsize); - } - - return(0); -} - - -#ifdef MAIN -/* a test main-procedure to see if it works */ -int main (int argc,char **argv){ - char * filename; - Mytiff * mytiff; - int i,j; - u_int32_t loc; - int retval; - - retval=0; - mytiff = (Mytiff * ) calloc(1,sizeof (Mytiff)); - filename = strdup(argv[1]); - mytiff->wd=1024; - mytiff->ht=768; - mytiff->bytes=2; - //tifinit(&mytiff,argv[1]); - #ifdef INMEM - for (j=0;j<768;j++){ - for(i=0;i<1024;i++){ - loc=j*1024+i; - loc *= 2; - mytiff.data[loc]=(char)(i); - mytiff.data[loc + 1]=(char)(j); - } - } - #endif - - retval = tifread(mytiff,filename); -return(retval); -} -#endif diff --git a/c_source_code/distortion/tifwrite.h b/c_source_code/distortion/tifwrite.h deleted file mode 100644 index e899d1455..000000000 --- a/c_source_code/distortion/tifwrite.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef TIFWRITE_H -#define TIFWRITE_H -#include -#define MAX_MESSAGE (1024) -typedef struct mytiff_str{ - - u_int32_t wd; - u_int32_t ht; - u_int32_t bytes; - u_int32_t bits; - u_int32_t nbytes; - u_int32_t ndata; - u_int32_t stripnum; - u_int32_t stripsize; - u_int32_t * offsets; - u_int32_t * bytecounts; - u_int16_t mypage,npages; - int tiffno; - - char * data; - TIFF * tiffp; -} Mytiff; - -#ifndef TIFWRITE_C -extern int tifread(Mytiff * mytiff, const char * const filename); -extern int tifwrite(Mytiff * mytiff, const char * const filename); -extern int tifinit(Mytiff * mytiff, const char * const filename); -extern int tiffree(Mytiff * mytiff); -extern int tifgettags(Mytiff * mytiff); -extern int tifclose(Mytiff * mytiff); -int tifgetstripsdata(Mytiff * mytiff,char * buf); -#endif - -#endif /*TIFWRITE_H*/ - diff --git a/c_source_code/distortion/timestamp.c b/c_source_code/distortion/timestamp.c deleted file mode 100644 index f61a75143..000000000 --- a/c_source_code/distortion/timestamp.c +++ /dev/null @@ -1,112 +0,0 @@ -#include "timestamp.h" -#include "sys/time.h" - -FILE * logfp; -struct timeval mystime; -double oldtime=0; -static int loglevel=0; - - -int logprint(const char *const message,const int loglevel){ - int retval=0; - int myerror=0; - char outmessage[MAX_MESSAGE]; - snprintf(outmessage,MAX_MESSAGE,"timestamp.c:%s",message); - switch (loglevel){ - case(LEVEL_DEBUG): - pydebug(outmessage); - break; - case(LEVEL_INFO): - pyinfo(outmessage); - break; - - default: - /* fallthru */ - case(LEVEL_USER): - pyuser(outmessage); - break; - } - - //retval=fprintf(logfp,"%s",message); - - -// #ifdef FLUSH_LOG_FILE - if( fflush(logfp) == EOF ){ - myerror=errno; - fprintf(stderr,"ERROR: log file flush failed!\n"); - fprintf(stderr,"%s\n",strerror(myerror)); - return(151); - }; -//#endif -return(0); -} - - -void timestamp_open(const char * const logname){ - logfp=fopen(logname,"w"); -} - -void timestamp_close(void){ - fclose(logfp); -} - -void timestamp_init(){ - struct timeval now; - time_t etimes; - double nowtime,etime,itime; - suseconds_t etimeu; - char message[MAX_MESSAGE]; - - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - oldtime=nowtime; - itime=nowtime-oldtime; - snprintf(message,MAX_MESSAGE,"%f %f %f %s\n",etime,nowtime,itime,"time stamp reset"); - logprint(message,LEVEL_INFO); -} - -void timestamp(const char *const stampmsg,const int loglevel){ - struct timeval now; - time_t etimes; - double nowtime,etime,itime; - suseconds_t etimeu; - char message[MAX_MESSAGE]; - - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - itime=nowtime-oldtime; - snprintf(message,MAX_MESSAGE,"%f %f %f %s",etime,nowtime,itime,stampmsg); - logprint(message,loglevel); - oldtime=nowtime; -} - - -int errprint(const char * const message,const int loglevel){ - int retval; - /* print the message with the program name prefixed, and also echo to the log file */ - - if (logfp != NULL){ - retval=fprintf(logfp,"\n*****: %s\n",message); - } - - retval=fprintf(stderr,"%s\n",message); - return(retval); -} - -int vprint(const char * const message){ - int retval=0; - if (vflag != 0 ){ - printf("verbose %i: %s\n",vflag,message); - retval=fprintf(logfp,"%s\n",message); - } - return(retval); -} - - - diff --git a/c_source_code/distortion/timestamp.c.old b/c_source_code/distortion/timestamp.c.old deleted file mode 100644 index 33d4f31e6..000000000 --- a/c_source_code/distortion/timestamp.c.old +++ /dev/null @@ -1,110 +0,0 @@ -#include "timestamp.h" -#include "sys/time.h" -extern FILE * logfp; -static struct timeval mystime; -double oldtime=0; -#ifdef SAVU -extern char *allmessages[MAX_MESSAGE]; -#endif - - -#ifdef NOTYET_SAVU -int logprint(const char *const message){ - int retval=0; - int myerror=0; - //retval=fprintf(logfp,"%s",message); -return(0); -} -#else - -int logprint(const char *const message){ - int retval=0; - int myerror=0; - retval=fprintf(logfp,"%s",message); - -#ifdef FLUSH_LOG_FILE - if( fflush(logfp) == EOF ){ - myerror=errno; - fprintf(stderr,"ERROR: log file flush failed!\n"); - fprintf(stderr,"%s\n",strerror(myerror)); - return(151); - }; -#endif -return(0); -} -#endif /*NOTYET_SAVU*/ - - -void timestamp_open(const char * const logname){ - logfp=fopen(logname,"w"); -} - -void timestamp_close(void){ - fclose(logfp); -} - -void timestamp_init(){ - struct timeval now; - time_t etimes; - double nowtime,etime,itime; - suseconds_t etimeu; - char message[MAX_MESSAGE]; - - gettimeofday(&mystime,NULL); - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - oldtime=nowtime; - itime=nowtime-oldtime; - snprintf(message,MAX_MESSAGE,"%f %f %f %s\n",etime,nowtime,itime,"time stamp reset"); - logprint(message); -} - -void timestamp(const char *const stampmsg){ - struct timeval now; - time_t etimes; - double nowtime,etime,itime; - suseconds_t etimeu; - char message[MAX_MESSAGE]; - - gettimeofday(&now,NULL); - etimes = now.tv_sec - mystime.tv_sec; - etimeu = now.tv_usec - mystime.tv_usec; - etime = (double)(etimes)+((double)(etimeu))/(1e6); - nowtime=(double)(now.tv_sec) + ((double)(now.tv_usec) / 1.0e6); - itime=nowtime-oldtime; - snprintf(message,MAX_MESSAGE,"%f %f %f %s\n",etime,nowtime,itime,stampmsg); - logprint(message); - oldtime=nowtime; -} - - -int errprint(const char * const message){ - int retval; - /* print the message with the program name prefixed, and also echo to the log file */ - - if (logfp != NULL){ - retval=fprintf(logfp,"\n*****: %s\n",message); - } - -#ifdef SAVU - return(0); -#else - retval=fprintf(stderr,"%s\n",message); - return(retval); -#endif -} - -int vprint(const char * const message){ - int retval=0; - if (vflag != 0 ){ - printf("verbose %i: %s\n",vflag,message); - retval=fprintf(logfp,"%s\n",message); - } - return(retval); -} - - - diff --git a/c_source_code/distortion/timestamp.h b/c_source_code/distortion/timestamp.h deleted file mode 100644 index e63bcd38b..000000000 --- a/c_source_code/distortion/timestamp.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef TIMESTAMP_H -#define TIMESTAMP_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include "machine.h" -extern FILE * logfp; -//extern struct timeval mystime; -extern double oldtime; -extern unsigned char vflag; -extern int logprint(const char *const message,const int level); -extern void timestamp_init(void); -extern void timestamp_open(const char * const logname); -extern void timestamp_close(void); -extern void timestamp(const char *const stampmsg,const int level); -extern int errprint(const char * const message,const int level); -extern int vprint(const char * const message); -extern void pydebug(char * message); -extern void pyinfo(char * message); -extern void pyuser(char * message); - -#define LEVEL_DEBUG (0) -#define LEVEL_INFO (1) -#define LEVEL_USER (2) - -#ifdef __cplusplus -} -#endif - - -#endif /*TIMESAMP_H*/ diff --git a/c_source_code/distortion/unwarp.h b/c_source_code/distortion/unwarp.h deleted file mode 100644 index 331969e64..000000000 --- a/c_source_code/distortion/unwarp.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __PYX_HAVE__unwarp -#define __PYX_HAVE__unwarp - - -#ifndef __PYX_HAVE_API__unwarp - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(_T) _T -#endif - -__PYX_EXTERN_C DL_IMPORT(void) pydebug(char *); -__PYX_EXTERN_C DL_IMPORT(void) pyinfo(char *); -__PYX_EXTERN_C DL_IMPORT(void) pyuser(char *); - -#endif /* !__PYX_HAVE_API__unwarp */ - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initunwarp(void); -#else -PyMODINIT_FUNC PyInit_unwarp(void); -#endif - -#endif /* !__PYX_HAVE__unwarp */ diff --git a/c_source_code/distortion/unwarp.pyx b/c_source_code/distortion/unwarp.pyx deleted file mode 100644 index 85123ecdb..000000000 --- a/c_source_code/distortion/unwarp.pyx +++ /dev/null @@ -1,218 +0,0 @@ -# distutils: language = c++ -# distutils: sources = unwarp_functions.cpp timestamp.c -# distutils: define_macros='BITS32=1' 'SAVU=1' - -#$Id: unwarp.pyx 451 2016-01-04 15:08:19Z kny48981 $ - -import numpy as np -import logging -cimport numpy as np -cimport cunwarp - -cdef public void pydebug(char * message): - logging.debug(message) -cdef public void pyinfo(char * message): - logging.info(message) -cdef public void pyuser(char * message): - logging.log("USER",message) - - - -cdef cunwarp.Options ctrl -cdef unsigned int batchsize - -def logprint (*messages): - #print "unwarp.pyx (float): ", messages - pass - - - -def getversion(): - global ctrl - ctrl.versionflag=1 - cunwarp.runUnwarp(&ctrl,0,NULL,NULL) - -def setcoeff(a,b,c,d,e): - global ctrl - ctrl.acoeff=a - ctrl.bcoeff=b - ctrl.ccoeff=c - ctrl.dcoeff=d - ctrl.ecoeff=e - logprint("coefficients",a,b,c,d,e) - -def setctr(xc,yc): - ctrl.xcentre=xc - ctrl.ycentre=yc - logprint("centre",xc,yc) - -def setup(np.ndarray[np.float32_t,ndim=3,mode="c"] inarray,np.ndarray[np.float32_t,ndim=3,mode="c"] outarray,logfile="unwarp.log",versionflag=0): - global ctrl - cunwarp.timestamp_open(logfile) - cunwarp.timestamp_init() - ctrl.versionflag=0 - ctrl.pixelflag=1 - ctrl.f_call_num=0 - logprint ( "coercing array") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - ctrl.wd=inarray.shape[2] - ctrl.ht=inarray.shape[1] - batchsize=inarray.shape[0] - logprint( "calling c function -- setup" ) - logprint( "Input array batchsize %i height %i width %i "%(batchsize,ctrl.ht,ctrl.wd) ) - - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - -def run(np.ndarray[np.float32_t,ndim=3,mode="c"] inarray,np.ndarray[np.float32_t,ndim=3,mode="c"] outarray): - global ctrl - ctrl.versionflag=0 - ctrl.f_call_num=1 - batchsize=inarray.shape[0] - logprint ( "coercing arrays ") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - logprint("inarray shape",inarray.shape[0],inarray.shape[1],inarray.shape[2]) - #testval=inarray[0,100,100] - #logprint("testval",testval) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - -def cleanup(): - global ctrl - cunwarp.timestamp("unwarp cleanup",0); - ctrl.versionflag=0 - ctrl.f_call_num=2 - cunwarp.runUnwarp(&ctrl,1,NULL,NULL) - cunwarp.timestamp_close() - -''' -def setup(np.ndarray[np.float32_t,ndim=3,mode="c"] inarray,np.ndarray[np.float32_t,ndim=3,mode="c"] outarray,outlier_mu,npad,logfile="dezing.log",versionflag=0): #,bytes summary): - global ctrl - global batchsize - logprint ( "opening log file") - cunwarp.timestamp_open(logfile) - cunwarp.timestamp_init() - logprint ( "coercing array") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - - logprint ( "setting control flags") - ctrl.versionflag=versionflag - ctrl.outlier_mu=outlier_mu - ctrl.cropwd=inarray.shape[2] - ctrl.nlines=inarray.shape[1] - ctrl.npad=npad - batchsize=inarray.shape[0] - - ctrl.f_call_num=0 - - cunwarp.timestamp( "calling c function setup" ) - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, inbuf, outbuf) - pass - -def run(np.ndarray[np.float32_t,ndim=3,mode="c"] inarray,np.ndarray[np.float32_t,ndim=3,mode="c"] outarray): #,bytes summary): - global ctrl - global batchsize - - logprint ( "coercing arrays ") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - logprint ( "in unwarp.run: ctrl.cropwd is:" ,ctrl.cropwd, "batchsize is",batchsize) - - cunwarp.timestamp( "calling c function with run flag" ) - ctrl.f_call_num=1 - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - pass - - - -def cleanup(np.ndarray[np.float32_t,ndim=3,mode="c"] inarray,np.ndarray[np.float32_t,ndim=3,mode="c"] outarray): #,bytes summary): - global ctrl - global batchsize - logprint ( "coercing array") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - ctrl.f_call_num=2 - cunwarp.timestamp( "calling c function with cleanup flag" ) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - cunwarp.timestamp_close() - - - - - - - -def test_run(width=2550,length=2500,batchsize=100): - #cdef np.ndarray[np.float32_t,ndim=3] inarray =np.ones((width,length,batchsize),dtype=np.float32_t) - #cdef np.ndarray[np.float32_t,ndim=3] outarray =np.empty((width,length,batchsize),dtype=np.float32_t) - inarray =np.ones((width,length,batchsize),dtype=np.float32_t) - outarray =np.empty((width,length,batchsize),dtype=np.float32_t) - print "setting control flags" - ctrl.versionflag=0 - ctrl.outlier_mu=1.5 - ctrl.cropwd=width - ctrl.nlines=length - print "setting a test value at element 0" - inarray[0,0,0]=143 - print "creating random zingers" - xarray=np.random.random_integers(0,width-1,1000) - yarray=np.random.random_integers(0,length-1,1000) - print "applying random zingers" - for i in range(0,batchsize): - for d in range(0,len(xarray)): - xidx=xarray[d] - yidx=yarray[d] - inarray[xidx,yidx,i]=100*np.random.rand() - - print "getting slice of input" - in50=inarray[:,:,50] - print "setting inarray element 0 to %i"%inarray[0,0,0] - cunwarp.timestamp_open("test_run.log") - - - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - - ctrl.f_call_num=0 - print "calling c function setup" - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, inbuf, outbuf) - - ctrl.f_call_num=1 - print "calling c function" - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - - ctrl.f_call_num=2 - print "calling c function cleanup" - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - - - cunwarp.timestamp_close() - print "finished c function" - print "outarray element 0 is %i"%outarray[0,0,0] - out50=outarray[:,:,50] - return(in50,out50) - - - - -def test_data(): - cdef np.ndarray[np.float32_t,ndim=3] inarray =np.ones((50,100,15),dtype=np.float32_t) - cdef np.ndarray[np.float32_t,ndim=3] outarray =np.empty((50,100,15),dtype=np.float32_t) - ctrl.versionflag=2 - ctrl.outlier_mu=0.7 - ctrl.cropwd=50 - ctrl.nlines=100 - inarray[0,0,0]=143 - print "setting inarray element 0 to %i"%inarray[0,0,0] - print "calling c function" - cunwarp.timestamp("calling c function") - cunwarp.runUnwarp(&ctrl,15, inarray.data, outarray.data) - print "finished c function" - print "outarray element 0 is %i"%outarray[0,0,0] - -''' diff --git a/c_source_code/distortion/unwarp.so b/c_source_code/distortion/unwarp.so deleted file mode 100755 index eba6b65f1..000000000 Binary files a/c_source_code/distortion/unwarp.so and /dev/null differ diff --git a/c_source_code/distortion/unwarp_functions.cpp b/c_source_code/distortion/unwarp_functions.cpp deleted file mode 100644 index 1ec3add9c..000000000 --- a/c_source_code/distortion/unwarp_functions.cpp +++ /dev/null @@ -1,691 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "imagenorm.h" -#include "tifwrite.h" -#include "options.h" -#include "timestamp.h" -#define SVN_ID_UNWARP_FUNCTIONS_CPP "$Id: unwarp_functions.cpp 451 2016-01-04 15:08:19Z kny48981 $" - -#define F_SETUP (0) -#define F_RUN (1) -#define F_CLEANUP (2) -#ifdef SAVU -#define printf(...) -#endif - - -// -// some globals -unsigned char vflag = 0; /* flag for verbose output */ -const unsigned char True = 1; /* convenience values */ -const unsigned char False = 0; /* convenience values */ -FILE *logfp ; /* log file available anywhere */ -char *myname; /* convenience to store the name of the program */ - -extern double find_new_radius (double a, double b, double c, double d, double r); - -// extern void cuda_device_init (void); -/* this isn't the CUDA version */ - - -#ifdef BITS16 - typedef u_int16_t Pixeltype; -# warning BITS16 DEFINED -#elif defined BITS32 - - typedef float Pixeltype; -# warning BITS32 DEFINED - -#else -# error BITS NOT DEFINED -#endif - -#if defined(BITS16) && defined(BITS32) -#error BITS16 and BITS32 BOTH DEFINED! -#endif - -# define MINVAL (0); -# define MAXVAL (65535); - -# define MINVAL32 (-1e10); -# define MAXVAL32 (1e10); - -/* insert suitable values for other datatypes here .. */ - - - -#define DL (0) -#define DR (1) -#define UL (2) -#define UR (3) - -template < typename T > struct Warper{ - /* object to handle the optical distortion correction */ - float cx,cy; - u_int32_t wd,ht; - T * imagedat; - T *inputbuf,*outputbuf; - const static T valmin ; - const static T valmax ; - const static T outside = 0; - float aa,bb,cc,dd,ee; - typedef T mypixel; - - void setptr(u_int8_t * input, u_int8_t * output){ - inputbuf=(T *)(input); - outputbuf=(T *)(output); - } - - struct Interp_tab { - bool is_alloc; - int npix; - off_t * offsets; - off_t uroff,uloff,droff,dloff; - float * weights; - u_int8_t * is_outside; - - - Interp_tab(){ - is_alloc=0; - npix=0; - timestamp("Instantiated interpolation table",LEVEL_DEBUG); - } - - ~Interp_tab(){ - if (is_alloc == 1 ){ - free(offsets); - free(weights); - free(is_outside); - is_alloc=0; - npix=0; - } - //timestamp("Cleared interpolation table",LEVEL_DEBUG); - } - - - void allocate(int N){ - /* is the parameter being changed but already a table allocatedd? */ - if (is_alloc == 1 ){ - /* is the size being changed?*/ - if (npix !=N){ - free(offsets); - free(weights); - free(is_outside); - is_alloc=0; - } - } - - /* if only the parameter is changed don't reallocate */ - if(is_alloc == 0 ){ - npix=N; - offsets=(off_t *)calloc( 4*npix,sizeof(off_t)); - weights=(float *)calloc( 4*npix,sizeof(float)); - is_outside=(u_int8_t *)calloc( npix,sizeof(u_int8_t)); - - uroff=UR*npix; - uloff=UL*npix; - droff=DR*npix; - dloff=DL*npix; - - timestamp("Allocated interpolation table",LEVEL_DEBUG); - is_alloc=1; - } - } - } itab; - - void allocate_itab(){ - itab.allocate(wd*ht); - } - - - /* DEBUG_X */ - int thisx,thisy; - - Warper(){ - timestamp("Hello, world!",LEVEL_DEBUG); - - - }; - void helloworld(){ - timestamp("Hello, world!",LEVEL_DEBUG); - } - - - - /* trying ot be c++ style oriented .. access methods */ - void setheight(int newht){ - ht = newht; - }; - void setwidth(int newwd){ - wd = newwd; - }; - - void setdata(T * id){ - imagedat = id; - }; - - void setctr(float xxx, float yyy){ - cx = xxx; - cy = yyy; - }; - - void setcoeff(float a1, float a2, float a3,float a4,float a5){ - /* set the coefficients of a fifth order polynomial without constant*/ - aa=a1; - bb=a2; - cc=a3; - dd=a4; - ee=a5; - } - - float calcdist( float *x, float *y){ - return (sqrt(*x * *x + *y * *y)); - } - - float unwarpfunc(float * d){ - /* calculate the inverse polynomial of the suppled value (radius) */ - double result; - result=find_new_radius(aa,bb,cc,dd,*d); - - return (float)(result); - - }; - - - float warpfunc(float * d){ - /* calculate the polynomial of the suppled value (distance) */ - return aa + bb * *d + cc * *d * *d + dd * *d * *d * *d + ee * *d * *d * *d * *d; - }; - - void setup_itab(){ - /* bilinear interpolation function */ - char message[MAX_MESSAGE]; - int up,down,left,right; - off_t dloff,uloff,droff,uroff; - float dlval,drval,ulval,urval,uval,dval,val=0; - float dlweight,drweight,ulweight,urweight; - T retval; - float xp,yp; - unsigned int i,j,idx; - for (j=0;j< ht;j++){ - for (i=0;i= ht - || up < 0 || up >= ht - || left < 0 || left >= wd - || right < 0 || right >= wd){ - itab.is_outside[idx]=1; - }else{ - itab.is_outside[idx]=0; - } - - - /* calculate the offsets */ - itab.offsets[itab.uloff + idx] = wd * up + left; - itab.offsets[itab.uroff + idx] = wd * up + right; - itab.offsets[itab.dloff + idx] = wd * down + left; - itab.offsets[itab.droff + idx] = wd * down + right; - - /* calculate the weight factors */ - ulweight = ( right - xp ) * ( yp-down); - urweight = ( xp -left) * ( yp-down); - - dlweight = (right-xp) * (up-yp); - drweight = (xp-left) * (up-yp); - - itab.weights[itab.uloff + idx]=ulweight; - itab.weights[itab.uroff + idx]=urweight; - itab.weights[itab.dloff + idx]=dlweight; - itab.weights[itab.droff + idx]=drweight; - - if (ulweight < 0){ - snprintf(message,MAX_MESSAGE,"negative ulweight %i",idx); - errprint(message,LEVEL_USER); - } - if (urweight < 0){ - snprintf(message,MAX_MESSAGE,"negative urweight %i",idx); - errprint(message,LEVEL_USER); - } - if (dlweight < 0){ - snprintf(message,MAX_MESSAGE,"negative dlweight %i",idx); - errprint(message,LEVEL_USER); - } - if (drweight < 0){ - snprintf(message,MAX_MESSAGE,"negative drweight %i",idx); - errprint(message,LEVEL_USER); - } - } - } - - - }; - - - void dowarp_by_table(T * outimage){ - /* apply the distortion function to all pixels */ - unsigned int i,j,idx; - float ulweight,urweight,dlweight,drweight; - float ulval,urval,dlval,drval; - float val; - T newval; - static int debug_ctr=0; - for (j=0;j< ht;j++){ - for (i=0;i (float)valmax){ - newval = valmax; - } else if (val < (float)valmin) { - newval = valmin; - }else{ - newval = (T)(val); - } - } - - *(outimage + idx)=newval; - - } - } - }; - - void dowarp(T * outimage){ - /* apply the distortion function to all pixels */ - unsigned int i; - unsigned int j; - float xprime,yprime; - T newval; - - for (j=0;j< ht;j++){ - for (i=0;i= ht - || up < 0 || up >= ht - || left < 0 || left >= wd - || right < 0 || right >= wd){ - return(outside); - } - - /* interpolate in floating point*/ - - /* - dloff = wd * down + left; - uloff = wd * up + left; - droff = wd * down + right; - uroff = wd * up + right; - */ - - dlval = *(imagedat + wd * down + left); - ulval = *(imagedat + wd * up + left); - drval = *(imagedat + wd * down + right); - urval = *(imagedat + wd * up + right); - - uval = ulval + (*xp - left) * (urval - ulval); - - dval = dlval + (*xp - left) * (drval - dlval); - val = dval + (*yp -down) * (uval - dval); - - /* check the bounds of the value */ - - if (val > (float)valmax) retval = valmax; - - else if (val < (float)valmin) retval = valmin; - - /* cast to the template type */ - else retval = (T) val; - return(retval); - - }; -}; - - -/* create an object of the image warper , over the specified pixel datatype */ -typedef Warper Warpertype; - - template <> const u_int16_t Warper::valmin = MINVAL; - template <> const u_int16_t Warper::valmax = MAXVAL; - - template <> const float Warper::valmin = MINVAL32; - template <> const float Warper::valmax = MAXVAL32; - -void runUnwarp(Options * ctrlp, unsigned int thisbatch,unsigned char *inbuf, unsigned char * outbuf){ - Pixeltype *h_data=NULL,*h_final=NULL; - static Warpertype warper; - static u_int32_t npixels; - static int iter=0; - char message[MAX_MESSAGE]; - - //printf("mypixel size %i\n",sizeof(Warpertype::mypixel)); - - static unsigned char setupflag=0; - u_int32_t slice=0; - - - snprintf(message,MAX_MESSAGE,"calling %s",__func__); - timestamp(message,LEVEL_INFO); - - snprintf(message,MAX_MESSAGE,"versionflag: %hhu",ctrlp->versionflag); - timestamp(message,LEVEL_INFO); - - snprintf(message,MAX_MESSAGE,"pixelflag: %hhu",ctrlp->pixelflag); - timestamp(message,LEVEL_INFO); - - snprintf(message,MAX_MESSAGE,"f_call_num: %hhu",ctrlp->f_call_num); - timestamp(message,LEVEL_INFO); - - //warper.helloworld(); - - switch(ctrlp->f_call_num) { - - case (F_SETUP): - snprintf(message,MAX_MESSAGE,"calling %s for setup",__func__); - timestamp(message,LEVEL_USER); - - //fprintf(stderr,"C++: Running setup %i %i \n",ctrlp->ht,ctrlp->wd); - timestamp("C++: Running setup",LEVEL_DEBUG); - snprintf(message,MAX_MESSAGE,"C++: ht= %i wd= %i",ctrlp->ht,ctrlp->wd); - timestamp(message,LEVEL_DEBUG); - - warper.setheight(ctrlp->ht); - warper.setwidth(ctrlp->wd); - warper.allocate_itab(); - warper.setctr(ctrlp->xcentre,ctrlp->ycentre); - warper.setcoeff(ctrlp->acoeff,ctrlp->bcoeff,ctrlp->ccoeff,ctrlp->dcoeff,ctrlp->ecoeff); - - timestamp("C++: Running setup_itab",LEVEL_DEBUG); - warper.setup_itab(); - - npixels=ctrlp->ht * ctrlp->wd; - - snprintf(message,MAX_MESSAGE,"npixels = %u",npixels); - timestamp(message,LEVEL_DEBUG); - snprintf(message,MAX_MESSAGE,"testval = %li",(long int)(warper.itab.offsets[0])); - timestamp(message,LEVEL_DEBUG); - - setupflag=1; - timestamp("C++: Finished setup_itab",LEVEL_DEBUG); - break; - - case (F_RUN): - snprintf(message,MAX_MESSAGE,"C++: running unwarp chunk ht= %i wd= %i batch=%i iter=%i",ctrlp->ht,ctrlp->wd,thisbatch,iter); timestamp("C++: running unwarp chunk",LEVEL_DEBUG); - timestamp(message,LEVEL_USER); - snprintf(message,MAX_MESSAGE,"Running unwarp for %u slices ",thisbatch); - timestamp(message,LEVEL_DEBUG); - snprintf(message,MAX_MESSAGE,"npixels = %u",npixels); - timestamp(message,LEVEL_DEBUG); - snprintf(message,MAX_MESSAGE,"testval = %li",(long int)(warper.itab.offsets[0])); - timestamp(message,LEVEL_DEBUG); - snprintf(message,MAX_MESSAGE,"testout = %hhu",warper.itab.is_outside[0]); - timestamp(message,LEVEL_DEBUG); - - if (setupflag == 0 ){ - fprintf(stderr,"ERROR: setup has not been called! \n"); - return; - } - - - h_data=(Pixeltype *)(inbuf); - h_final=(Pixeltype *)(outbuf); - -#ifndef SAVU - { - static int testout=0; - FILE * testoutp; - if (testout == 0 ){ - testoutp=fopen("testout.raw","w"); - fwrite(h_data,sizeof(Pixeltype),npixels*thisbatch,testoutp); - fclose(testoutp); - testout=1; - } - } -#endif - - - warper.setptr(inbuf,outbuf); - - for (slice=0; slice < thisbatch; slice++){ - warper.setdata(warper.inputbuf + slice * npixels ); - warper.dowarp_by_table(warper.outputbuf + slice * npixels ); - } - timestamp("C++: finished unwarp chunk ",LEVEL_DEBUG); - iter++; - - break; - - case(F_CLEANUP): - snprintf(message,MAX_MESSAGE,"calling %s for cleanup",__func__); - timestamp(message,LEVEL_USER); - break; - } - - snprintf(message,MAX_MESSAGE,"returning from %s",__func__); - timestamp(message,LEVEL_USER); - -} - -#ifdef CMAIN -//////////////////////////////////////////////////////////////////////////////// -// Main program -//////////////////////////////////////////////////////////////////////////////// -int main (int argc, char **argv) { - Pixeltype *h_data; - char *h_byte; - Pixeltype *h_final; - size_t totalblocks; - float dval, sdev, floatdif; - double difsq, sdev2; - char *infile, *outfile, *fmtstring; - size_t datasize; - Mytiff mytiff; - int inflag = 0, outflag = 0; - int i,slice; - int firstRun = 1; // Indicates if it's the first execution of the for loop - int dataAmount; - int pret; - float stats[4]; - Options ctrl; - Warpertype warper; - -#ifdef DEBUGBLOCK - // cuda_device_init (); -#endif - - myname = basename (strdup (argv[0])); - //printf ("argc: %i\n", argc); - - mytiff.wd = 0; - mytiff.ht = 0; - mytiff.bytes = 0; - mytiff.bits = 0; - -// parse command line arguments - - pret=parseopts (argc, argv, &ctrl); - - if (pret != 0 ){ - printf("Exiting ... \n"); - return(pret); - } - - fmtstring = (char *) calloc (PATH_MAX, sizeof (char)); - infile = (char *) calloc (PATH_MAX, sizeof (char)); - outfile = (char *) calloc (PATH_MAX, sizeof (char)); - -//read first file to get the size - snprintf (fmtstring, PATH_MAX, "%s/%s", ctrl.indir, ctrl.infmt); - snprintf (infile, PATH_MAX, fmtstring, ctrl.firstslice); - tifread (&mytiff, infile); - datasize = mytiff.ht * mytiff.wd; - dataAmount = datasize; - //printf ("using file %s\n", infile); - // - h_data = (Pixeltype *) calloc (datasize, sizeof (Pixeltype)); - h_byte = (char *) h_data; - h_final = (Pixeltype * ) calloc (datasize, sizeof (Pixeltype )); - - - for (slice=ctrl.firstslice;slice <=ctrl.lastslice;slice++){ - snprintf (fmtstring, PATH_MAX, "%s/%s", ctrl.indir, ctrl.infmt); - snprintf (infile, PATH_MAX, fmtstring, slice); - //printf ("using file %s\n", infile); - - snprintf (fmtstring, PATH_MAX, "%s/%s", ctrl.outdir, ctrl.outfmt); - snprintf (outfile, PATH_MAX, fmtstring, slice); - //printf ("using output file %s\n", outfile); - inflag = 1; - outflag = 1; - - tifread (&mytiff, infile); - - datasize = mytiff.ht * mytiff.wd; - dataAmount = datasize; - //tifclose (&mytiff); - - //printf ("Initializing data...\n"); - - - size_t nread = 0; - - //printf ("Reading %lu bytes from %s ... \n", datasize * sizeof (float), infile); - tifread (&mytiff, infile); - tifgetstripsdata (&mytiff, h_byte); - - //printf ("first data value = %e \n\n", h_data[0]); - - warper.settiff(&mytiff); - warper.setdata(h_data); - warper.setctr(ctrl.xcentre,ctrl.ycentre); - warper.setcoeff(ctrl.acoeff,ctrl.bcoeff,ctrl.ccoeff,ctrl.dcoeff,ctrl.ecoeff); - warper.dowarp(h_final); - - - if (outflag == 1) { - Mytiff outtiff; - int retval = 0; - int nwritten = 0; - int i; - - //printf ("Writing %lu to %s\n", datasize, outfile); - outtiff.wd = mytiff.wd; - outtiff.ht = mytiff.ht; - outtiff.bytes = 2; - - retval = tifinit (&outtiff, outfile); - - if (retval != 0) { - fprintf (stderr, "%s: problem with tiff file init of %s\n", argv[0], outfile); - fprintf (stderr, "%s: %s: %i: returning %i\n", myname, __func__, __LINE__, retval); - return (retval); - } - - outtiff.data = (char *) (h_final); - tifwrite (&outtiff, outfile); - - } else { - printf ("write results not selected\n"); - } - } - //printf ("Cleaning up...\n"); - tifclose (&mytiff); - free (h_data); - free (h_final); - return (0); -} -#endif /*CMAIN*/ diff --git a/c_source_code/distortion/unwarp_functions.h b/c_source_code/distortion/unwarp_functions.h deleted file mode 100644 index 9cca8ae64..000000000 --- a/c_source_code/distortion/unwarp_functions.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef UNWARP_FUNCTIONS_H -#define UNWARP_FUNCTIONS_H -#define SVN_ID_UNWARP_FUNCTIONS_CPP "$Id: unwarp_functions.h 402 2015-10-07 10:48:04Z kny48981 $" -#include "options.h" -void runUnwarp(Options * ctrlp,unsigned int thisbatch, unsigned char *inbuf, unsigned char * outbuf); -#endif diff --git a/c_source_code/distortion/unwarp_h5.py b/c_source_code/distortion/unwarp_h5.py deleted file mode 100644 index f1637171b..000000000 --- a/c_source_code/distortion/unwarp_h5.py +++ /dev/null @@ -1,159 +0,0 @@ -import unwarpint16 as unwarp -import tifffile -import numpy as np -import sys -import h5py - -def read_image_set(data,pstart=0,pstop=50,npad=2): - padstart=True - padend=True - print data.shape - intype=data.dtype - sidx=pstart - eidx=pstop - - #check for the chunk being at the very beginnning or end of the whole stack - - if (pstart >=npad): - sidx=pstart - npad - padstart=False - if (pstop < data.shape[0]-npad): - eidx=pstop+npad - padend=False - - #pad the very start - if padstart: - spadarray=np.empty((npad,data.shape[1],data.shape[2]),dtype=intype) - for i in range(0,npad): - print (pstart+npad-i),"->",i - np.copyto(spadarray[i,:,:],data[pstart+npad-i]) - - #pad the very end - if padend: - epadarray=np.empty((npad,data.shape[1],data.shape[2]),dtype=intype) - for i in range(0,npad): - print (pstop-i),"->",i - np.copyto(epadarray[i,:,:],data[pstop-i]) - - dset=data[sidx:eidx,:,:] - print dset.shape - - #concatenate the very beginning and/or very end padding - outarray=dset - if (padstart or padend): - if padstart: - print ("Padding start") - outarray=np.vstack((spadarray,outarray)) - - if padend: - print ("Padding end") - outarray=np.vstack((outarray,epadarray)) - - print outarray.shape - return(np.ascontiguousarray(outarray)) - - -def main(): - slabsize=4 - h5chunksize=4 - if len(sys.argv) <= 4 : - print " " - print sys.argv[0] - print "USAGE: %s h5file chunkstart chunkstop h5outputfile "%sys.argv[0] - print "chunk must not be smaller than %i projections"%h5chunksize - sys.exit(0) - npad=0 # should be 0 - input=sys.argv[1] #first argument, filename of h5 file , should contain /entry/instrument/detector/data and be uint16 - chunkstart=int(sys.argv[2]) # the start of the chunk (without padding) - chunkstop=int(sys.argv[3]) #the end of the chunk (without padding) - outname=sys.argv[4] #the output file - - - infp=h5py.File(input) - #data=infp['/entry/instrument/detector/data'] - data=infp['/entry1/tomo_entry/data/data'] - - chunksize=chunkstop-chunkstart - nslabs = int(chunksize/slabsize) - - h5outp=h5py.File(outname,"w") - outgrp=h5outp.create_group("/entry1/tomo_entry/data") - outdset=outgrp.create_dataset("data",(chunksize,data.shape[1],data.shape[2]),chunks=(h5chunksize,h5chunksize,data.shape[2])) - - print "nslabs=%i"%nslabs - lastslabsize=chunksize-(nslabs*slabsize) - print "lastslabsize=%i"%lastslabsize - #set the coefficients -- this coudl be rolled into setup with additional args? - #unwarp.setcoeff(1,-1e-3,-6e-7,5e-10,-4e-13) #fisheye test - #unwarp.setctr(500,1000) #fisheye test - #unwarp.setcoeff(1,0,0,0,0) - unwarp.setcoeff(1.00015076,1.9289e-6,-2.4325e-8,1.00439e-11,-3.99352e-15) - unwarp.setctr(1283.25,data.shape[1]-1164.765) - - outim=np.empty((slabsize+2*npad,data.shape[1],data.shape[2]),dtype=np.uint16) #create an empty array , the program will fill it up - - firststop=chunkstart+slabsize - instack=read_image_set(data,chunkstart,firststop,npad) #npad is optional, default is 2 - unwarp.setup(instack,outim) #call the program to initialize the arrays - - for slab in range(nslabs): - print "SLAB %i of %i"%(slab,nslabs) - slabstart=slab*slabsize - slabstop=slabstart+slabsize - instack=read_image_set(data,slabstart,slabstop,npad) #npad is optional, default is 2 - unwarp.run(instack,outim) #could call again with a different instack before cleaning up, if it is teh same size - - - - output=outim[npad:outim.shape[0]-npad] #discard the padded area - for slice in range(slabstart,slabstop): - tifffile.imsave("/dls/i12/data/2015/cm12163-5/tmp/out_%05d.tif"%slice,outim[slice-slabstart]) #example, save the chunk - - outdset[slabstart-chunkstart:slabstop-chunkstart,:,:]=output - - - unwarp.cleanup() #call the program to de-allocate the arrays - - #now the last slab - if lastslabsize > 0: - - outim=np.empty((lastslabsize+2*npad,data.shape[1],data.shape[2]),dtype=np.uint16) #create an empty array , the program will fill it up - print "last outim shape",outim.shape - - laststart=chunkstart+nslabs*slabsize - slabstart=laststart - slabstop=chunkstop - - instack=read_image_set(data,slabstart,slabstop,npad) #npad is optional, default is 2 - - unwarp.setup(instack,outim) #call the program to initialize the arrays - unwarp.run(instack,outim) #could call again with a different instack before cleaning up, if it is teh same size - - output=outim[npad:outim.shape[0]-npad] #discard the padded area - for slice in range(slabstart,slabstop): - tifffile.imsave("/dls/i12/data/2015/cm12163-5/tmp/out_%05d.tif"%slice,outim[slice-slabstart]) #example, save the chunk - - print "slabstart=",slabstart, "slabstop=",slabstop - print "output shape",output.shape - print "outdset shape",outdset.shape - print "chunksize",chunksize - outdset[slabstart-chunkstart:slabstop-chunkstart,:,:]=output - - unwarp.cleanup() #call the program to de-allocate the arrays - - rot=infp[ "/entry1/tomo_entry/data/rotation_angle"] - key=infp["/entry1/tomo_entry/instrument/detector/image_key"] - - outrot=h5outp.create_dataset("/entry1/tomo_entry/data/rotation_angle",data=rot[chunkstart:chunkstop]) - outkey=h5outp.create_dataset("/entry1/tomo_entry/instrument/detector/image_key",data=key[chunkstart:chunkstop]) - - h5outp.close() - - - - - - -if __name__ == "__main__": - print "Running main procedure" - main() diff --git a/c_source_code/distortion/unwarpint16.pyx b/c_source_code/distortion/unwarpint16.pyx deleted file mode 100644 index 4887be692..000000000 --- a/c_source_code/distortion/unwarpint16.pyx +++ /dev/null @@ -1,203 +0,0 @@ -# distutils: language = c++ -# distutils: sources = unwarp_functions.cpp timestamp.c -# distutils: define_macros='BITS16=1' 'SAVU=1' - -#$Id: unwarpint16.pyx 450 2015-12-18 19:53:23Z kny48981 $ - -import numpy as np -cimport numpy as np -cimport cunwarp - - -cdef cunwarp.Options ctrl -cdef unsigned int batchsize - -def logprint (*messages): - print "unwarpint16.pyx: ", messages - pass - - - -def getversion(): - global ctrl - ctrl.versionflag=1 - cunwarp.runUnwarp(&ctrl,0,NULL,NULL) - -def setcoeff(a,b,c,d,e): - global ctrl - ctrl.acoeff=a - ctrl.bcoeff=b - ctrl.ccoeff=c - ctrl.dcoeff=d - ctrl.ecoeff=e - -def setctr(xc,yc): - ctrl.xcentre=xc - ctrl.ycentre=yc - -def setup(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray,logfile="unwarp.log",versionflag=0): - global ctrl - cunwarp.timestamp_open(logfile) - cunwarp.timestamp_init() - ctrl.versionflag=0 - ctrl.pixelflag=0 - ctrl.f_call_num=0 - logprint ( "coercing array") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - ctrl.wd=inarray.shape[2] - ctrl.ht=inarray.shape[1] - batchsize=inarray.shape[0] - cunwarp.timestamp( "calling c function -- setup" ) - cunwarp.timestamp( "Input array batchsize %i height %i width %i "%(batchsize,ctrl.ht,ctrl.wd) ) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - -def run(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray): - global ctrl - ctrl.versionflag=0 - ctrl.f_call_num=1 - batchsize=inarray.shape[0] - logprint ( "coercing arrays ") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - -def cleanup(): - global ctrl - cunwarp.timestamp("unwarp cleanup"); - ctrl.versionflag=0 - ctrl.f_call_num=2 - cunwarp.runUnwarp(&ctrl,1,NULL,NULL) - cunwarp.timestamp_close() - -''' -def setup(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray,outlier_mu,npad,logfile="dezing.log",versionflag=0): #,bytes summary): - global ctrl - global batchsize - logprint ( "opening log file") - cunwarp.timestamp_open(logfile) - cunwarp.timestamp_init() - logprint ( "coercing array") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - - logprint ( "setting control flags") - ctrl.versionflag=versionflag - ctrl.outlier_mu=outlier_mu - ctrl.cropwd=inarray.shape[2] - ctrl.nlines=inarray.shape[1] - ctrl.npad=npad - batchsize=inarray.shape[0] - - ctrl.f_call_num=0 - - cunwarp.timestamp( "calling c function setup" ) - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, inbuf, outbuf) - pass - -def run(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray): #,bytes summary): - global ctrl - global batchsize - - logprint ( "coercing arrays ") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - logprint ( "in unwarp.run: ctrl.cropwd is:" ,ctrl.cropwd, "batchsize is",batchsize) - - cunwarp.timestamp( "calling c function with run flag" ) - ctrl.f_call_num=1 - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - pass - - - -def cleanup(np.ndarray[np.uint16_t,ndim=3,mode="c"] inarray,np.ndarray[np.uint16_t,ndim=3,mode="c"] outarray): #,bytes summary): - global ctrl - global batchsize - logprint ( "coercing array") - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - ctrl.f_call_num=2 - cunwarp.timestamp( "calling c function with cleanup flag" ) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - cunwarp.timestamp_close() - - - - - - - -def test_run(width=2550,length=2500,batchsize=100): - #cdef np.ndarray[np.uint16_t,ndim=3] inarray =np.ones((width,length,batchsize),dtype=np.uint16) - #cdef np.ndarray[np.uint16_t,ndim=3] outarray =np.empty((width,length,batchsize),dtype=np.uint16) - inarray =np.ones((width,length,batchsize),dtype=np.uint16) - outarray =np.empty((width,length,batchsize),dtype=np.uint16) - print "setting control flags" - ctrl.versionflag=0 - ctrl.outlier_mu=1.5 - ctrl.cropwd=width - ctrl.nlines=length - print "setting a test value at element 0" - inarray[0,0,0]=143 - print "creating random zingers" - xarray=np.random.random_integers(0,width-1,1000) - yarray=np.random.random_integers(0,length-1,1000) - print "applying random zingers" - for i in range(0,batchsize): - for d in range(0,len(xarray)): - xidx=xarray[d] - yidx=yarray[d] - inarray[xidx,yidx,i]=100*np.random.rand() - - print "getting slice of input" - in50=inarray[:,:,50] - print "setting inarray element 0 to %i"%inarray[0,0,0] - cunwarp.timestamp_open("test_run.log") - - - inbuf=np.PyArray_DATA(inarray) - outbuf=np.PyArray_DATA(outarray) - - ctrl.f_call_num=0 - print "calling c function setup" - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, inbuf, outbuf) - - ctrl.f_call_num=1 - print "calling c function" - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - - ctrl.f_call_num=2 - print "calling c function cleanup" - #cunwarp.runUnwarp(&ctrl,batchsize, inarray.data, outarray.data) - cunwarp.runUnwarp(&ctrl,batchsize, np.PyArray_DATA(inarray), np.PyArray_DATA(outarray)) - - - cunwarp.timestamp_close() - print "finished c function" - print "outarray element 0 is %i"%outarray[0,0,0] - out50=outarray[:,:,50] - return(in50,out50) - - - - -def test_data(): - cdef np.ndarray[np.uint16_t,ndim=3] inarray =np.ones((50,100,15),dtype=np.uint16) - cdef np.ndarray[np.uint16_t,ndim=3] outarray =np.empty((50,100,15),dtype=np.uint16) - ctrl.versionflag=2 - ctrl.outlier_mu=0.7 - ctrl.cropwd=50 - ctrl.nlines=100 - inarray[0,0,0]=143 - print "setting inarray element 0 to %i"%inarray[0,0,0] - print "calling c function" - cunwarp.timestamp("calling c function") - cunwarp.runUnwarp(&ctrl,15, inarray.data, outarray.data) - print "finished c function" - print "outarray element 0 is %i"%outarray[0,0,0] - -''' diff --git a/doc/source/api/plugin_examples.example_median_filter.rst b/doc/source/api/plugin_examples.example_median_filter.rst index a17c4dfeb..b76d4f114 100644 --- a/doc/source/api/plugin_examples.example_median_filter.rst +++ b/doc/source/api/plugin_examples.example_median_filter.rst @@ -2,7 +2,7 @@ plugin\_examples.example\_median\_filter module =============================================== .. automodule:: plugin_examples.example_median_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template1.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template1.rst new file mode 100644 index 000000000..4bda1f676 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template1.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template1 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template1 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template10.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template10.rst new file mode 100644 index 000000000..c30128064 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template10.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template10 module +==================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template10 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes.rst new file mode 100644 index 000000000..129654f5e --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template1\_with\_detailed\_notes module +========================================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template2.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template2.rst new file mode 100644 index 000000000..9418d2218 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template2.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template2 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template2 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template3.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template3.rst new file mode 100644 index 000000000..9c3075d20 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template3.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template3 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template3 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template4.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template4.rst new file mode 100644 index 000000000..ec8b01fc4 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template4.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template4 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template4 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template5.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template5.rst new file mode 100644 index 000000000..4149d1fcd --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template5.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template5 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template5 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template6.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template6.rst new file mode 100644 index 000000000..aa5f9aded --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template6.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template6 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template6 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template7.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template7.rst new file mode 100644 index 000000000..6289fc1f5 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template7.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template7 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template7 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template8.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template8.rst new file mode 100644 index 000000000..74fce2e29 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template8.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template8 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template8 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.plugin_template9.rst b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template9.rst new file mode 100644 index 000000000..f5c11c83a --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.plugin_template9.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.general.plugin\_template9 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template9 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.general.rst b/doc/source/api/plugin_examples.plugin_templates.general.rst new file mode 100644 index 000000000..712fecbec --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.general.rst @@ -0,0 +1,26 @@ +plugin\_examples.plugin\_templates.general package +================================================== + +.. automodule:: plugin_examples.plugin_templates.general + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates.general.plugin_template1 + plugin_examples.plugin_templates.general.plugin_template10 + plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes + plugin_examples.plugin_templates.general.plugin_template2 + plugin_examples.plugin_templates.general.plugin_template3 + plugin_examples.plugin_templates.general.plugin_template4 + plugin_examples.plugin_templates.general.plugin_template5 + plugin_examples.plugin_templates.general.plugin_template6 + plugin_examples.plugin_templates.general.plugin_template7 + plugin_examples.plugin_templates.general.plugin_template8 + plugin_examples.plugin_templates.general.plugin_template9 diff --git a/doc/source/api/plugin_examples.plugin_templates.iterative.rst b/doc/source/api/plugin_examples.plugin_templates.iterative.rst new file mode 100644 index 000000000..ea46360f2 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.iterative.rst @@ -0,0 +1,19 @@ +plugin\_examples.plugin\_templates.iterative package +==================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates.iterative.testing_iterative_plugin + plugin_examples.plugin_templates.iterative.testing_iterative_plugin2 + plugin_examples.plugin_templates.iterative.testing_iterative_plugin3 + plugin_examples.plugin_templates.iterative.testing_iterative_plugin4 diff --git a/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin.rst b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin.rst new file mode 100644 index 000000000..f26590c8f --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin module +============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin2.rst b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin2.rst new file mode 100644 index 000000000..fda4d9061 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin2.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin2 module +=============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin2 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin3.rst b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin3.rst new file mode 100644 index 000000000..c97b20273 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin3.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin3 module +=============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin3 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin4.rst b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin4.rst new file mode 100644 index 000000000..944d39368 --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.iterative.testing_iterative_plugin4.rst @@ -0,0 +1,8 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin4 module +=============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin4 + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/plugin_examples.plugin_templates.rst b/doc/source/api/plugin_examples.plugin_templates.rst new file mode 100644 index 000000000..a3a4613aa --- /dev/null +++ b/doc/source/api/plugin_examples.plugin_templates.rst @@ -0,0 +1,17 @@ +plugin\_examples.plugin\_templates package +========================================== + +.. automodule:: plugin_examples.plugin_templates + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates.general + plugin_examples.plugin_templates.iterative diff --git a/doc/source/api/plugin_examples.rst b/doc/source/api/plugin_examples.rst index e9ef04342..bc0178e56 100644 --- a/doc/source/api/plugin_examples.rst +++ b/doc/source/api/plugin_examples.rst @@ -2,15 +2,23 @@ plugin\_examples package ======================== .. automodule:: plugin_examples - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates Submodules ---------- .. toctree:: + :maxdepth: 4 plugin_examples.example_median_filter - diff --git a/doc/source/api/savu.core.basic_plugin_runner.rst b/doc/source/api/savu.core.basic_plugin_runner.rst index a62d66189..e26416895 100644 --- a/doc/source/api/savu.core.basic_plugin_runner.rst +++ b/doc/source/api/savu.core.basic_plugin_runner.rst @@ -2,7 +2,7 @@ savu.core.basic\_plugin\_runner module ====================================== .. automodule:: savu.core.basic_plugin_runner - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.checkpointing.rst b/doc/source/api/savu.core.checkpointing.rst index 61cce7430..5e29adb9f 100644 --- a/doc/source/api/savu.core.checkpointing.rst +++ b/doc/source/api/savu.core.checkpointing.rst @@ -2,7 +2,7 @@ savu.core.checkpointing module ============================== .. automodule:: savu.core.checkpointing - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.plugin_runner.rst b/doc/source/api/savu.core.plugin_runner.rst index be8be1c67..b97bb4acf 100644 --- a/doc/source/api/savu.core.plugin_runner.rst +++ b/doc/source/api/savu.core.plugin_runner.rst @@ -2,7 +2,7 @@ savu.core.plugin\_runner module =============================== .. automodule:: savu.core.plugin_runner - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.rst b/doc/source/api/savu.core.rst index f49120708..fbe72177c 100644 --- a/doc/source/api/savu.core.rst +++ b/doc/source/api/savu.core.rst @@ -2,26 +2,27 @@ savu.core package ================= .. automodule:: savu.core - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.core.transports + savu.core.transports Submodules ---------- .. toctree:: + :maxdepth: 4 savu.core.basic_plugin_runner savu.core.checkpointing savu.core.plugin_runner savu.core.transport_setup savu.core.utils - diff --git a/doc/source/api/savu.core.transport_setup.rst b/doc/source/api/savu.core.transport_setup.rst index ba853bfd8..e4ea34147 100644 --- a/doc/source/api/savu.core.transport_setup.rst +++ b/doc/source/api/savu.core.transport_setup.rst @@ -2,7 +2,7 @@ savu.core.transport\_setup module ================================= .. automodule:: savu.core.transport_setup - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.transports.base_transport.rst b/doc/source/api/savu.core.transports.base_transport.rst index 591641ee3..5decdeb0d 100644 --- a/doc/source/api/savu.core.transports.base_transport.rst +++ b/doc/source/api/savu.core.transports.base_transport.rst @@ -2,7 +2,7 @@ savu.core.transports.base\_transport module =========================================== .. automodule:: savu.core.transports.base_transport - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.transports.basic_transport.rst b/doc/source/api/savu.core.transports.basic_transport.rst index ca2d95999..dc9783306 100644 --- a/doc/source/api/savu.core.transports.basic_transport.rst +++ b/doc/source/api/savu.core.transports.basic_transport.rst @@ -2,7 +2,7 @@ savu.core.transports.basic\_transport module ============================================ .. automodule:: savu.core.transports.basic_transport - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.transports.dosna_transport.rst b/doc/source/api/savu.core.transports.dosna_transport.rst index fd4121539..f1f00ff05 100644 --- a/doc/source/api/savu.core.transports.dosna_transport.rst +++ b/doc/source/api/savu.core.transports.dosna_transport.rst @@ -2,7 +2,7 @@ savu.core.transports.dosna\_transport module ============================================ .. automodule:: savu.core.transports.dosna_transport - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.transports.hdf5_transport.rst b/doc/source/api/savu.core.transports.hdf5_transport.rst index d40dc44ce..8e3f1adeb 100644 --- a/doc/source/api/savu.core.transports.hdf5_transport.rst +++ b/doc/source/api/savu.core.transports.hdf5_transport.rst @@ -2,7 +2,7 @@ savu.core.transports.hdf5\_transport module =========================================== .. automodule:: savu.core.transports.hdf5_transport - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.core.transports.rst b/doc/source/api/savu.core.transports.rst index bffd4b44f..2712c1e17 100644 --- a/doc/source/api/savu.core.transports.rst +++ b/doc/source/api/savu.core.transports.rst @@ -2,18 +2,18 @@ savu.core.transports package ============================ .. automodule:: savu.core.transports - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.core.transports.base_transport savu.core.transports.basic_transport savu.core.transports.dosna_transport savu.core.transports.hdf5_transport - diff --git a/doc/source/api/savu.core.utils.rst b/doc/source/api/savu.core.utils.rst index 125be07fc..e9c0d387f 100644 --- a/doc/source/api/savu.core.utils.rst +++ b/doc/source/api/savu.core.utils.rst @@ -2,7 +2,7 @@ savu.core.utils module ====================== .. automodule:: savu.core.utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.chunking.rst b/doc/source/api/savu.data.chunking.rst index c8ec5b5c5..8411551bb 100644 --- a/doc/source/api/savu.data.chunking.rst +++ b/doc/source/api/savu.data.chunking.rst @@ -2,7 +2,7 @@ savu.data.chunking module ========================= .. automodule:: savu.data.chunking - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data.rst b/doc/source/api/savu.data.data_structures.data.rst index e1228338e..cd273a8f0 100644 --- a/doc/source/api/savu.data.data_structures.data.rst +++ b/doc/source/api/savu.data.data_structures.data.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data module ====================================== .. automodule:: savu.data.data_structures.data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_add_ons.rst b/doc/source/api/savu.data.data_structures.data_add_ons.rst index 8c60668c7..d513f2292 100644 --- a/doc/source/api/savu.data.data_structures.data_add_ons.rst +++ b/doc/source/api/savu.data.data_structures.data_add_ons.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_add\_ons module ================================================ .. automodule:: savu.data.data_structures.data_add_ons - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_create.rst b/doc/source/api/savu.data.data_structures.data_create.rst index 7d8438d5a..50c549408 100644 --- a/doc/source/api/savu.data.data_structures.data_create.rst +++ b/doc/source/api/savu.data.data_structures.data_create.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_create module ============================================== .. automodule:: savu.data.data_structures.data_create - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_notes.rst b/doc/source/api/savu.data.data_structures.data_notes.rst index 26a5146bb..21cc48863 100644 --- a/doc/source/api/savu.data.data_structures.data_notes.rst +++ b/doc/source/api/savu.data.data_structures.data_notes.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_notes module ============================================= .. automodule:: savu.data.data_structures.data_notes - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.base_type.rst b/doc/source/api/savu.data.data_structures.data_types.base_type.rst index e3cac7065..9bb7a8457 100644 --- a/doc/source/api/savu.data.data_structures.data_types.base_type.rst +++ b/doc/source/api/savu.data.data_structures.data_types.base_type.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.base\_type module ======================================================== .. automodule:: savu.data.data_structures.data_types.base_type - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst b/doc/source/api/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst index 67b0e3967..4489b040e 100644 --- a/doc/source/api/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst +++ b/doc/source/api/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.data\_plus\_darks\_and\_flats module =========================================================================== .. automodule:: savu.data.data_structures.data_types.data_plus_darks_and_flats - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.image_data.rst b/doc/source/api/savu.data.data_structures.data_types.image_data.rst index 993fd19d0..c7e2f870a 100644 --- a/doc/source/api/savu.data.data_structures.data_types.image_data.rst +++ b/doc/source/api/savu.data.data_structures.data_types.image_data.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.image\_data module ========================================================= .. automodule:: savu.data.data_structures.data_types.image_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.map_3dto4d_h5.rst b/doc/source/api/savu.data.data_structures.data_types.map_3dto4d_h5.rst index d8bb5f584..3034d9b48 100644 --- a/doc/source/api/savu.data.data_structures.data_types.map_3dto4d_h5.rst +++ b/doc/source/api/savu.data.data_structures.data_types.map_3dto4d_h5.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.map\_3dto4d\_h5 module ============================================================= .. automodule:: savu.data.data_structures.data_types.map_3dto4d_h5 - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.mrc.rst b/doc/source/api/savu.data.data_structures.data_types.mrc.rst index bddb9360c..af0e672d5 100644 --- a/doc/source/api/savu.data.data_structures.data_types.mrc.rst +++ b/doc/source/api/savu.data.data_structures.data_types.mrc.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.mrc module ================================================= .. automodule:: savu.data.data_structures.data_types.mrc - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.replicate.rst b/doc/source/api/savu.data.data_structures.data_types.replicate.rst index b9e1ee024..68aadcd99 100644 --- a/doc/source/api/savu.data.data_structures.data_types.replicate.rst +++ b/doc/source/api/savu.data.data_structures.data_types.replicate.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.replicate module ======================================================= .. automodule:: savu.data.data_structures.data_types.replicate - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.data_types.rst b/doc/source/api/savu.data.data_structures.data_types.rst index 92f86ba13..8ba18f876 100644 --- a/doc/source/api/savu.data.data_structures.data_types.rst +++ b/doc/source/api/savu.data.data_structures.data_types.rst @@ -2,15 +2,16 @@ savu.data.data\_structures.data\_types package ============================================== .. automodule:: savu.data.data_structures.data_types - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.data_structures.data_types.base_type savu.data.data_structures.data_types.data_plus_darks_and_flats @@ -19,4 +20,3 @@ Submodules savu.data.data_structures.data_types.mrc savu.data.data_structures.data_types.replicate savu.data.data_structures.data_types.stitch_data - diff --git a/doc/source/api/savu.data.data_structures.data_types.stitch_data.rst b/doc/source/api/savu.data.data_structures.data_types.stitch_data.rst index e450dbfb1..0c11721b7 100644 --- a/doc/source/api/savu.data.data_structures.data_types.stitch_data.rst +++ b/doc/source/api/savu.data.data_structures.data_types.stitch_data.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.data\_types.stitch\_data module ========================================================== .. automodule:: savu.data.data_structures.data_types.stitch_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.plugin_data.rst b/doc/source/api/savu.data.data_structures.plugin_data.rst index 0143c947e..3445373ac 100644 --- a/doc/source/api/savu.data.data_structures.plugin_data.rst +++ b/doc/source/api/savu.data.data_structures.plugin_data.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.plugin\_data module ============================================== .. automodule:: savu.data.data_structures.plugin_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.preview.rst b/doc/source/api/savu.data.data_structures.preview.rst index 858ca85e0..a3bd580ce 100644 --- a/doc/source/api/savu.data.data_structures.preview.rst +++ b/doc/source/api/savu.data.data_structures.preview.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.preview module ========================================= .. automodule:: savu.data.data_structures.preview - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.data_structures.rst b/doc/source/api/savu.data.data_structures.rst index b3d460ddd..b1afa4440 100644 --- a/doc/source/api/savu.data.data_structures.rst +++ b/doc/source/api/savu.data.data_structures.rst @@ -2,22 +2,24 @@ savu.data.data\_structures package ================================== .. automodule:: savu.data.data_structures - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.data.data_structures.data_types + savu.data.data_structures.data_types Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.data_structures.data savu.data.data_structures.data_add_ons @@ -26,4 +28,3 @@ Submodules savu.data.data_structures.plugin_data savu.data.data_structures.preview savu.data.data_structures.utils - diff --git a/doc/source/api/savu.data.data_structures.utils.rst b/doc/source/api/savu.data.data_structures.utils.rst index c5993b2a1..67e88bdcd 100644 --- a/doc/source/api/savu.data.data_structures.utils.rst +++ b/doc/source/api/savu.data.data_structures.utils.rst @@ -2,7 +2,7 @@ savu.data.data\_structures.utils module ======================================= .. automodule:: savu.data.data_structures.utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.experiment_collection.rst b/doc/source/api/savu.data.experiment_collection.rst index 7d638c117..429045ca7 100644 --- a/doc/source/api/savu.data.experiment_collection.rst +++ b/doc/source/api/savu.data.experiment_collection.rst @@ -2,7 +2,7 @@ savu.data.experiment\_collection module ======================================= .. automodule:: savu.data.experiment_collection - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.framework_citations.rst b/doc/source/api/savu.data.framework_citations.rst index 5c3d0efbd..497ceeffa 100644 --- a/doc/source/api/savu.data.framework_citations.rst +++ b/doc/source/api/savu.data.framework_citations.rst @@ -2,7 +2,7 @@ savu.data.framework\_citations module ===================================== .. automodule:: savu.data.framework_citations - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.meta_data.rst b/doc/source/api/savu.data.meta_data.rst index 86a1edb09..1ccf2e56b 100644 --- a/doc/source/api/savu.data.meta_data.rst +++ b/doc/source/api/savu.data.meta_data.rst @@ -2,7 +2,7 @@ savu.data.meta\_data module =========================== .. automodule:: savu.data.meta_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.plugin_list.rst b/doc/source/api/savu.data.plugin_list.rst index 5635628e8..d95c69d6a 100644 --- a/doc/source/api/savu.data.plugin_list.rst +++ b/doc/source/api/savu.data.plugin_list.rst @@ -2,7 +2,7 @@ savu.data.plugin\_list module ============================= .. automodule:: savu.data.plugin_list - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.rst b/doc/source/api/savu.data.rst index 79d7abedd..bf4a4666f 100644 --- a/doc/source/api/savu.data.rst +++ b/doc/source/api/savu.data.rst @@ -2,27 +2,28 @@ savu.data package ================= .. automodule:: savu.data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.data.data_structures - savu.data.transport_data + savu.data.data_structures + savu.data.transport_data Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.chunking savu.data.experiment_collection savu.data.framework_citations savu.data.meta_data savu.data.plugin_list - diff --git a/doc/source/api/savu.data.transport_data.base_transport_data.rst b/doc/source/api/savu.data.transport_data.base_transport_data.rst index e6e8b2e0d..74787da50 100644 --- a/doc/source/api/savu.data.transport_data.base_transport_data.rst +++ b/doc/source/api/savu.data.transport_data.base_transport_data.rst @@ -2,7 +2,7 @@ savu.data.transport\_data.base\_transport\_data module ====================================================== .. automodule:: savu.data.transport_data.base_transport_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.transport_data.basic_transport_data.rst b/doc/source/api/savu.data.transport_data.basic_transport_data.rst index 6b37ce7ff..da75499f0 100644 --- a/doc/source/api/savu.data.transport_data.basic_transport_data.rst +++ b/doc/source/api/savu.data.transport_data.basic_transport_data.rst @@ -2,7 +2,7 @@ savu.data.transport\_data.basic\_transport\_data module ======================================================= .. automodule:: savu.data.transport_data.basic_transport_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.transport_data.dosna_transport_data.rst b/doc/source/api/savu.data.transport_data.dosna_transport_data.rst index c420305fb..43562de94 100644 --- a/doc/source/api/savu.data.transport_data.dosna_transport_data.rst +++ b/doc/source/api/savu.data.transport_data.dosna_transport_data.rst @@ -2,7 +2,7 @@ savu.data.transport\_data.dosna\_transport\_data module ======================================================= .. automodule:: savu.data.transport_data.dosna_transport_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.transport_data.hdf5_transport_data.rst b/doc/source/api/savu.data.transport_data.hdf5_transport_data.rst index 7f1d8e832..bef2d5d68 100644 --- a/doc/source/api/savu.data.transport_data.hdf5_transport_data.rst +++ b/doc/source/api/savu.data.transport_data.hdf5_transport_data.rst @@ -2,7 +2,7 @@ savu.data.transport\_data.hdf5\_transport\_data module ====================================================== .. automodule:: savu.data.transport_data.hdf5_transport_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.data.transport_data.rst b/doc/source/api/savu.data.transport_data.rst index 92363355c..1f9a7c473 100644 --- a/doc/source/api/savu.data.transport_data.rst +++ b/doc/source/api/savu.data.transport_data.rst @@ -2,19 +2,19 @@ savu.data.transport\_data package ================================= .. automodule:: savu.data.transport_data - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.transport_data.base_transport_data savu.data.transport_data.basic_transport_data savu.data.transport_data.dosna_transport_data savu.data.transport_data.hdf5_transport_data savu.data.transport_data.slice_lists - diff --git a/doc/source/api/savu.data.transport_data.slice_lists.rst b/doc/source/api/savu.data.transport_data.slice_lists.rst index 2237dd27d..b71d8db87 100644 --- a/doc/source/api/savu.data.transport_data.slice_lists.rst +++ b/doc/source/api/savu.data.transport_data.slice_lists.rst @@ -2,7 +2,7 @@ savu.data.transport\_data.slice\_lists module ============================================= .. automodule:: savu.data.transport_data.slice_lists - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.absorption_corrections.base_absorption_correction.rst b/doc/source/api/savu.plugins.absorption_corrections.base_absorption_correction.rst index b05b4aafe..d862e95e3 100644 --- a/doc/source/api/savu.plugins.absorption_corrections.base_absorption_correction.rst +++ b/doc/source/api/savu.plugins.absorption_corrections.base_absorption_correction.rst @@ -2,7 +2,7 @@ savu.plugins.absorption\_corrections.base\_absorption\_correction module ======================================================================== .. automodule:: savu.plugins.absorption_corrections.base_absorption_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst b/doc/source/api/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst index 5093d485e..0da2e15b0 100644 --- a/doc/source/api/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst +++ b/doc/source/api/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst @@ -2,7 +2,7 @@ savu.plugins.absorption\_corrections.mc\_near\_absorption\_correction module ============================================================================ .. automodule:: savu.plugins.absorption_corrections.mc_near_absorption_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.absorption_corrections.rst b/doc/source/api/savu.plugins.absorption_corrections.rst index 1bd899716..619641f05 100644 --- a/doc/source/api/savu.plugins.absorption_corrections.rst +++ b/doc/source/api/savu.plugins.absorption_corrections.rst @@ -2,16 +2,16 @@ savu.plugins.absorption\_corrections package ============================================ .. automodule:: savu.plugins.absorption_corrections - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.absorption_corrections.base_absorption_correction savu.plugins.absorption_corrections.mc_near_absorption_correction - diff --git a/doc/source/api/savu.plugins.alignment.projection_shift.rst b/doc/source/api/savu.plugins.alignment.projection_shift.rst index 7ccb31a07..0d66d5ae1 100644 --- a/doc/source/api/savu.plugins.alignment.projection_shift.rst +++ b/doc/source/api/savu.plugins.alignment.projection_shift.rst @@ -2,7 +2,7 @@ savu.plugins.alignment.projection\_shift module =============================================== .. automodule:: savu.plugins.alignment.projection_shift - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.alignment.projection_vertical_alignment.rst b/doc/source/api/savu.plugins.alignment.projection_vertical_alignment.rst index 4c94d7914..d09702a9d 100644 --- a/doc/source/api/savu.plugins.alignment.projection_vertical_alignment.rst +++ b/doc/source/api/savu.plugins.alignment.projection_vertical_alignment.rst @@ -2,7 +2,7 @@ savu.plugins.alignment.projection\_vertical\_alignment module ============================================================= .. automodule:: savu.plugins.alignment.projection_vertical_alignment - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.alignment.rst b/doc/source/api/savu.plugins.alignment.rst index 92bd88225..a5e71f81e 100644 --- a/doc/source/api/savu.plugins.alignment.rst +++ b/doc/source/api/savu.plugins.alignment.rst @@ -2,18 +2,18 @@ savu.plugins.alignment package ============================== .. automodule:: savu.plugins.alignment - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.alignment.projection_shift savu.plugins.alignment.projection_vertical_alignment savu.plugins.alignment.sinogram_alignment savu.plugins.alignment.sinogram_clean - diff --git a/doc/source/api/savu.plugins.alignment.sinogram_alignment.rst b/doc/source/api/savu.plugins.alignment.sinogram_alignment.rst index 8b9efaab7..fa15e8061 100644 --- a/doc/source/api/savu.plugins.alignment.sinogram_alignment.rst +++ b/doc/source/api/savu.plugins.alignment.sinogram_alignment.rst @@ -2,7 +2,7 @@ savu.plugins.alignment.sinogram\_alignment module ================================================= .. automodule:: savu.plugins.alignment.sinogram_alignment - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.alignment.sinogram_clean.rst b/doc/source/api/savu.plugins.alignment.sinogram_clean.rst index 719625683..5ed2c80f2 100644 --- a/doc/source/api/savu.plugins.alignment.sinogram_clean.rst +++ b/doc/source/api/savu.plugins.alignment.sinogram_clean.rst @@ -2,7 +2,7 @@ savu.plugins.alignment.sinogram\_clean module ============================================= .. automodule:: savu.plugins.alignment.sinogram_clean - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.analysis.base_analysis.rst b/doc/source/api/savu.plugins.analysis.base_analysis.rst index f987e6ce3..a47a3779b 100644 --- a/doc/source/api/savu.plugins.analysis.base_analysis.rst +++ b/doc/source/api/savu.plugins.analysis.base_analysis.rst @@ -2,7 +2,7 @@ savu.plugins.analysis.base\_analysis module =========================================== .. automodule:: savu.plugins.analysis.base_analysis - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.analysis.histogram.rst b/doc/source/api/savu.plugins.analysis.histogram.rst index d16d6fc8a..6a1d9434d 100644 --- a/doc/source/api/savu.plugins.analysis.histogram.rst +++ b/doc/source/api/savu.plugins.analysis.histogram.rst @@ -2,7 +2,7 @@ savu.plugins.analysis.histogram module ====================================== .. automodule:: savu.plugins.analysis.histogram - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.analysis.rst b/doc/source/api/savu.plugins.analysis.rst index dbe9b2dd7..4022d9413 100644 --- a/doc/source/api/savu.plugins.analysis.rst +++ b/doc/source/api/savu.plugins.analysis.rst @@ -2,18 +2,18 @@ savu.plugins.analysis package ============================= .. automodule:: savu.plugins.analysis - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.analysis.base_analysis savu.plugins.analysis.histogram savu.plugins.analysis.stats savu.plugins.analysis.stxm_analysis - diff --git a/doc/source/api/savu.plugins.analysis.stats.rst b/doc/source/api/savu.plugins.analysis.stats.rst index 8c9198c48..ab5ac5d53 100644 --- a/doc/source/api/savu.plugins.analysis.stats.rst +++ b/doc/source/api/savu.plugins.analysis.stats.rst @@ -2,7 +2,7 @@ savu.plugins.analysis.stats module ================================== .. automodule:: savu.plugins.analysis.stats - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.analysis.stxm_analysis.rst b/doc/source/api/savu.plugins.analysis.stxm_analysis.rst index 4d3dc1d1c..8e2ec0a06 100644 --- a/doc/source/api/savu.plugins.analysis.stxm_analysis.rst +++ b/doc/source/api/savu.plugins.analysis.stxm_analysis.rst @@ -2,7 +2,7 @@ savu.plugins.analysis.stxm\_analysis module =========================================== .. automodule:: savu.plugins.analysis.stxm_analysis - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst b/doc/source/api/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst index f300e1066..f14c38586 100644 --- a/doc/source/api/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst +++ b/doc/source/api/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst @@ -2,7 +2,7 @@ savu.plugins.azimuthal\_integrators.base\_azimuthal\_integrator module ====================================================================== .. automodule:: savu.plugins.azimuthal_integrators.base_azimuthal_integrator - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst b/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst index 8dea22521..d97bd98f1 100644 --- a/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst +++ b/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst @@ -2,7 +2,7 @@ savu.plugins.azimuthal\_integrators.pyfai\_azimuthal\_integrator module ======================================================================= .. automodule:: savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst b/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst index fa81ebde7..4227a077a 100644 --- a/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst +++ b/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst @@ -2,7 +2,7 @@ savu.plugins.azimuthal\_integrators.pyfai\_azimuthal\_integrator\_separate modul ================================================================================= .. automodule:: savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst b/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst index ed9ad5154..9ab125fa8 100644 --- a/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst +++ b/doc/source/api/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst @@ -2,7 +2,7 @@ savu.plugins.azimuthal\_integrators.pyfai\_azimuthal\_integrator\_with\_bragg\_f ============================================================================================ .. automodule:: savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.azimuthal_integrators.rst b/doc/source/api/savu.plugins.azimuthal_integrators.rst index 38761faf0..8f83674d7 100644 --- a/doc/source/api/savu.plugins.azimuthal_integrators.rst +++ b/doc/source/api/savu.plugins.azimuthal_integrators.rst @@ -2,18 +2,18 @@ savu.plugins.azimuthal\_integrators package =========================================== .. automodule:: savu.plugins.azimuthal_integrators - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.azimuthal_integrators.base_azimuthal_integrator savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter - diff --git a/doc/source/api/savu.plugins.basic_operations.arithmetic_operations.rst b/doc/source/api/savu.plugins.basic_operations.arithmetic_operations.rst index b4469e161..96fa02668 100644 --- a/doc/source/api/savu.plugins.basic_operations.arithmetic_operations.rst +++ b/doc/source/api/savu.plugins.basic_operations.arithmetic_operations.rst @@ -2,7 +2,7 @@ savu.plugins.basic\_operations.arithmetic\_operations module ============================================================ .. automodule:: savu.plugins.basic_operations.arithmetic_operations - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.basic_operations.rst b/doc/source/api/savu.plugins.basic_operations.basic_operations.rst index bbe3b6620..4599c6b42 100644 --- a/doc/source/api/savu.plugins.basic_operations.basic_operations.rst +++ b/doc/source/api/savu.plugins.basic_operations.basic_operations.rst @@ -2,7 +2,7 @@ savu.plugins.basic\_operations.basic\_operations module ======================================================= .. automodule:: savu.plugins.basic_operations.basic_operations - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.data_rescale.rst b/doc/source/api/savu.plugins.basic_operations.data_rescale.rst index ca39dc241..c371749ed 100644 --- a/doc/source/api/savu.plugins.basic_operations.data_rescale.rst +++ b/doc/source/api/savu.plugins.basic_operations.data_rescale.rst @@ -2,7 +2,7 @@ savu.plugins.basic\_operations.data\_rescale module =================================================== .. automodule:: savu.plugins.basic_operations.data_rescale - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.data_threshold.rst b/doc/source/api/savu.plugins.basic_operations.data_threshold.rst new file mode 100644 index 000000000..f1b7aa7df --- /dev/null +++ b/doc/source/api/savu.plugins.basic_operations.data_threshold.rst @@ -0,0 +1,8 @@ +savu.plugins.basic\_operations.data\_threshold module +===================================================== + +.. automodule:: savu.plugins.basic_operations.data_threshold + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.elementwise_arrays_arithmetics.rst b/doc/source/api/savu.plugins.basic_operations.elementwise_arrays_arithmetics.rst new file mode 100644 index 000000000..6985089ae --- /dev/null +++ b/doc/source/api/savu.plugins.basic_operations.elementwise_arrays_arithmetics.rst @@ -0,0 +1,8 @@ +savu.plugins.basic\_operations.elementwise\_arrays\_arithmetics module +====================================================================== + +.. automodule:: savu.plugins.basic_operations.elementwise_arrays_arithmetics + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.get_data_statistics.rst b/doc/source/api/savu.plugins.basic_operations.get_data_statistics.rst index b119f69d0..9c51da7ab 100644 --- a/doc/source/api/savu.plugins.basic_operations.get_data_statistics.rst +++ b/doc/source/api/savu.plugins.basic_operations.get_data_statistics.rst @@ -2,7 +2,7 @@ savu.plugins.basic\_operations.get\_data\_statistics module =========================================================== .. automodule:: savu.plugins.basic_operations.get_data_statistics - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.no_process_plugin.rst b/doc/source/api/savu.plugins.basic_operations.no_process_plugin.rst index 0c2c7b7af..6c4540576 100644 --- a/doc/source/api/savu.plugins.basic_operations.no_process_plugin.rst +++ b/doc/source/api/savu.plugins.basic_operations.no_process_plugin.rst @@ -2,7 +2,7 @@ savu.plugins.basic\_operations.no\_process\_plugin module ========================================================= .. automodule:: savu.plugins.basic_operations.no_process_plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.rst b/doc/source/api/savu.plugins.basic_operations.rst index 7868dbd21..4e3718ec3 100644 --- a/doc/source/api/savu.plugins.basic_operations.rst +++ b/doc/source/api/savu.plugins.basic_operations.rst @@ -2,19 +2,23 @@ savu.plugins.basic\_operations package ====================================== .. automodule:: savu.plugins.basic_operations - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.basic_operations.arithmetic_operations savu.plugins.basic_operations.basic_operations savu.plugins.basic_operations.data_rescale + savu.plugins.basic_operations.data_threshold + savu.plugins.basic_operations.elementwise_arrays_arithmetics savu.plugins.basic_operations.get_data_statistics savu.plugins.basic_operations.no_process_plugin - + savu.plugins.basic_operations.test_plugin + savu.plugins.basic_operations.value_mask_replacement diff --git a/doc/source/api/savu.plugins.basic_operations.test_plugin.rst b/doc/source/api/savu.plugins.basic_operations.test_plugin.rst new file mode 100644 index 000000000..cefe9edfb --- /dev/null +++ b/doc/source/api/savu.plugins.basic_operations.test_plugin.rst @@ -0,0 +1,8 @@ +savu.plugins.basic\_operations.test\_plugin module +================================================== + +.. automodule:: savu.plugins.basic_operations.test_plugin + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.basic_operations.value_mask_replacement.rst b/doc/source/api/savu.plugins.basic_operations.value_mask_replacement.rst new file mode 100644 index 000000000..b7b2070be --- /dev/null +++ b/doc/source/api/savu.plugins.basic_operations.value_mask_replacement.rst @@ -0,0 +1,8 @@ +savu.plugins.basic\_operations.value\_mask\_replacement module +============================================================== + +.. automodule:: savu.plugins.basic_operations.value_mask_replacement + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.centering.rst b/doc/source/api/savu.plugins.centering.rst index 4b89b8153..448d881de 100644 --- a/doc/source/api/savu.plugins.centering.rst +++ b/doc/source/api/savu.plugins.centering.rst @@ -2,17 +2,16 @@ savu.plugins.centering package ============================== .. automodule:: savu.plugins.centering - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.centering.vo_centering - savu.plugins.centering.vo_centering_gpu savu.plugins.centering.vo_centering_iterative - diff --git a/doc/source/api/savu.plugins.centering.vo_centering.rst b/doc/source/api/savu.plugins.centering.vo_centering.rst index 576389075..16c1d5f3d 100644 --- a/doc/source/api/savu.plugins.centering.vo_centering.rst +++ b/doc/source/api/savu.plugins.centering.vo_centering.rst @@ -2,7 +2,7 @@ savu.plugins.centering.vo\_centering module =========================================== .. automodule:: savu.plugins.centering.vo_centering - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.centering.vo_centering_iterative.rst b/doc/source/api/savu.plugins.centering.vo_centering_iterative.rst index 2387138bc..f81ce152a 100644 --- a/doc/source/api/savu.plugins.centering.vo_centering_iterative.rst +++ b/doc/source/api/savu.plugins.centering.vo_centering_iterative.rst @@ -2,7 +2,7 @@ savu.plugins.centering.vo\_centering\_iterative module ====================================================== .. automodule:: savu.plugins.centering.vo_centering_iterative - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.component_analysis.base_component_analysis.rst b/doc/source/api/savu.plugins.component_analysis.base_component_analysis.rst index f8888db14..832cdde16 100644 --- a/doc/source/api/savu.plugins.component_analysis.base_component_analysis.rst +++ b/doc/source/api/savu.plugins.component_analysis.base_component_analysis.rst @@ -2,7 +2,7 @@ savu.plugins.component\_analysis.base\_component\_analysis module ================================================================= .. automodule:: savu.plugins.component_analysis.base_component_analysis - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.component_analysis.ica.rst b/doc/source/api/savu.plugins.component_analysis.ica.rst index b22437070..75757b3ca 100644 --- a/doc/source/api/savu.plugins.component_analysis.ica.rst +++ b/doc/source/api/savu.plugins.component_analysis.ica.rst @@ -2,7 +2,7 @@ savu.plugins.component\_analysis.ica module =========================================== .. automodule:: savu.plugins.component_analysis.ica - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.component_analysis.pca.rst b/doc/source/api/savu.plugins.component_analysis.pca.rst index 5fabe0a81..d126465a6 100644 --- a/doc/source/api/savu.plugins.component_analysis.pca.rst +++ b/doc/source/api/savu.plugins.component_analysis.pca.rst @@ -2,7 +2,7 @@ savu.plugins.component\_analysis.pca module =========================================== .. automodule:: savu.plugins.component_analysis.pca - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.component_analysis.rst b/doc/source/api/savu.plugins.component_analysis.rst index 38095cc16..b937f2c11 100644 --- a/doc/source/api/savu.plugins.component_analysis.rst +++ b/doc/source/api/savu.plugins.component_analysis.rst @@ -2,17 +2,17 @@ savu.plugins.component\_analysis package ======================================== .. automodule:: savu.plugins.component_analysis - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.component_analysis.base_component_analysis savu.plugins.component_analysis.ica savu.plugins.component_analysis.pca - diff --git a/doc/source/api/savu.plugins.corrections.base_correction.rst b/doc/source/api/savu.plugins.corrections.base_correction.rst index fc835814a..2d2ff20c3 100644 --- a/doc/source/api/savu.plugins.corrections.base_correction.rst +++ b/doc/source/api/savu.plugins.corrections.base_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.base\_correction module ================================================ .. automodule:: savu.plugins.corrections.base_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.camera_rot_correction.rst b/doc/source/api/savu.plugins.corrections.camera_rot_correction.rst index c24cc9b3c..6474de355 100644 --- a/doc/source/api/savu.plugins.corrections.camera_rot_correction.rst +++ b/doc/source/api/savu.plugins.corrections.camera_rot_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.camera\_rot\_correction module ======================================================= .. automodule:: savu.plugins.corrections.camera_rot_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.convert_360_180_sinogram.rst b/doc/source/api/savu.plugins.corrections.convert_360_180_sinogram.rst index 10b2dd7c5..83593785f 100644 --- a/doc/source/api/savu.plugins.corrections.convert_360_180_sinogram.rst +++ b/doc/source/api/savu.plugins.corrections.convert_360_180_sinogram.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.convert\_360\_180\_sinogram module =========================================================== .. automodule:: savu.plugins.corrections.convert_360_180_sinogram - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.dark_flat_field_correction.rst b/doc/source/api/savu.plugins.corrections.dark_flat_field_correction.rst index a8f86fde7..9efd7fb5d 100644 --- a/doc/source/api/savu.plugins.corrections.dark_flat_field_correction.rst +++ b/doc/source/api/savu.plugins.corrections.dark_flat_field_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.dark\_flat\_field\_correction module ============================================================= .. automodule:: savu.plugins.corrections.dark_flat_field_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.distortion_correction.rst b/doc/source/api/savu.plugins.corrections.distortion_correction.rst index d0af1911b..f31d7aac1 100644 --- a/doc/source/api/savu.plugins.corrections.distortion_correction.rst +++ b/doc/source/api/savu.plugins.corrections.distortion_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.distortion\_correction module ====================================================== .. automodule:: savu.plugins.corrections.distortion_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.monitor_correction.rst b/doc/source/api/savu.plugins.corrections.monitor_correction.rst index a51da2f54..0462726d2 100644 --- a/doc/source/api/savu.plugins.corrections.monitor_correction.rst +++ b/doc/source/api/savu.plugins.corrections.monitor_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.monitor\_correction module =================================================== .. automodule:: savu.plugins.corrections.monitor_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.monitor_correction_nd.rst b/doc/source/api/savu.plugins.corrections.monitor_correction_nd.rst index 2292e2d55..259036c5c 100644 --- a/doc/source/api/savu.plugins.corrections.monitor_correction_nd.rst +++ b/doc/source/api/savu.plugins.corrections.monitor_correction_nd.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.monitor\_correction\_nd module ======================================================= .. automodule:: savu.plugins.corrections.monitor_correction_nd - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.mtf_deconvolution.rst b/doc/source/api/savu.plugins.corrections.mtf_deconvolution.rst new file mode 100644 index 000000000..6acfda610 --- /dev/null +++ b/doc/source/api/savu.plugins.corrections.mtf_deconvolution.rst @@ -0,0 +1,8 @@ +savu.plugins.corrections.mtf\_deconvolution module +================================================== + +.. automodule:: savu.plugins.corrections.mtf_deconvolution + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.rst b/doc/source/api/savu.plugins.corrections.rst index a2de876b8..311d5d709 100644 --- a/doc/source/api/savu.plugins.corrections.rst +++ b/doc/source/api/savu.plugins.corrections.rst @@ -2,27 +2,27 @@ savu.plugins.corrections package ================================ .. automodule:: savu.plugins.corrections - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.corrections.base_correction savu.plugins.corrections.camera_rot_correction savu.plugins.corrections.convert_360_180_sinogram savu.plugins.corrections.dark_flat_field_correction savu.plugins.corrections.distortion_correction - savu.plugins.corrections.distortion_correction_deprecated savu.plugins.corrections.monitor_correction savu.plugins.corrections.monitor_correction_nd + savu.plugins.corrections.mtf_deconvolution savu.plugins.corrections.subpixel_shift savu.plugins.corrections.time_based_correction savu.plugins.corrections.time_based_plus_drift_correction savu.plugins.corrections.timeseries_field_corrections savu.plugins.corrections.xrd_absorption_approximation - diff --git a/doc/source/api/savu.plugins.corrections.subpixel_shift.rst b/doc/source/api/savu.plugins.corrections.subpixel_shift.rst index e3221aa7b..4d766eba2 100644 --- a/doc/source/api/savu.plugins.corrections.subpixel_shift.rst +++ b/doc/source/api/savu.plugins.corrections.subpixel_shift.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.subpixel\_shift module =============================================== .. automodule:: savu.plugins.corrections.subpixel_shift - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.time_based_correction.rst b/doc/source/api/savu.plugins.corrections.time_based_correction.rst index fc85658f4..f27be2147 100644 --- a/doc/source/api/savu.plugins.corrections.time_based_correction.rst +++ b/doc/source/api/savu.plugins.corrections.time_based_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.time\_based\_correction module ======================================================= .. automodule:: savu.plugins.corrections.time_based_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.time_based_plus_drift_correction.rst b/doc/source/api/savu.plugins.corrections.time_based_plus_drift_correction.rst index 06fcdf80e..221508838 100644 --- a/doc/source/api/savu.plugins.corrections.time_based_plus_drift_correction.rst +++ b/doc/source/api/savu.plugins.corrections.time_based_plus_drift_correction.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.time\_based\_plus\_drift\_correction module ==================================================================== .. automodule:: savu.plugins.corrections.time_based_plus_drift_correction - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.timeseries_field_corrections.rst b/doc/source/api/savu.plugins.corrections.timeseries_field_corrections.rst index 477c4361d..e42a08e16 100644 --- a/doc/source/api/savu.plugins.corrections.timeseries_field_corrections.rst +++ b/doc/source/api/savu.plugins.corrections.timeseries_field_corrections.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.timeseries\_field\_corrections module ============================================================== .. automodule:: savu.plugins.corrections.timeseries_field_corrections - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.corrections.xrd_absorption_approximation.rst b/doc/source/api/savu.plugins.corrections.xrd_absorption_approximation.rst index 459d3d873..dd22569b1 100644 --- a/doc/source/api/savu.plugins.corrections.xrd_absorption_approximation.rst +++ b/doc/source/api/savu.plugins.corrections.xrd_absorption_approximation.rst @@ -2,7 +2,7 @@ savu.plugins.corrections.xrd\_absorption\_approximation module ============================================================== .. automodule:: savu.plugins.corrections.xrd_absorption_approximation - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.developing.rst b/doc/source/api/savu.plugins.developing.rst index 7f9a8eada..563aef199 100644 --- a/doc/source/api/savu.plugins.developing.rst +++ b/doc/source/api/savu.plugins.developing.rst @@ -2,15 +2,15 @@ savu.plugins.developing package =============================== .. automodule:: savu.plugins.developing - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.developing.testing_sino_align - diff --git a/doc/source/api/savu.plugins.developing.testing_sino_align.rst b/doc/source/api/savu.plugins.developing.testing_sino_align.rst index 9acb36561..800e5d01a 100644 --- a/doc/source/api/savu.plugins.developing.testing_sino_align.rst +++ b/doc/source/api/savu.plugins.developing.testing_sino_align.rst @@ -2,7 +2,7 @@ savu.plugins.developing.testing\_sino\_align module =================================================== .. automodule:: savu.plugins.developing.testing_sino_align - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.docstring_parser.rst b/doc/source/api/savu.plugins.docstring_parser.rst index 4506f755f..091a198da 100644 --- a/doc/source/api/savu.plugins.docstring_parser.rst +++ b/doc/source/api/savu.plugins.docstring_parser.rst @@ -2,7 +2,7 @@ savu.plugins.docstring\_parser module ===================================== .. automodule:: savu.plugins.docstring_parser - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.all_cpus_plugin.rst b/doc/source/api/savu.plugins.driver.all_cpus_plugin.rst index d096ed122..fd2d99aee 100644 --- a/doc/source/api/savu.plugins.driver.all_cpus_plugin.rst +++ b/doc/source/api/savu.plugins.driver.all_cpus_plugin.rst @@ -2,7 +2,7 @@ savu.plugins.driver.all\_cpus\_plugin module ============================================ .. automodule:: savu.plugins.driver.all_cpus_plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.base_driver.rst b/doc/source/api/savu.plugins.driver.base_driver.rst index 69b21485e..bb105bffb 100644 --- a/doc/source/api/savu.plugins.driver.base_driver.rst +++ b/doc/source/api/savu.plugins.driver.base_driver.rst @@ -2,7 +2,7 @@ savu.plugins.driver.base\_driver module ======================================= .. automodule:: savu.plugins.driver.base_driver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.basic_driver.rst b/doc/source/api/savu.plugins.driver.basic_driver.rst index 9c85b6ec5..8cb2b7499 100644 --- a/doc/source/api/savu.plugins.driver.basic_driver.rst +++ b/doc/source/api/savu.plugins.driver.basic_driver.rst @@ -2,7 +2,7 @@ savu.plugins.driver.basic\_driver module ======================================== .. automodule:: savu.plugins.driver.basic_driver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.cpu_plugin.rst b/doc/source/api/savu.plugins.driver.cpu_plugin.rst index 51a21ecef..4bd6b2f78 100644 --- a/doc/source/api/savu.plugins.driver.cpu_plugin.rst +++ b/doc/source/api/savu.plugins.driver.cpu_plugin.rst @@ -2,7 +2,7 @@ savu.plugins.driver.cpu\_plugin module ====================================== .. automodule:: savu.plugins.driver.cpu_plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.gpu_plugin.rst b/doc/source/api/savu.plugins.driver.gpu_plugin.rst index f40b3285d..27f396b18 100644 --- a/doc/source/api/savu.plugins.driver.gpu_plugin.rst +++ b/doc/source/api/savu.plugins.driver.gpu_plugin.rst @@ -2,7 +2,7 @@ savu.plugins.driver.gpu\_plugin module ====================================== .. automodule:: savu.plugins.driver.gpu_plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.iterative_plugin.rst b/doc/source/api/savu.plugins.driver.iterative_plugin.rst index c13fe4740..ed0256bd5 100644 --- a/doc/source/api/savu.plugins.driver.iterative_plugin.rst +++ b/doc/source/api/savu.plugins.driver.iterative_plugin.rst @@ -2,7 +2,7 @@ savu.plugins.driver.iterative\_plugin module ============================================ .. automodule:: savu.plugins.driver.iterative_plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.multi_threaded_plugin.rst b/doc/source/api/savu.plugins.driver.multi_threaded_plugin.rst index dd83ca28a..970d62748 100644 --- a/doc/source/api/savu.plugins.driver.multi_threaded_plugin.rst +++ b/doc/source/api/savu.plugins.driver.multi_threaded_plugin.rst @@ -2,7 +2,7 @@ savu.plugins.driver.multi\_threaded\_plugin module ================================================== .. automodule:: savu.plugins.driver.multi_threaded_plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.plugin_driver.rst b/doc/source/api/savu.plugins.driver.plugin_driver.rst index 09bf8cff2..39939dd4d 100644 --- a/doc/source/api/savu.plugins.driver.plugin_driver.rst +++ b/doc/source/api/savu.plugins.driver.plugin_driver.rst @@ -2,7 +2,7 @@ savu.plugins.driver.plugin\_driver module ========================================= .. automodule:: savu.plugins.driver.plugin_driver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.driver.rst b/doc/source/api/savu.plugins.driver.rst index e9a268ed8..bf8bc5f60 100644 --- a/doc/source/api/savu.plugins.driver.rst +++ b/doc/source/api/savu.plugins.driver.rst @@ -2,15 +2,16 @@ savu.plugins.driver package =========================== .. automodule:: savu.plugins.driver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.driver.all_cpus_plugin savu.plugins.driver.base_driver @@ -20,5 +21,3 @@ Submodules savu.plugins.driver.iterative_plugin savu.plugins.driver.multi_threaded_plugin savu.plugins.driver.plugin_driver - savu.plugins.driver.single_node_multi_threaded_plugin - diff --git a/doc/source/api/savu.plugins.filters.band_pass.rst b/doc/source/api/savu.plugins.filters.band_pass.rst index 814a223b2..2942522d1 100644 --- a/doc/source/api/savu.plugins.filters.band_pass.rst +++ b/doc/source/api/savu.plugins.filters.band_pass.rst @@ -2,7 +2,7 @@ savu.plugins.filters.band\_pass module ====================================== .. automodule:: savu.plugins.filters.band_pass - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.base_filter.rst b/doc/source/api/savu.plugins.filters.base_filter.rst index 6f55eea5a..29d184bda 100644 --- a/doc/source/api/savu.plugins.filters.base_filter.rst +++ b/doc/source/api/savu.plugins.filters.base_filter.rst @@ -2,7 +2,7 @@ savu.plugins.filters.base\_filter module ======================================== .. automodule:: savu.plugins.filters.base_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_cpu.rst b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_cpu.rst new file mode 100644 index 000000000..859c95c47 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_cpu.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_cpu module +========================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_cpu + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D.rst b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D.rst new file mode 100644 index 000000000..01f9ffa63 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_cpu\_3D module +============================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_cpu_3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_gpu.rst b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_gpu.rst new file mode 100644 index 000000000..3075df642 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_gpu.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_gpu module +========================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_gpu + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D.rst b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D.rst new file mode 100644 index 000000000..d2d3739d4 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_gpu\_3D module +============================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_gpu_3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.denoise_bregman_filter.rst b/doc/source/api/savu.plugins.filters.denoising.denoise_bregman_filter.rst new file mode 100644 index 000000000..81b93dea0 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.denoise_bregman_filter.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.denoise\_bregman\_filter module +============================================================== + +.. automodule:: savu.plugins.filters.denoising.denoise_bregman_filter + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.median_filter.rst b/doc/source/api/savu.plugins.filters.denoising.median_filter.rst new file mode 100644 index 000000000..f959a9d4d --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.median_filter.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.median\_filter module +==================================================== + +.. automodule:: savu.plugins.filters.denoising.median_filter + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.median_filter_deprecated.rst b/doc/source/api/savu.plugins.filters.denoising.median_filter_deprecated.rst new file mode 100644 index 000000000..56b49f700 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.median_filter_deprecated.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.median\_filter\_deprecated module +================================================================ + +.. automodule:: savu.plugins.filters.denoising.median_filter_deprecated + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.median_filter_gpu.rst b/doc/source/api/savu.plugins.filters.denoising.median_filter_gpu.rst new file mode 100644 index 000000000..5402009c4 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.median_filter_gpu.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.denoising.median\_filter\_gpu module +========================================================= + +.. automodule:: savu.plugins.filters.denoising.median_filter_gpu + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.denoising.rst b/doc/source/api/savu.plugins.filters.denoising.rst new file mode 100644 index 000000000..96253c4f0 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.denoising.rst @@ -0,0 +1,23 @@ +savu.plugins.filters.denoising package +====================================== + +.. automodule:: savu.plugins.filters.denoising + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.filters.denoising.ccpi_denoising_cpu + savu.plugins.filters.denoising.ccpi_denoising_cpu_3D + savu.plugins.filters.denoising.ccpi_denoising_gpu + savu.plugins.filters.denoising.ccpi_denoising_gpu_3D + savu.plugins.filters.denoising.denoise_bregman_filter + savu.plugins.filters.denoising.median_filter + savu.plugins.filters.denoising.median_filter_deprecated + savu.plugins.filters.denoising.median_filter_gpu diff --git a/doc/source/api/savu.plugins.filters.dezinger.rst b/doc/source/api/savu.plugins.filters.dezinger.rst index 7007d752d..6ddc8385c 100644 --- a/doc/source/api/savu.plugins.filters.dezinger.rst +++ b/doc/source/api/savu.plugins.filters.dezinger.rst @@ -2,7 +2,7 @@ savu.plugins.filters.dezinger module ==================================== .. automodule:: savu.plugins.filters.dezinger - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezinger_deprecated.rst b/doc/source/api/savu.plugins.filters.dezinger_deprecated.rst new file mode 100644 index 000000000..98c40ad0c --- /dev/null +++ b/doc/source/api/savu.plugins.filters.dezinger_deprecated.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.dezinger\_deprecated module +================================================ + +.. automodule:: savu.plugins.filters.dezinger_deprecated + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezinger_simple.rst b/doc/source/api/savu.plugins.filters.dezinger_simple.rst index 87241e2dd..32b8b13c7 100644 --- a/doc/source/api/savu.plugins.filters.dezinger_simple.rst +++ b/doc/source/api/savu.plugins.filters.dezinger_simple.rst @@ -2,7 +2,7 @@ savu.plugins.filters.dezinger\_simple module ============================================ .. automodule:: savu.plugins.filters.dezinger_simple - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezinger_sinogram.rst b/doc/source/api/savu.plugins.filters.dezinger_sinogram.rst index 0cbb16966..7708182ab 100644 --- a/doc/source/api/savu.plugins.filters.dezinger_sinogram.rst +++ b/doc/source/api/savu.plugins.filters.dezinger_sinogram.rst @@ -2,7 +2,7 @@ savu.plugins.filters.dezinger\_sinogram module ============================================== .. automodule:: savu.plugins.filters.dezinger_sinogram - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezingers.dezinger.rst b/doc/source/api/savu.plugins.filters.dezingers.dezinger.rst new file mode 100644 index 000000000..5102fe91c --- /dev/null +++ b/doc/source/api/savu.plugins.filters.dezingers.dezinger.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.dezingers.dezinger module +============================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezingers.dezinger_gpu.rst b/doc/source/api/savu.plugins.filters.dezingers.dezinger_gpu.rst new file mode 100644 index 000000000..3127e3d28 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.dezingers.dezinger_gpu.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.dezingers.dezinger\_gpu module +=================================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger_gpu + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezingers.dezinger_simple_deprecated.rst b/doc/source/api/savu.plugins.filters.dezingers.dezinger_simple_deprecated.rst new file mode 100644 index 000000000..8055b1df5 --- /dev/null +++ b/doc/source/api/savu.plugins.filters.dezingers.dezinger_simple_deprecated.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.dezingers.dezinger\_simple\_deprecated module +================================================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger_simple_deprecated + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated.rst b/doc/source/api/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated.rst new file mode 100644 index 000000000..0f9794aae --- /dev/null +++ b/doc/source/api/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated.rst @@ -0,0 +1,8 @@ +savu.plugins.filters.dezingers.dezinger\_sinogram\_deprecated module +==================================================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger_sinogram_deprecated + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.dezingers.rst b/doc/source/api/savu.plugins.filters.dezingers.rst new file mode 100644 index 000000000..a4ffa5ffd --- /dev/null +++ b/doc/source/api/savu.plugins.filters.dezingers.rst @@ -0,0 +1,19 @@ +savu.plugins.filters.dezingers package +====================================== + +.. automodule:: savu.plugins.filters.dezingers + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.filters.dezingers.dezinger + savu.plugins.filters.dezingers.dezinger_gpu + savu.plugins.filters.dezingers.dezinger_simple_deprecated + savu.plugins.filters.dezingers.dezinger_sinogram_deprecated diff --git a/doc/source/api/savu.plugins.filters.dials_find_spots.rst b/doc/source/api/savu.plugins.filters.dials_find_spots.rst index f9478423a..5bb3ad408 100644 --- a/doc/source/api/savu.plugins.filters.dials_find_spots.rst +++ b/doc/source/api/savu.plugins.filters.dials_find_spots.rst @@ -2,7 +2,7 @@ savu.plugins.filters.dials\_find\_spots module ============================================== .. automodule:: savu.plugins.filters.dials_find_spots - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.find_peaks.rst b/doc/source/api/savu.plugins.filters.find_peaks.rst index 368dd08ce..faf0a24df 100644 --- a/doc/source/api/savu.plugins.filters.find_peaks.rst +++ b/doc/source/api/savu.plugins.filters.find_peaks.rst @@ -2,7 +2,7 @@ savu.plugins.filters.find\_peaks module ======================================= .. automodule:: savu.plugins.filters.find_peaks - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.fresnel_filter.rst b/doc/source/api/savu.plugins.filters.fresnel_filter.rst index 3afe70d94..a114a8e6c 100644 --- a/doc/source/api/savu.plugins.filters.fresnel_filter.rst +++ b/doc/source/api/savu.plugins.filters.fresnel_filter.rst @@ -2,7 +2,7 @@ savu.plugins.filters.fresnel\_filter module =========================================== .. automodule:: savu.plugins.filters.fresnel_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.hilbert_filter.rst b/doc/source/api/savu.plugins.filters.hilbert_filter.rst index 9725caa4b..e3cb57471 100644 --- a/doc/source/api/savu.plugins.filters.hilbert_filter.rst +++ b/doc/source/api/savu.plugins.filters.hilbert_filter.rst @@ -2,7 +2,7 @@ savu.plugins.filters.hilbert\_filter module =========================================== .. automodule:: savu.plugins.filters.hilbert_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.image_interpolation.rst b/doc/source/api/savu.plugins.filters.image_interpolation.rst index 25269a36f..a55c83973 100644 --- a/doc/source/api/savu.plugins.filters.image_interpolation.rst +++ b/doc/source/api/savu.plugins.filters.image_interpolation.rst @@ -2,7 +2,7 @@ savu.plugins.filters.image\_interpolation module ================================================ .. automodule:: savu.plugins.filters.image_interpolation - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.list_to_projections.rst b/doc/source/api/savu.plugins.filters.list_to_projections.rst index 532ca83cc..7f0a27136 100644 --- a/doc/source/api/savu.plugins.filters.list_to_projections.rst +++ b/doc/source/api/savu.plugins.filters.list_to_projections.rst @@ -2,7 +2,7 @@ savu.plugins.filters.list\_to\_projections module ================================================= .. automodule:: savu.plugins.filters.list_to_projections - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.paganin_filter.rst b/doc/source/api/savu.plugins.filters.paganin_filter.rst index 5aac266ec..cbe05fbd8 100644 --- a/doc/source/api/savu.plugins.filters.paganin_filter.rst +++ b/doc/source/api/savu.plugins.filters.paganin_filter.rst @@ -2,7 +2,7 @@ savu.plugins.filters.paganin\_filter module =========================================== .. automodule:: savu.plugins.filters.paganin_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.poly_background_estimator.rst b/doc/source/api/savu.plugins.filters.poly_background_estimator.rst index 260572257..4bd779fc9 100644 --- a/doc/source/api/savu.plugins.filters.poly_background_estimator.rst +++ b/doc/source/api/savu.plugins.filters.poly_background_estimator.rst @@ -2,7 +2,7 @@ savu.plugins.filters.poly\_background\_estimator module ======================================================= .. automodule:: savu.plugins.filters.poly_background_estimator - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.pymca.rst b/doc/source/api/savu.plugins.filters.pymca.rst index 931d80765..8078a10a7 100644 --- a/doc/source/api/savu.plugins.filters.pymca.rst +++ b/doc/source/api/savu.plugins.filters.pymca.rst @@ -2,7 +2,7 @@ savu.plugins.filters.pymca module ================================= .. automodule:: savu.plugins.filters.pymca - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.quantisation_filter.rst b/doc/source/api/savu.plugins.filters.quantisation_filter.rst index 56d2a77ba..081fe32a8 100644 --- a/doc/source/api/savu.plugins.filters.quantisation_filter.rst +++ b/doc/source/api/savu.plugins.filters.quantisation_filter.rst @@ -2,7 +2,7 @@ savu.plugins.filters.quantisation\_filter module ================================================ .. automodule:: savu.plugins.filters.quantisation_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.rst b/doc/source/api/savu.plugins.filters.rst index 4100c4abb..9076d6831 100644 --- a/doc/source/api/savu.plugins.filters.rst +++ b/doc/source/api/savu.plugins.filters.rst @@ -2,31 +2,36 @@ savu.plugins.filters package ============================ .. automodule:: savu.plugins.filters - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.filters.denoising + savu.plugins.filters.dezingers Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.filters.band_pass savu.plugins.filters.base_filter - savu.plugins.filters.ccpi_denoising_cpu - savu.plugins.filters.ccpi_denoising_gpu - savu.plugins.filters.denoise_bregman_filter savu.plugins.filters.dezinger - savu.plugins.filters.dezinger_simple - savu.plugins.filters.dezinger_sinogram + savu.plugins.filters.dezinger_deprecated savu.plugins.filters.dials_find_spots savu.plugins.filters.find_peaks savu.plugins.filters.fresnel_filter savu.plugins.filters.hilbert_filter savu.plugins.filters.image_interpolation savu.plugins.filters.list_to_projections - savu.plugins.filters.median_filter savu.plugins.filters.paganin_filter savu.plugins.filters.poly_background_estimator savu.plugins.filters.pymca @@ -35,4 +40,3 @@ Submodules savu.plugins.filters.strip_background savu.plugins.filters.threshold_filter savu.plugins.filters.umpa - diff --git a/doc/source/api/savu.plugins.filters.spectrum_crop.rst b/doc/source/api/savu.plugins.filters.spectrum_crop.rst index 70e4a62f0..ae977c606 100644 --- a/doc/source/api/savu.plugins.filters.spectrum_crop.rst +++ b/doc/source/api/savu.plugins.filters.spectrum_crop.rst @@ -2,7 +2,7 @@ savu.plugins.filters.spectrum\_crop module ========================================== .. automodule:: savu.plugins.filters.spectrum_crop - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.strip_background.rst b/doc/source/api/savu.plugins.filters.strip_background.rst index 26da14d71..df0bc7fe8 100644 --- a/doc/source/api/savu.plugins.filters.strip_background.rst +++ b/doc/source/api/savu.plugins.filters.strip_background.rst @@ -2,7 +2,7 @@ savu.plugins.filters.strip\_background module ============================================= .. automodule:: savu.plugins.filters.strip_background - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.threshold_filter.rst b/doc/source/api/savu.plugins.filters.threshold_filter.rst index 5a3c7a32d..fd9fc8dc6 100644 --- a/doc/source/api/savu.plugins.filters.threshold_filter.rst +++ b/doc/source/api/savu.plugins.filters.threshold_filter.rst @@ -2,7 +2,7 @@ savu.plugins.filters.threshold\_filter module ============================================= .. automodule:: savu.plugins.filters.threshold_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.filters.umpa.rst b/doc/source/api/savu.plugins.filters.umpa.rst index 12cb326e4..1a347bee6 100644 --- a/doc/source/api/savu.plugins.filters.umpa.rst +++ b/doc/source/api/savu.plugins.filters.umpa.rst @@ -2,7 +2,7 @@ savu.plugins.filters.umpa module ================================ .. automodule:: savu.plugins.filters.umpa - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fitters.base_fitter.rst b/doc/source/api/savu.plugins.fitters.base_fitter.rst index 2f5d13255..6f1bd3778 100644 --- a/doc/source/api/savu.plugins.fitters.base_fitter.rst +++ b/doc/source/api/savu.plugins.fitters.base_fitter.rst @@ -2,7 +2,7 @@ savu.plugins.fitters.base\_fitter module ======================================== .. automodule:: savu.plugins.fitters.base_fitter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fitters.ral_fit.rst b/doc/source/api/savu.plugins.fitters.ral_fit.rst index 5fbd8be30..ee974ffd7 100644 --- a/doc/source/api/savu.plugins.fitters.ral_fit.rst +++ b/doc/source/api/savu.plugins.fitters.ral_fit.rst @@ -2,7 +2,7 @@ savu.plugins.fitters.ral\_fit module ==================================== .. automodule:: savu.plugins.fitters.ral_fit - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fitters.reproduce_fit.rst b/doc/source/api/savu.plugins.fitters.reproduce_fit.rst index 485123e6c..6314a3490 100644 --- a/doc/source/api/savu.plugins.fitters.reproduce_fit.rst +++ b/doc/source/api/savu.plugins.fitters.reproduce_fit.rst @@ -2,7 +2,7 @@ savu.plugins.fitters.reproduce\_fit module ========================================== .. automodule:: savu.plugins.fitters.reproduce_fit - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fitters.rst b/doc/source/api/savu.plugins.fitters.rst index cc8304dc9..df71280cb 100644 --- a/doc/source/api/savu.plugins.fitters.rst +++ b/doc/source/api/savu.plugins.fitters.rst @@ -2,18 +2,18 @@ savu.plugins.fitters package ============================ .. automodule:: savu.plugins.fitters - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.fitters.base_fitter savu.plugins.fitters.ral_fit savu.plugins.fitters.reproduce_fit savu.plugins.fitters.simple_fit - diff --git a/doc/source/api/savu.plugins.fitters.simple_fit.rst b/doc/source/api/savu.plugins.fitters.simple_fit.rst index 8df06d63b..6a025e1ba 100644 --- a/doc/source/api/savu.plugins.fitters.simple_fit.rst +++ b/doc/source/api/savu.plugins.fitters.simple_fit.rst @@ -2,7 +2,7 @@ savu.plugins.fitters.simple\_fit module ======================================= .. automodule:: savu.plugins.fitters.simple_fit - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fluo_fitters.base_fluo_fitter.rst b/doc/source/api/savu.plugins.fluo_fitters.base_fluo_fitter.rst index 1a8249284..5e8e1ce3b 100644 --- a/doc/source/api/savu.plugins.fluo_fitters.base_fluo_fitter.rst +++ b/doc/source/api/savu.plugins.fluo_fitters.base_fluo_fitter.rst @@ -2,7 +2,7 @@ savu.plugins.fluo\_fitters.base\_fluo\_fitter module ==================================================== .. automodule:: savu.plugins.fluo_fitters.base_fluo_fitter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fluo_fitters.fastxrf_fitting.rst b/doc/source/api/savu.plugins.fluo_fitters.fastxrf_fitting.rst index cc594eb6b..9fe0b66a2 100644 --- a/doc/source/api/savu.plugins.fluo_fitters.fastxrf_fitting.rst +++ b/doc/source/api/savu.plugins.fluo_fitters.fastxrf_fitting.rst @@ -2,7 +2,7 @@ savu.plugins.fluo\_fitters.fastxrf\_fitting module ================================================== .. automodule:: savu.plugins.fluo_fitters.fastxrf_fitting - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.fluo_fitters.rst b/doc/source/api/savu.plugins.fluo_fitters.rst index ad981d459..fc0f41406 100644 --- a/doc/source/api/savu.plugins.fluo_fitters.rst +++ b/doc/source/api/savu.plugins.fluo_fitters.rst @@ -2,17 +2,17 @@ savu.plugins.fluo\_fitters package ================================== .. automodule:: savu.plugins.fluo_fitters - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.fluo_fitters.base_fluo_fitter savu.plugins.fluo_fitters.fastxrf_fitting savu.plugins.fluo_fitters.simple_fit_xrf - diff --git a/doc/source/api/savu.plugins.fluo_fitters.simple_fit_xrf.rst b/doc/source/api/savu.plugins.fluo_fitters.simple_fit_xrf.rst index c77a49d42..53bf727ed 100644 --- a/doc/source/api/savu.plugins.fluo_fitters.simple_fit_xrf.rst +++ b/doc/source/api/savu.plugins.fluo_fitters.simple_fit_xrf.rst @@ -2,7 +2,7 @@ savu.plugins.fluo\_fitters.simple\_fit\_xrf module ================================================== .. automodule:: savu.plugins.fluo_fitters.simple_fit_xrf - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.kinematics.rst b/doc/source/api/savu.plugins.kinematics.rst index 1bef29d02..575938194 100644 --- a/doc/source/api/savu.plugins.kinematics.rst +++ b/doc/source/api/savu.plugins.kinematics.rst @@ -2,15 +2,15 @@ savu.plugins.kinematics package =============================== .. automodule:: savu.plugins.kinematics - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.kinematics.stage_motion - diff --git a/doc/source/api/savu.plugins.kinematics.stage_motion.rst b/doc/source/api/savu.plugins.kinematics.stage_motion.rst index 19f098dd7..b2008ad3d 100644 --- a/doc/source/api/savu.plugins.kinematics.stage_motion.rst +++ b/doc/source/api/savu.plugins.kinematics.stage_motion.rst @@ -2,7 +2,7 @@ savu.plugins.kinematics.stage\_motion module ============================================ .. automodule:: savu.plugins.kinematics.stage_motion - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.base_loader.rst b/doc/source/api/savu.plugins.loaders.base_loader.rst index 8676ccaff..18b1aa7d2 100644 --- a/doc/source/api/savu.plugins.loaders.base_loader.rst +++ b/doc/source/api/savu.plugins.loaders.base_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.base\_loader module ======================================== .. automodule:: savu.plugins.loaders.base_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst index 8aaf770d7..90d6e0f09 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.full\_field\_loaders.dxchange\_loader module ================================================================= .. automodule:: savu.plugins.loaders.full_field_loaders.dxchange_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.image_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.image_loader.rst index 899615e8d..71e77ace0 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.image_loader.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.image_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.full\_field\_loaders.image\_loader module ============================================================== .. automodule:: savu.plugins.loaders.full_field_loaders.image_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.lfov_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.lfov_loader.rst new file mode 100644 index 000000000..bccb9eae5 --- /dev/null +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.lfov_loader.rst @@ -0,0 +1,8 @@ +savu.plugins.loaders.full\_field\_loaders.lfov\_loader module +============================================================= + +.. automodule:: savu.plugins.loaders.full_field_loaders.lfov_loader + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.mrc_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.mrc_loader.rst index a6f143f5a..e26ac1ce6 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.mrc_loader.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.mrc_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.full\_field\_loaders.mrc\_loader module ============================================================ .. automodule:: savu.plugins.loaders.full_field_loaders.mrc_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst index c153ad496..43acb978c 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.full\_field\_loaders.multi\_nxtomo\_loader module ====================================================================== .. automodule:: savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst index 935afd923..4284086ed 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.full\_field\_loaders.nxtomo\_loader module =============================================================== .. automodule:: savu.plugins.loaders.full_field_loaders.nxtomo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst index 207682718..c1aff566d 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.full\_field\_loaders.random\_3d\_tomo\_loader module ========================================================================= .. automodule:: savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.full_field_loaders.rst b/doc/source/api/savu.plugins.loaders.full_field_loaders.rst index f34ee8363..0271e5ed2 100644 --- a/doc/source/api/savu.plugins.loaders.full_field_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.full_field_loaders.rst @@ -2,21 +2,21 @@ savu.plugins.loaders.full\_field\_loaders package ================================================= .. automodule:: savu.plugins.loaders.full_field_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.full_field_loaders.dxchange_loader - savu.plugins.loaders.full_field_loaders.fake_nxtomo_loader savu.plugins.loaders.full_field_loaders.image_loader + savu.plugins.loaders.full_field_loaders.lfov_loader savu.plugins.loaders.full_field_loaders.mrc_loader savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader savu.plugins.loaders.full_field_loaders.nxtomo_loader savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader - diff --git a/doc/source/api/savu.plugins.loaders.hdf5_template_loader.rst b/doc/source/api/savu.plugins.loaders.hdf5_template_loader.rst index a2e1fa0fe..28fe2ab86 100644 --- a/doc/source/api/savu.plugins.loaders.hdf5_template_loader.rst +++ b/doc/source/api/savu.plugins.loaders.hdf5_template_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.hdf5\_template\_loader module ================================================== .. automodule:: savu.plugins.loaders.hdf5_template_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.image_template_loader.rst b/doc/source/api/savu.plugins.loaders.image_template_loader.rst index 02fa1a42e..ce942ff88 100644 --- a/doc/source/api/savu.plugins.loaders.image_template_loader.rst +++ b/doc/source/api/savu.plugins.loaders.image_template_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.image\_template\_loader module =================================================== .. automodule:: savu.plugins.loaders.image_template_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst index 203cce099..ff4300e05 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.base\_multi\_modal\_loader module ======================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.base_multi_modal_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst index eb98a150b..a951da9ec 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i08\_loaders.i08\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.rst index ea8e5d37b..6802dacca 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i08_loaders.rst @@ -2,15 +2,15 @@ savu.plugins.loaders.mapping\_loaders.i08\_loaders package ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i08_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader - diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst index 7a631b034..0ed0b7b52 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst index 37a722a77..da61ae3ca 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_ptycho\_loader module ============================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst index 70e0776f9..8907b1f9c 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_speckle\_loader module ============================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst index e9ae0fe7b..7b7f77f69 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_stxm\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst index 0d84fab35..603412cb8 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_stxm\_monitor\_loader mo ==================================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst index 084cf709b..e511a9d15 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_stxm\_xrf\_loader module ================================================================================ .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.rst index 048511548..5ffca5655 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i13_loaders.rst @@ -2,15 +2,16 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders package ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader @@ -18,4 +19,3 @@ Submodules savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader - diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst index be61ca9a5..740177259 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i14\_loaders.i14\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.rst index 1bdb3fbf9..f37f0386f 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i14_loaders.rst @@ -2,15 +2,15 @@ savu.plugins.loaders.mapping\_loaders.i14\_loaders package ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i14_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader - diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst index a96a44c9b..85164d474 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.base\_i18\_multi\_modal\_load ========================================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst index 612252e42..36d068e86 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst index 80e20c512..ada5043df 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_mm\_loader module ========================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst index ab3c8d591..1bf162598 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_monitor\_loader module ============================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst index 7991e2b0d..88a891087 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_stxm\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst index 6151f4c7e..1ecfd66b9 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_xrd\_loader module ========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.rst index 56a360ce3..94a099d42 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i18_loaders.rst @@ -2,15 +2,16 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders package ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader @@ -18,4 +19,3 @@ Submodules savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader - diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst index 11032759f..aa96d2c08 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.i22\_loaders.i22\_tomo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.rst index fcd40fb33..bef9881d4 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.i22_loaders.rst @@ -2,15 +2,15 @@ savu.plugins.loaders.mapping\_loaders.i22\_loaders package ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i22_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader - diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.mm_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.mm_loader.rst index 0dbb57a35..a195d729e 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.mm_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.mm_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.mm\_loader module ======================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.mm_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst index 7a34cf87c..558aa33c5 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.nxfluo\_loader module =========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxfluo_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst index 22c34fe23..402179560 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.nxmonitor\_loader module ============================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxmonitor_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst index c1199d695..152328273 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.nxptycho\_loader module ============================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.nxptycho_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst index ac322275f..1c5fc5569 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.nxstxm\_loader module =========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxstxm_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst index 4e6ba87de..206fb0b16 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.nxxrd\_loader module ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxxrd_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst index ac3337637..ad5316cf2 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.p2r\_fly\_scan\_detector\_loader module ============================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.rst index 9e82ece3c..311f9bbcb 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.rst @@ -2,26 +2,27 @@ savu.plugins.loaders.mapping\_loaders package ============================================= .. automodule:: savu.plugins.loaders.mapping_loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.loaders.mapping_loaders.i08_loaders - savu.plugins.loaders.mapping_loaders.i13_loaders - savu.plugins.loaders.mapping_loaders.i14_loaders - savu.plugins.loaders.mapping_loaders.i18_loaders - savu.plugins.loaders.mapping_loaders.i22_loaders + savu.plugins.loaders.mapping_loaders.i08_loaders + savu.plugins.loaders.mapping_loaders.i13_loaders + savu.plugins.loaders.mapping_loaders.i14_loaders + savu.plugins.loaders.mapping_loaders.i22_loaders Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.base_multi_modal_loader savu.plugins.loaders.mapping_loaders.mm_loader @@ -32,4 +33,3 @@ Submodules savu.plugins.loaders.mapping_loaders.nxxrd_loader savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader savu.plugins.loaders.mapping_loaders.txm_loader - diff --git a/doc/source/api/savu.plugins.loaders.mapping_loaders.txm_loader.rst b/doc/source/api/savu.plugins.loaders.mapping_loaders.txm_loader.rst index 39a9a6979..eb3aabaf2 100644 --- a/doc/source/api/savu.plugins.loaders.mapping_loaders.txm_loader.rst +++ b/doc/source/api/savu.plugins.loaders.mapping_loaders.txm_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.mapping\_loaders.txm\_loader module ======================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.txm_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.multi_savu_loader.rst b/doc/source/api/savu.plugins.loaders.multi_savu_loader.rst index f2edfe552..648260e7a 100644 --- a/doc/source/api/savu.plugins.loaders.multi_savu_loader.rst +++ b/doc/source/api/savu.plugins.loaders.multi_savu_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.multi\_savu\_loader module =============================================== .. automodule:: savu.plugins.loaders.multi_savu_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.random_hdf5_loader.rst b/doc/source/api/savu.plugins.loaders.random_hdf5_loader.rst index 2fa0fcebf..568a1871b 100644 --- a/doc/source/api/savu.plugins.loaders.random_hdf5_loader.rst +++ b/doc/source/api/savu.plugins.loaders.random_hdf5_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.random\_hdf5\_loader module ================================================ .. automodule:: savu.plugins.loaders.random_hdf5_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.rst b/doc/source/api/savu.plugins.loaders.rst index ad3e711e3..5dd3e82f0 100644 --- a/doc/source/api/savu.plugins.loaders.rst +++ b/doc/source/api/savu.plugins.loaders.rst @@ -2,24 +2,27 @@ savu.plugins.loaders package ============================ .. automodule:: savu.plugins.loaders - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.loaders.full_field_loaders - savu.plugins.loaders.mapping_loaders - savu.plugins.loaders.utils + savu.plugins.loaders.full_field_loaders + savu.plugins.loaders.mapping_loaders + savu.plugins.loaders.templates + savu.plugins.loaders.utils Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.base_loader savu.plugins.loaders.hdf5_template_loader @@ -27,6 +30,4 @@ Submodules savu.plugins.loaders.multi_savu_loader savu.plugins.loaders.random_hdf5_loader savu.plugins.loaders.savu_nexus_loader - savu.plugins.loaders.stitch_data_template_loader savu.plugins.loaders.yaml_converter - diff --git a/doc/source/api/savu.plugins.loaders.savu_nexus_loader.rst b/doc/source/api/savu.plugins.loaders.savu_nexus_loader.rst index 80f7b6bc1..abde1bd52 100644 --- a/doc/source/api/savu.plugins.loaders.savu_nexus_loader.rst +++ b/doc/source/api/savu.plugins.loaders.savu_nexus_loader.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.savu\_nexus\_loader module =============================================== .. automodule:: savu.plugins.loaders.savu_nexus_loader - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.templates.malcolm_templates.rst b/doc/source/api/savu.plugins.loaders.templates.malcolm_templates.rst new file mode 100644 index 000000000..0de5d2476 --- /dev/null +++ b/doc/source/api/savu.plugins.loaders.templates.malcolm_templates.rst @@ -0,0 +1,8 @@ +savu.plugins.loaders.templates.malcolm\_templates package +========================================================= + +.. automodule:: savu.plugins.loaders.templates.malcolm_templates + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.templates.rst b/doc/source/api/savu.plugins.loaders.templates.rst new file mode 100644 index 000000000..ac791f6eb --- /dev/null +++ b/doc/source/api/savu.plugins.loaders.templates.rst @@ -0,0 +1,16 @@ +savu.plugins.loaders.templates package +====================================== + +.. automodule:: savu.plugins.loaders.templates + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.loaders.templates.malcolm_templates diff --git a/doc/source/api/savu.plugins.loaders.utils.rst b/doc/source/api/savu.plugins.loaders.utils.rst index ff92049f5..8f5acd29e 100644 --- a/doc/source/api/savu.plugins.loaders.utils.rst +++ b/doc/source/api/savu.plugins.loaders.utils.rst @@ -2,16 +2,15 @@ savu.plugins.loaders.utils package ================================== .. automodule:: savu.plugins.loaders.utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.plugins.loaders.utils.mrc_header savu.plugins.loaders.utils.yaml_utils - diff --git a/doc/source/api/savu.plugins.loaders.utils.yaml_utils.rst b/doc/source/api/savu.plugins.loaders.utils.yaml_utils.rst index ea89267cb..c63c2f4c4 100644 --- a/doc/source/api/savu.plugins.loaders.utils.yaml_utils.rst +++ b/doc/source/api/savu.plugins.loaders.utils.yaml_utils.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.utils.yaml\_utils module ============================================= .. automodule:: savu.plugins.loaders.utils.yaml_utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.loaders.yaml_converter.rst b/doc/source/api/savu.plugins.loaders.yaml_converter.rst index 46386e271..ecc75c3e9 100644 --- a/doc/source/api/savu.plugins.loaders.yaml_converter.rst +++ b/doc/source/api/savu.plugins.loaders.yaml_converter.rst @@ -2,7 +2,7 @@ savu.plugins.loaders.yaml\_converter module =========================================== .. automodule:: savu.plugins.loaders.yaml_converter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.missing_data.rst b/doc/source/api/savu.plugins.missing_data.rst index 3680b4d82..6533ffe3d 100644 --- a/doc/source/api/savu.plugins.missing_data.rst +++ b/doc/source/api/savu.plugins.missing_data.rst @@ -2,8 +2,7 @@ savu.plugins.missing\_data package ================================== .. automodule:: savu.plugins.missing_data - :members: - :private-members: - :undoc-members: - :show-inheritance: - + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.plugin.rst b/doc/source/api/savu.plugins.plugin.rst index 49b5bed04..325e5f744 100644 --- a/doc/source/api/savu.plugins.plugin.rst +++ b/doc/source/api/savu.plugins.plugin.rst @@ -2,7 +2,7 @@ savu.plugins.plugin module ========================== .. automodule:: savu.plugins.plugin - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.plugin_datasets.rst b/doc/source/api/savu.plugins.plugin_datasets.rst index ef76cb863..e187cf8e6 100644 --- a/doc/source/api/savu.plugins.plugin_datasets.rst +++ b/doc/source/api/savu.plugins.plugin_datasets.rst @@ -2,7 +2,7 @@ savu.plugins.plugin\_datasets module ==================================== .. automodule:: savu.plugins.plugin_datasets - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.plugin_datasets_notes.rst b/doc/source/api/savu.plugins.plugin_datasets_notes.rst index d9579d8f7..a24e8fd80 100644 --- a/doc/source/api/savu.plugins.plugin_datasets_notes.rst +++ b/doc/source/api/savu.plugins.plugin_datasets_notes.rst @@ -2,7 +2,7 @@ savu.plugins.plugin\_datasets\_notes module =========================================== .. automodule:: savu.plugins.plugin_datasets_notes - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ptychography.base_ptycho.rst b/doc/source/api/savu.plugins.ptychography.base_ptycho.rst index 254dc3dd8..7ed9f1f1d 100644 --- a/doc/source/api/savu.plugins.ptychography.base_ptycho.rst +++ b/doc/source/api/savu.plugins.ptychography.base_ptycho.rst @@ -2,7 +2,7 @@ savu.plugins.ptychography.base\_ptycho module ============================================= .. automodule:: savu.plugins.ptychography.base_ptycho - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ptychography.dummy_ptycho.rst b/doc/source/api/savu.plugins.ptychography.dummy_ptycho.rst index dc31630a3..c15ee6e26 100644 --- a/doc/source/api/savu.plugins.ptychography.dummy_ptycho.rst +++ b/doc/source/api/savu.plugins.ptychography.dummy_ptycho.rst @@ -2,7 +2,7 @@ savu.plugins.ptychography.dummy\_ptycho module ============================================== .. automodule:: savu.plugins.ptychography.dummy_ptycho - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ptychography.ptypy_batch.rst b/doc/source/api/savu.plugins.ptychography.ptypy_batch.rst index 99d7d7861..6c77962d8 100644 --- a/doc/source/api/savu.plugins.ptychography.ptypy_batch.rst +++ b/doc/source/api/savu.plugins.ptychography.ptypy_batch.rst @@ -2,7 +2,7 @@ savu.plugins.ptychography.ptypy\_batch module ============================================= .. automodule:: savu.plugins.ptychography.ptypy_batch - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ptychography.ptypy_compact.rst b/doc/source/api/savu.plugins.ptychography.ptypy_compact.rst index 580dd1206..7ee9c7e54 100644 --- a/doc/source/api/savu.plugins.ptychography.ptypy_compact.rst +++ b/doc/source/api/savu.plugins.ptychography.ptypy_compact.rst @@ -2,7 +2,7 @@ savu.plugins.ptychography.ptypy\_compact module =============================================== .. automodule:: savu.plugins.ptychography.ptypy_compact - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ptychography.rst b/doc/source/api/savu.plugins.ptychography.rst index 29e6b3027..520322425 100644 --- a/doc/source/api/savu.plugins.ptychography.rst +++ b/doc/source/api/savu.plugins.ptychography.rst @@ -2,18 +2,18 @@ savu.plugins.ptychography package ================================= .. automodule:: savu.plugins.ptychography - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.ptychography.base_ptycho savu.plugins.ptychography.dummy_ptycho savu.plugins.ptychography.ptypy_batch savu.plugins.ptychography.ptypy_compact - diff --git a/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst b/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst index 566bf13bc..d65c02d12 100644 --- a/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst +++ b/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.astra\_recons.astra\_recon\_cpu module =================================================================== .. automodule:: savu.plugins.reconstructions.astra_recons.astra_recon_cpu - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst b/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst index 300050ccf..aeeb7cfd8 100644 --- a/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst +++ b/doc/source/api/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.astra\_recons.astra\_recon\_gpu module =================================================================== .. automodule:: savu.plugins.reconstructions.astra_recons.astra_recon_gpu - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst b/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst index d3a67c179..6bddf2b65 100644 --- a/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst +++ b/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.astra\_recons.base\_astra\_recon module ==================================================================== .. automodule:: savu.plugins.reconstructions.astra_recons.base_astra_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon.rst b/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon.rst new file mode 100644 index 000000000..9a005f63d --- /dev/null +++ b/doc/source/api/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon.rst @@ -0,0 +1,8 @@ +savu.plugins.reconstructions.astra\_recons.base\_astra\_vector\_recon module +============================================================================ + +.. automodule:: savu.plugins.reconstructions.astra_recons.base_astra_vector_recon + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.astra_recons.rst b/doc/source/api/savu.plugins.reconstructions.astra_recons.rst index cc305c21a..6ef60ed58 100644 --- a/doc/source/api/savu.plugins.reconstructions.astra_recons.rst +++ b/doc/source/api/savu.plugins.reconstructions.astra_recons.rst @@ -2,17 +2,18 @@ savu.plugins.reconstructions.astra\_recons package ================================================== .. automodule:: savu.plugins.reconstructions.astra_recons - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.reconstructions.astra_recons.astra_recon_cpu savu.plugins.reconstructions.astra_recons.astra_recon_gpu savu.plugins.reconstructions.astra_recons.base_astra_recon - + savu.plugins.reconstructions.astra_recons.base_astra_vector_recon diff --git a/doc/source/api/savu.plugins.reconstructions.base_recon.rst b/doc/source/api/savu.plugins.reconstructions.base_recon.rst index 981124afd..25be30569 100644 --- a/doc/source/api/savu.plugins.reconstructions.base_recon.rst +++ b/doc/source/api/savu.plugins.reconstructions.base_recon.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.base\_recon module =============================================== .. automodule:: savu.plugins.reconstructions.base_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.ccpi_cgls_recon.rst b/doc/source/api/savu.plugins.reconstructions.ccpi_cgls_recon.rst index 385347291..27b91199a 100644 --- a/doc/source/api/savu.plugins.reconstructions.ccpi_cgls_recon.rst +++ b/doc/source/api/savu.plugins.reconstructions.ccpi_cgls_recon.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.ccpi\_cgls\_recon module ===================================================== .. automodule:: savu.plugins.reconstructions.ccpi_cgls_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.rst b/doc/source/api/savu.plugins.reconstructions.rst index e0f8c2787..07677bd60 100644 --- a/doc/source/api/savu.plugins.reconstructions.rst +++ b/doc/source/api/savu.plugins.reconstructions.rst @@ -2,31 +2,29 @@ savu.plugins.reconstructions package ==================================== .. automodule:: savu.plugins.reconstructions - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.reconstructions.astra_recons + savu.plugins.reconstructions.astra_recons + savu.plugins.reconstructions.tomobar Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.reconstructions.base_recon - savu.plugins.reconstructions.ccpi_cgls_recon savu.plugins.reconstructions.scikitimage_filter_back_projection savu.plugins.reconstructions.scikitimage_sart savu.plugins.reconstructions.simple_recon - savu.plugins.reconstructions.tomobar_recon - savu.plugins.reconstructions.tomobar_recon_3D - savu.plugins.reconstructions.tomobar_recon_cpu savu.plugins.reconstructions.tomopy_recon savu.plugins.reconstructions.visual_hulls_recon - diff --git a/doc/source/api/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst b/doc/source/api/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst index e4ff235de..33be81ecb 100644 --- a/doc/source/api/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst +++ b/doc/source/api/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.scikitimage\_filter\_back\_projection module ========================================================================= .. automodule:: savu.plugins.reconstructions.scikitimage_filter_back_projection - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.scikitimage_sart.rst b/doc/source/api/savu.plugins.reconstructions.scikitimage_sart.rst index ff9b41da0..7b097ad7d 100644 --- a/doc/source/api/savu.plugins.reconstructions.scikitimage_sart.rst +++ b/doc/source/api/savu.plugins.reconstructions.scikitimage_sart.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.scikitimage\_sart module ===================================================== .. automodule:: savu.plugins.reconstructions.scikitimage_sart - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.simple_recon.rst b/doc/source/api/savu.plugins.reconstructions.simple_recon.rst index 437b27f64..732fca222 100644 --- a/doc/source/api/savu.plugins.reconstructions.simple_recon.rst +++ b/doc/source/api/savu.plugins.reconstructions.simple_recon.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.simple\_recon module ================================================= .. automodule:: savu.plugins.reconstructions.simple_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.tomobar.rst b/doc/source/api/savu.plugins.reconstructions.tomobar.rst new file mode 100644 index 000000000..d3221d13a --- /dev/null +++ b/doc/source/api/savu.plugins.reconstructions.tomobar.rst @@ -0,0 +1,18 @@ +savu.plugins.reconstructions.tomobar package +============================================ + +.. automodule:: savu.plugins.reconstructions.tomobar + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.reconstructions.tomobar.tomobar_recon + savu.plugins.reconstructions.tomobar.tomobar_recon_3D + savu.plugins.reconstructions.tomobar.tomobar_recon_cpu diff --git a/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon.rst b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon.rst new file mode 100644 index 000000000..0f6dbb01f --- /dev/null +++ b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon.rst @@ -0,0 +1,8 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon module +========================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_3D.rst b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_3D.rst new file mode 100644 index 000000000..b52539962 --- /dev/null +++ b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_3D.rst @@ -0,0 +1,8 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon\_3D module +============================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon_3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu.rst b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu.rst new file mode 100644 index 000000000..c97fd6022 --- /dev/null +++ b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu.rst @@ -0,0 +1,8 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon\_cpu module +=============================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon_cpu + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D.rst b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D.rst new file mode 100644 index 000000000..9d668af4f --- /dev/null +++ b/doc/source/api/savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D.rst @@ -0,0 +1,8 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon\_fully\_3D module +===================================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.tomopy_recon.rst b/doc/source/api/savu.plugins.reconstructions.tomopy_recon.rst index a703a07c5..33931b362 100644 --- a/doc/source/api/savu.plugins.reconstructions.tomopy_recon.rst +++ b/doc/source/api/savu.plugins.reconstructions.tomopy_recon.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.tomopy\_recon module ================================================= .. automodule:: savu.plugins.reconstructions.tomopy_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reconstructions.visual_hulls_recon.rst b/doc/source/api/savu.plugins.reconstructions.visual_hulls_recon.rst index 9f927e9f0..770044c02 100644 --- a/doc/source/api/savu.plugins.reconstructions.visual_hulls_recon.rst +++ b/doc/source/api/savu.plugins.reconstructions.visual_hulls_recon.rst @@ -2,7 +2,7 @@ savu.plugins.reconstructions.visual\_hulls\_recon module ======================================================== .. automodule:: savu.plugins.reconstructions.visual_hulls_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reshape.data_removal.rst b/doc/source/api/savu.plugins.reshape.data_removal.rst index e3ae25f92..8f325122a 100644 --- a/doc/source/api/savu.plugins.reshape.data_removal.rst +++ b/doc/source/api/savu.plugins.reshape.data_removal.rst @@ -2,7 +2,7 @@ savu.plugins.reshape.data\_removal module ========================================= .. automodule:: savu.plugins.reshape.data_removal - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reshape.downsample_filter.rst b/doc/source/api/savu.plugins.reshape.downsample_filter.rst index f6b826063..6dd09cc82 100644 --- a/doc/source/api/savu.plugins.reshape.downsample_filter.rst +++ b/doc/source/api/savu.plugins.reshape.downsample_filter.rst @@ -2,7 +2,7 @@ savu.plugins.reshape.downsample\_filter module ============================================== .. automodule:: savu.plugins.reshape.downsample_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reshape.image_stitching.rst b/doc/source/api/savu.plugins.reshape.image_stitching.rst new file mode 100644 index 000000000..c126a2b4a --- /dev/null +++ b/doc/source/api/savu.plugins.reshape.image_stitching.rst @@ -0,0 +1,8 @@ +savu.plugins.reshape.image\_stitching module +============================================ + +.. automodule:: savu.plugins.reshape.image_stitching + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reshape.mipmap.rst b/doc/source/api/savu.plugins.reshape.mipmap.rst index 994a96741..1bad403c6 100644 --- a/doc/source/api/savu.plugins.reshape.mipmap.rst +++ b/doc/source/api/savu.plugins.reshape.mipmap.rst @@ -2,7 +2,7 @@ savu.plugins.reshape.mipmap module ================================== .. automodule:: savu.plugins.reshape.mipmap - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.reshape.rst b/doc/source/api/savu.plugins.reshape.rst index d3824b78f..2ea4ff9b0 100644 --- a/doc/source/api/savu.plugins.reshape.rst +++ b/doc/source/api/savu.plugins.reshape.rst @@ -2,17 +2,18 @@ savu.plugins.reshape package ============================ .. automodule:: savu.plugins.reshape - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.reshape.data_removal savu.plugins.reshape.downsample_filter + savu.plugins.reshape.image_stitching savu.plugins.reshape.mipmap - diff --git a/doc/source/api/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst b/doc/source/api/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst index 0eb77907b..7567d3d24 100644 --- a/doc/source/api/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst +++ b/doc/source/api/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ccpi\_ring\_artefact\_filter module ============================================================== .. automodule:: savu.plugins.ring_removal.ccpi_ring_artefact_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.raven_filter.rst b/doc/source/api/savu.plugins.ring_removal.raven_filter.rst index e82565259..7cc57ae16 100644 --- a/doc/source/api/savu.plugins.ring_removal.raven_filter.rst +++ b/doc/source/api/savu.plugins.ring_removal.raven_filter.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.raven\_filter module =============================================== .. automodule:: savu.plugins.ring_removal.raven_filter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.remove_all_rings.rst b/doc/source/api/savu.plugins.ring_removal.remove_all_rings.rst index 9d2c5186e..efc9885dc 100644 --- a/doc/source/api/savu.plugins.ring_removal.remove_all_rings.rst +++ b/doc/source/api/savu.plugins.ring_removal.remove_all_rings.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.remove\_all\_rings module ==================================================== .. automodule:: savu.plugins.ring_removal.remove_all_rings - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.remove_large_rings.rst b/doc/source/api/savu.plugins.ring_removal.remove_large_rings.rst index 37111583a..aa7d375ef 100644 --- a/doc/source/api/savu.plugins.ring_removal.remove_large_rings.rst +++ b/doc/source/api/savu.plugins.ring_removal.remove_large_rings.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.remove\_large\_rings module ====================================================== .. automodule:: savu.plugins.ring_removal.remove_large_rings - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst b/doc/source/api/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst index 4b67c97f1..2dfb4e56f 100644 --- a/doc/source/api/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst +++ b/doc/source/api/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.remove\_unresponsive\_and\_fluctuating\_rings module =============================================================================== .. automodule:: savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_filtering.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_filtering.rst index 0cb0c5ec7..c664eb41c 100644 --- a/doc/source/api/savu.plugins.ring_removal.ring_removal_filtering.rst +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_filtering.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ring\_removal\_filtering module ========================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_filtering - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_fitting.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_fitting.rst index 8105d96c0..b40b0fe59 100644 --- a/doc/source/api/savu.plugins.ring_removal.ring_removal_fitting.rst +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_fitting.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ring\_removal\_fitting module ======================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_fitting - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_interpolation.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_interpolation.rst new file mode 100644 index 000000000..3e065eac6 --- /dev/null +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_interpolation.rst @@ -0,0 +1,8 @@ +savu.plugins.ring\_removal.ring\_removal\_interpolation module +============================================================== + +.. automodule:: savu.plugins.ring_removal.ring_removal_interpolation + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_normalization.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_normalization.rst index e6016d8f6..c1f1a627a 100644 --- a/doc/source/api/savu.plugins.ring_removal.ring_removal_normalization.rst +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_normalization.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ring\_removal\_normalization module ============================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_normalization - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_regularization.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_regularization.rst index 4c6662444..65b76f7ff 100644 --- a/doc/source/api/savu.plugins.ring_removal.ring_removal_regularization.rst +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_regularization.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ring\_removal\_regularization module =============================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_regularization - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_sorting.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_sorting.rst index a40cfbacb..87912b08c 100644 --- a/doc/source/api/savu.plugins.ring_removal.ring_removal_sorting.rst +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_sorting.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ring\_removal\_sorting module ======================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_sorting - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.ring_removal_waveletfft.rst b/doc/source/api/savu.plugins.ring_removal.ring_removal_waveletfft.rst index e307ea399..fede2617c 100644 --- a/doc/source/api/savu.plugins.ring_removal.ring_removal_waveletfft.rst +++ b/doc/source/api/savu.plugins.ring_removal.ring_removal_waveletfft.rst @@ -2,7 +2,7 @@ savu.plugins.ring\_removal.ring\_removal\_waveletfft module =========================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_waveletfft - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.ring_removal.rst b/doc/source/api/savu.plugins.ring_removal.rst index 4caead664..2cef4b952 100644 --- a/doc/source/api/savu.plugins.ring_removal.rst +++ b/doc/source/api/savu.plugins.ring_removal.rst @@ -2,15 +2,16 @@ savu.plugins.ring\_removal package ================================== .. automodule:: savu.plugins.ring_removal - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.ring_removal.ccpi_ring_artefact_filter savu.plugins.ring_removal.raven_filter @@ -19,8 +20,8 @@ Submodules savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings savu.plugins.ring_removal.ring_removal_filtering savu.plugins.ring_removal.ring_removal_fitting + savu.plugins.ring_removal.ring_removal_interpolation savu.plugins.ring_removal.ring_removal_normalization savu.plugins.ring_removal.ring_removal_regularization savu.plugins.ring_removal.ring_removal_sorting savu.plugins.ring_removal.ring_removal_waveletfft - diff --git a/doc/source/api/savu.plugins.rst b/doc/source/api/savu.plugins.rst index f0461ab32..205f04eb3 100644 --- a/doc/source/api/savu.plugins.rst +++ b/doc/source/api/savu.plugins.rst @@ -2,49 +2,50 @@ savu.plugins package ==================== .. automodule:: savu.plugins - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: - - savu.plugins.absorption_corrections - savu.plugins.alignment - savu.plugins.analysis - savu.plugins.azimuthal_integrators - savu.plugins.basic_operations - savu.plugins.centering - savu.plugins.component_analysis - savu.plugins.corrections - savu.plugins.developing - savu.plugins.driver - savu.plugins.filters - savu.plugins.fitters - savu.plugins.fluo_fitters - savu.plugins.kinematics - savu.plugins.loaders - savu.plugins.missing_data - savu.plugins.ptychography - savu.plugins.reconstructions - savu.plugins.reshape - savu.plugins.ring_removal - savu.plugins.savers - savu.plugins.segmentation - savu.plugins.stats - savu.plugins.visualisation + :maxdepth: 4 + + savu.plugins.absorption_corrections + savu.plugins.alignment + savu.plugins.analysis + savu.plugins.azimuthal_integrators + savu.plugins.basic_operations + savu.plugins.centering + savu.plugins.component_analysis + savu.plugins.corrections + savu.plugins.developing + savu.plugins.driver + savu.plugins.filters + savu.plugins.fitters + savu.plugins.kinematics + savu.plugins.loaders + savu.plugins.missing_data + savu.plugins.ptychography + savu.plugins.reconstructions + savu.plugins.reshape + savu.plugins.ring_removal + savu.plugins.savers + savu.plugins.segmentation + savu.plugins.simulation + savu.plugins.stats + savu.plugins.visualisation Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.docstring_parser savu.plugins.plugin savu.plugins.plugin_datasets savu.plugins.plugin_datasets_notes savu.plugins.utils - diff --git a/doc/source/api/savu.plugins.savers.base_image_saver.rst b/doc/source/api/savu.plugins.savers.base_image_saver.rst index 1be06c55b..fce7e4fe2 100644 --- a/doc/source/api/savu.plugins.savers.base_image_saver.rst +++ b/doc/source/api/savu.plugins.savers.base_image_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.base\_image\_saver module ============================================= .. automodule:: savu.plugins.savers.base_image_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.base_saver.rst b/doc/source/api/savu.plugins.savers.base_saver.rst index 85638aa58..602320d9a 100644 --- a/doc/source/api/savu.plugins.savers.base_saver.rst +++ b/doc/source/api/savu.plugins.savers.base_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.base\_saver module ====================================== .. automodule:: savu.plugins.savers.base_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.edf_saver.rst b/doc/source/api/savu.plugins.savers.edf_saver.rst index 3e5b27a7a..cd57924b1 100644 --- a/doc/source/api/savu.plugins.savers.edf_saver.rst +++ b/doc/source/api/savu.plugins.savers.edf_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.edf\_saver module ===================================== .. automodule:: savu.plugins.savers.edf_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.hdf5_saver.rst b/doc/source/api/savu.plugins.savers.hdf5_saver.rst index c79d1da7c..929bf130b 100644 --- a/doc/source/api/savu.plugins.savers.hdf5_saver.rst +++ b/doc/source/api/savu.plugins.savers.hdf5_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.hdf5\_saver module ====================================== .. automodule:: savu.plugins.savers.hdf5_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.image_saver.rst b/doc/source/api/savu.plugins.savers.image_saver.rst index 5cf6f5071..3cbb2cdaf 100644 --- a/doc/source/api/savu.plugins.savers.image_saver.rst +++ b/doc/source/api/savu.plugins.savers.image_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.image\_saver module ======================================= .. automodule:: savu.plugins.savers.image_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.rst b/doc/source/api/savu.plugins.savers.rst index d73dc2771..8264f4af0 100644 --- a/doc/source/api/savu.plugins.savers.rst +++ b/doc/source/api/savu.plugins.savers.rst @@ -2,22 +2,24 @@ savu.plugins.savers package =========================== .. automodule:: savu.plugins.savers - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.savers.utils + savu.plugins.savers.utils Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.savers.base_image_saver savu.plugins.savers.base_saver @@ -26,4 +28,3 @@ Submodules savu.plugins.savers.image_saver savu.plugins.savers.tiff_saver savu.plugins.savers.xrf_saver - diff --git a/doc/source/api/savu.plugins.savers.tiff_saver.rst b/doc/source/api/savu.plugins.savers.tiff_saver.rst index 66c1a0f0c..a4f62eddc 100644 --- a/doc/source/api/savu.plugins.savers.tiff_saver.rst +++ b/doc/source/api/savu.plugins.savers.tiff_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.tiff\_saver module ====================================== .. automodule:: savu.plugins.savers.tiff_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.utils.hdf5_utils.rst b/doc/source/api/savu.plugins.savers.utils.hdf5_utils.rst index a479f5c45..70e1a5f20 100644 --- a/doc/source/api/savu.plugins.savers.utils.hdf5_utils.rst +++ b/doc/source/api/savu.plugins.savers.utils.hdf5_utils.rst @@ -2,7 +2,7 @@ savu.plugins.savers.utils.hdf5\_utils module ============================================ .. automodule:: savu.plugins.savers.utils.hdf5_utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.savers.utils.rst b/doc/source/api/savu.plugins.savers.utils.rst index 360443871..1c5cbd62e 100644 --- a/doc/source/api/savu.plugins.savers.utils.rst +++ b/doc/source/api/savu.plugins.savers.utils.rst @@ -2,15 +2,15 @@ savu.plugins.savers.utils package ================================= .. automodule:: savu.plugins.savers.utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.savers.utils.hdf5_utils - diff --git a/doc/source/api/savu.plugins.savers.xrf_saver.rst b/doc/source/api/savu.plugins.savers.xrf_saver.rst index 6fe479e11..c0b833f61 100644 --- a/doc/source/api/savu.plugins.savers.xrf_saver.rst +++ b/doc/source/api/savu.plugins.savers.xrf_saver.rst @@ -2,7 +2,7 @@ savu.plugins.savers.xrf\_saver module ===================================== .. automodule:: savu.plugins.savers.xrf_saver - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.evolving_contours.morph_snakes.rst b/doc/source/api/savu.plugins.segmentation.evolving_contours.morph_snakes.rst new file mode 100644 index 000000000..b30f602c5 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.evolving_contours.morph_snakes.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.evolving\_contours.morph\_snakes module +================================================================= + +.. automodule:: savu.plugins.segmentation.evolving_contours.morph_snakes + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.evolving_contours.morph_snakes3D.rst b/doc/source/api/savu.plugins.segmentation.evolving_contours.morph_snakes3D.rst new file mode 100644 index 000000000..9e1e47494 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.evolving_contours.morph_snakes3D.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.evolving\_contours.morph\_snakes3D module +=================================================================== + +.. automodule:: savu.plugins.segmentation.evolving_contours.morph_snakes3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.evolving_contours.region_grow.rst b/doc/source/api/savu.plugins.segmentation.evolving_contours.region_grow.rst new file mode 100644 index 000000000..a76183898 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.evolving_contours.region_grow.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.evolving\_contours.region\_grow module +================================================================ + +.. automodule:: savu.plugins.segmentation.evolving_contours.region_grow + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.evolving_contours.region_grow3D.rst b/doc/source/api/savu.plugins.segmentation.evolving_contours.region_grow3D.rst new file mode 100644 index 000000000..84c187bd1 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.evolving_contours.region_grow3D.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.evolving\_contours.region\_grow3D module +================================================================== + +.. automodule:: savu.plugins.segmentation.evolving_contours.region_grow3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.evolving_contours.rst b/doc/source/api/savu.plugins.segmentation.evolving_contours.rst new file mode 100644 index 000000000..21508a225 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.evolving_contours.rst @@ -0,0 +1,19 @@ +savu.plugins.segmentation.evolving\_contours package +==================================================== + +.. automodule:: savu.plugins.segmentation.evolving_contours + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.evolving_contours.morph_snakes + savu.plugins.segmentation.evolving_contours.morph_snakes3D + savu.plugins.segmentation.evolving_contours.region_grow + savu.plugins.segmentation.evolving_contours.region_grow3D diff --git a/doc/source/api/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D.rst b/doc/source/api/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D.rst new file mode 100644 index 000000000..244e7f4a5 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.gaussian\_mixtures.gmm\_segment3D module +================================================================== + +.. automodule:: savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.gaussian_mixtures.rst b/doc/source/api/savu.plugins.segmentation.gaussian_mixtures.rst new file mode 100644 index 000000000..a3878a851 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.gaussian_mixtures.rst @@ -0,0 +1,16 @@ +savu.plugins.segmentation.gaussian\_mixtures package +==================================================== + +.. automodule:: savu.plugins.segmentation.gaussian_mixtures + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D diff --git a/doc/source/api/savu.plugins.segmentation.geo_distance.geo_distance.rst b/doc/source/api/savu.plugins.segmentation.geo_distance.geo_distance.rst new file mode 100644 index 000000000..755cb5381 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.geo_distance.geo_distance.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.geo\_distance.geo\_distance module +============================================================ + +.. automodule:: savu.plugins.segmentation.geo_distance.geo_distance + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.geo_distance.geo_distance3D.rst b/doc/source/api/savu.plugins.segmentation.geo_distance.geo_distance3D.rst new file mode 100644 index 000000000..680dbfec2 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.geo_distance.geo_distance3D.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.geo\_distance.geo\_distance3D module +============================================================== + +.. automodule:: savu.plugins.segmentation.geo_distance.geo_distance3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.geo_distance.rst b/doc/source/api/savu.plugins.segmentation.geo_distance.rst index 559383183..14644cf04 100644 --- a/doc/source/api/savu.plugins.segmentation.geo_distance.rst +++ b/doc/source/api/savu.plugins.segmentation.geo_distance.rst @@ -1,8 +1,17 @@ -savu.plugins.segmentation.geo\_distance module -============================================== +savu.plugins.segmentation.geo\_distance package +=============================================== .. automodule:: savu.plugins.segmentation.geo_distance - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.geo_distance.geo_distance + savu.plugins.segmentation.geo_distance.geo_distance3D diff --git a/doc/source/api/savu.plugins.segmentation.masks_initialise.mask_initialiser.rst b/doc/source/api/savu.plugins.segmentation.masks_initialise.mask_initialiser.rst new file mode 100644 index 000000000..9c2510fc5 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.masks_initialise.mask_initialiser.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.masks\_initialise.mask\_initialiser module +==================================================================== + +.. automodule:: savu.plugins.segmentation.masks_initialise.mask_initialiser + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.masks_initialise.rst b/doc/source/api/savu.plugins.segmentation.masks_initialise.rst new file mode 100644 index 000000000..b9e48d814 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.masks_initialise.rst @@ -0,0 +1,16 @@ +savu.plugins.segmentation.masks\_initialise package +=================================================== + +.. automodule:: savu.plugins.segmentation.masks_initialise + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.masks_initialise.mask_initialiser diff --git a/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc.rst b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc.rst index 58e75c40e..6192986f7 100644 --- a/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc.rst +++ b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc.rst @@ -2,7 +2,7 @@ savu.plugins.segmentation.morphological\_operations.morph\_proc module ====================================================================== .. automodule:: savu.plugins.segmentation.morphological_operations.morph_proc - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc_line.rst b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc_line.rst new file mode 100644 index 000000000..4584c04d9 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc_line.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.morphological\_operations.morph\_proc\_line module +============================================================================ + +.. automodule:: savu.plugins.segmentation.morphological_operations.morph_proc_line + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc_line3D.rst b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc_line3D.rst new file mode 100644 index 000000000..5c2b11c98 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_proc_line3D.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.morphological\_operations.morph\_proc\_line3D module +============================================================================== + +.. automodule:: savu.plugins.segmentation.morphological_operations.morph_proc_line3D + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_remove_objects.rst b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_remove_objects.rst new file mode 100644 index 000000000..7c4bbe5f9 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.morphological_operations.morph_remove_objects.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.morphological\_operations.morph\_remove\_objects module +================================================================================= + +.. automodule:: savu.plugins.segmentation.morphological_operations.morph_remove_objects + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.segmentation.morphological_operations.rst b/doc/source/api/savu.plugins.segmentation.morphological_operations.rst index b6b084bed..479a0b61d 100644 --- a/doc/source/api/savu.plugins.segmentation.morphological_operations.rst +++ b/doc/source/api/savu.plugins.segmentation.morphological_operations.rst @@ -2,15 +2,18 @@ savu.plugins.segmentation.morphological\_operations package =========================================================== .. automodule:: savu.plugins.segmentation.morphological_operations - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.segmentation.morphological_operations.morph_proc - + savu.plugins.segmentation.morphological_operations.morph_proc_line + savu.plugins.segmentation.morphological_operations.morph_proc_line3D + savu.plugins.segmentation.morphological_operations.morph_remove_objects diff --git a/doc/source/api/savu.plugins.segmentation.rst b/doc/source/api/savu.plugins.segmentation.rst index 80aa50f14..a5406bf2c 100644 --- a/doc/source/api/savu.plugins.segmentation.rst +++ b/doc/source/api/savu.plugins.segmentation.rst @@ -2,29 +2,20 @@ savu.plugins.segmentation package ================================= .. automodule:: savu.plugins.segmentation - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.segmentation.i23segmentation - savu.plugins.segmentation.morphological_operations - -Submodules ----------- - -.. toctree:: - + savu.plugins.segmentation.evolving_contours + savu.plugins.segmentation.gaussian_mixtures savu.plugins.segmentation.geo_distance - savu.plugins.segmentation.gmm_segment3D - savu.plugins.segmentation.mask_evolve - savu.plugins.segmentation.mask_initialiser - savu.plugins.segmentation.morph_snakes - savu.plugins.segmentation.morph_snakes3D - savu.plugins.segmentation.thresh_segm - + savu.plugins.segmentation.masks_initialise + savu.plugins.segmentation.morphological_operations + savu.plugins.segmentation.thresholding diff --git a/doc/source/api/savu.plugins.segmentation.thresholding.rst b/doc/source/api/savu.plugins.segmentation.thresholding.rst new file mode 100644 index 000000000..360b28966 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.thresholding.rst @@ -0,0 +1,16 @@ +savu.plugins.segmentation.thresholding package +============================================== + +.. automodule:: savu.plugins.segmentation.thresholding + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.thresholding.thresh_segm diff --git a/doc/source/api/savu.plugins.segmentation.thresholding.thresh_segm.rst b/doc/source/api/savu.plugins.segmentation.thresholding.thresh_segm.rst new file mode 100644 index 000000000..f8b45d585 --- /dev/null +++ b/doc/source/api/savu.plugins.segmentation.thresholding.thresh_segm.rst @@ -0,0 +1,8 @@ +savu.plugins.segmentation.thresholding.thresh\_segm module +========================================================== + +.. automodule:: savu.plugins.segmentation.thresholding.thresh_segm + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.simulation.rst b/doc/source/api/savu.plugins.simulation.rst new file mode 100644 index 000000000..b580abb96 --- /dev/null +++ b/doc/source/api/savu.plugins.simulation.rst @@ -0,0 +1,17 @@ +savu.plugins.simulation package +=============================== + +.. automodule:: savu.plugins.simulation + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.simulation.tomo_phantom + savu.plugins.simulation.tomo_phantom_quantification diff --git a/doc/source/api/savu.plugins.simulation.tomo_phantom.rst b/doc/source/api/savu.plugins.simulation.tomo_phantom.rst new file mode 100644 index 000000000..81b26daae --- /dev/null +++ b/doc/source/api/savu.plugins.simulation.tomo_phantom.rst @@ -0,0 +1,8 @@ +savu.plugins.simulation.tomo\_phantom module +============================================ + +.. automodule:: savu.plugins.simulation.tomo_phantom + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.simulation.tomo_phantom_quantification.rst b/doc/source/api/savu.plugins.simulation.tomo_phantom_quantification.rst new file mode 100644 index 000000000..560282c5f --- /dev/null +++ b/doc/source/api/savu.plugins.simulation.tomo_phantom_quantification.rst @@ -0,0 +1,8 @@ +savu.plugins.simulation.tomo\_phantom\_quantification module +============================================================ + +.. automodule:: savu.plugins.simulation.tomo_phantom_quantification + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.stats.min_and_max.rst b/doc/source/api/savu.plugins.stats.min_and_max.rst index 7a02a3c76..728a89411 100644 --- a/doc/source/api/savu.plugins.stats.min_and_max.rst +++ b/doc/source/api/savu.plugins.stats.min_and_max.rst @@ -2,7 +2,7 @@ savu.plugins.stats.min\_and\_max module ======================================= .. automodule:: savu.plugins.stats.min_and_max - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.stats.rst b/doc/source/api/savu.plugins.stats.rst index 7faba0304..eead77431 100644 --- a/doc/source/api/savu.plugins.stats.rst +++ b/doc/source/api/savu.plugins.stats.rst @@ -2,15 +2,15 @@ savu.plugins.stats package ========================== .. automodule:: savu.plugins.stats - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.stats.min_and_max - diff --git a/doc/source/api/savu.plugins.utils.rst b/doc/source/api/savu.plugins.utils.rst index c4a876054..bf3938a8c 100644 --- a/doc/source/api/savu.plugins.utils.rst +++ b/doc/source/api/savu.plugins.utils.rst @@ -2,7 +2,7 @@ savu.plugins.utils module ========================= .. automodule:: savu.plugins.utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.visualisation.ortho_slice.rst b/doc/source/api/savu.plugins.visualisation.ortho_slice.rst index 0d2980ad6..20bced4e8 100644 --- a/doc/source/api/savu.plugins.visualisation.ortho_slice.rst +++ b/doc/source/api/savu.plugins.visualisation.ortho_slice.rst @@ -2,7 +2,7 @@ savu.plugins.visualisation.ortho\_slice module ============================================== .. automodule:: savu.plugins.visualisation.ortho_slice - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.plugins.visualisation.rst b/doc/source/api/savu.plugins.visualisation.rst index ceb354e25..1a3c99142 100644 --- a/doc/source/api/savu.plugins.visualisation.rst +++ b/doc/source/api/savu.plugins.visualisation.rst @@ -2,15 +2,15 @@ savu.plugins.visualisation package ================================== .. automodule:: savu.plugins.visualisation - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.visualisation.ortho_slice - diff --git a/doc/source/api/savu.rst b/doc/source/api/savu.rst index 9356d0f71..84b84a4b9 100644 --- a/doc/source/api/savu.rst +++ b/doc/source/api/savu.rst @@ -2,26 +2,27 @@ savu package ============ .. automodule:: savu - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.core - savu.data - savu.plugins - savu.test + savu.core + savu.data + savu.plugins + savu.test Submodules ---------- .. toctree:: + :maxdepth: 4 savu.tomo_recon savu.version - diff --git a/doc/source/api/savu.test.base_checkpoint_test.rst b/doc/source/api/savu.test.base_checkpoint_test.rst index d09ea26ee..83997140e 100644 --- a/doc/source/api/savu.test.base_checkpoint_test.rst +++ b/doc/source/api/savu.test.base_checkpoint_test.rst @@ -2,7 +2,7 @@ savu.test.base\_checkpoint\_test module ======================================= .. automodule:: savu.test.base_checkpoint_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.dawn_runner_tests.rst b/doc/source/api/savu.test.jenkins.dawn_runner_tests.rst index 3c428eade..50c39df78 100644 --- a/doc/source/api/savu.test.jenkins.dawn_runner_tests.rst +++ b/doc/source/api/savu.test.jenkins.dawn_runner_tests.rst @@ -2,15 +2,7 @@ savu.test.jenkins.dawn\_runner\_tests package ============================================= .. automodule:: savu.test.jenkins.dawn_runner_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -.. toctree:: - - savu.test.jenkins.dawn_runner_tests.i08_pymca_runner_test - + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst index 480bf7ec0..82d1ef1e1 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.plugin\_tests.filter\_tests.ccpi\_denoising\_gpu\_test module =============================================================================== .. automodule:: savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst index 9f3e2dcc8..2106aab2f 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.plugin\_tests.filter\_tests.ccpi\_ring\_artefact\_test module =============================================================================== .. automodule:: savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test.rst new file mode 100644 index 000000000..8e96682ce --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.dezinger\_gpu\_test module +======================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test.rst new file mode 100644 index 000000000..a9b54e5d1 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.median\_filter\_gpu\_test module +============================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.rst index 59ae5f3ff..fd9232a37 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.rst @@ -2,27 +2,26 @@ savu.test.jenkins.plugin\_tests.filter\_tests package ===================================================== .. automodule:: savu.test.jenkins.plugin_tests.filter_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.filter_tests.under_revision Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_cpu_test savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test - savu.test.jenkins.plugin_tests.filter_tests.component_analysis_test - savu.test.jenkins.plugin_tests.filter_tests.diffraction_absorption_test - savu.test.jenkins.plugin_tests.filter_tests.dummy_ptycho_test - savu.test.jenkins.plugin_tests.filter_tests.i08_pymca_test - savu.test.jenkins.plugin_tests.filter_tests.i14_pymca_test - savu.test.jenkins.plugin_tests.filter_tests.image_interpolation_test - savu.test.jenkins.plugin_tests.filter_tests.mc_near_absorption_correct_test - savu.test.jenkins.plugin_tests.filter_tests.pca_test - savu.test.jenkins.plugin_tests.filter_tests.ptypy_compact_test - savu.test.jenkins.plugin_tests.filter_tests.umpa_test - + savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test + savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te.rst new file mode 100644 index 000000000..6f4f8b51a --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.component\_analysis\_te module +============================================================================================ + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te.rst new file mode 100644 index 000000000..75c33db0c --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.diffraction\_absorption\_te module +================================================================================================ + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te.rst new file mode 100644 index 000000000..e0c9b3678 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.image\_interpolation\_te module +============================================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te.rst new file mode 100644 index 000000000..599cb9754 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.mc\_near\_absorption\_correct\_te module +====================================================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te.rst new file mode 100644 index 000000000..a5839d4b8 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.pca\_te module +============================================================================ + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.rst new file mode 100644 index 000000000..99629836b --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.rst @@ -0,0 +1,21 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision package +===================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te.rst new file mode 100644 index 000000000..792537095 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.umpa\_te module +============================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.rst b/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.rst index 0dc66c5e2..d75759462 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.rst @@ -2,20 +2,15 @@ savu.test.jenkins.plugin\_tests.loader\_tests package ===================================================== .. automodule:: savu.test.jenkins.plugin_tests.loader_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: -Submodules ----------- +Subpackages +----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.loader_tests.i08_fluo_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i13_fluo_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i13_ptycho_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i13_speckle_tracking_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i14_fluo_loader_test - savu.test.jenkins.plugin_tests.loader_tests.nx_ptycho_loader_test - + savu.test.jenkins.plugin_tests.loader_tests.under_revision diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te.rst b/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te.rst new file mode 100644 index 000000000..0fbd9e8b0 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.loader\_tests.under\_revision.i13\_speckle\_tracking\_loader\_te module +======================================================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.under_revision.rst b/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.under_revision.rst new file mode 100644 index 000000000..c55d20fe5 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.loader_tests.under_revision.rst @@ -0,0 +1,16 @@ +savu.test.jenkins.plugin\_tests.loader\_tests.under\_revision package +===================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.loader_tests.under_revision + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst index 6a1286d41..9b9c5f19d 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.plugin\_tests.reconstruction\_tests.astra\_recon\_gpu\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst index 08146cc97..86e57858f 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.plugin\_tests.reconstruction\_tests.ccpi\_cgls\_recon\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.rst b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.rst index d97cd8cf4..6e1326362 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.rst @@ -2,19 +2,23 @@ savu.test.jenkins.plugin\_tests.reconstruction\_tests package ============================================================= .. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.reconstruction_tests.CGLS_astra_test savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test - savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test - savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar_recon_test - savu.test.jenkins.plugin_tests.reconstruction_tests.tomopy_test - diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.rst b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.rst new file mode 100644 index 000000000..e130427e1 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.rst @@ -0,0 +1,16 @@ +savu.test.jenkins.plugin\_tests.reconstruction\_tests.tomobar package +===================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test.rst b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test.rst new file mode 100644 index 000000000..96c92b396 --- /dev/null +++ b/doc/source/api/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test.rst @@ -0,0 +1,8 @@ +savu.test.jenkins.plugin\_tests.reconstruction\_tests.tomobar.tomobar\_gpu\_test module +======================================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.rst b/doc/source/api/savu.test.jenkins.plugin_tests.rst index 8b0f71f2f..138bb4306 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.rst @@ -2,18 +2,18 @@ savu.test.jenkins.plugin\_tests package ======================================= .. automodule:: savu.test.jenkins.plugin_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.filter_tests - savu.test.jenkins.plugin_tests.loader_tests - savu.test.jenkins.plugin_tests.reconstruction_tests - savu.test.jenkins.plugin_tests.saver_tests - + savu.test.jenkins.plugin_tests.filter_tests + savu.test.jenkins.plugin_tests.loader_tests + savu.test.jenkins.plugin_tests.reconstruction_tests + savu.test.jenkins.plugin_tests.saver_tests diff --git a/doc/source/api/savu.test.jenkins.plugin_tests.saver_tests.rst b/doc/source/api/savu.test.jenkins.plugin_tests.saver_tests.rst index a59166f79..a6392aae3 100644 --- a/doc/source/api/savu.test.jenkins.plugin_tests.saver_tests.rst +++ b/doc/source/api/savu.test.jenkins.plugin_tests.saver_tests.rst @@ -2,16 +2,7 @@ savu.test.jenkins.plugin\_tests.saver\_tests package ==================================================== .. automodule:: savu.test.jenkins.plugin_tests.saver_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -.. toctree:: - - savu.test.jenkins.plugin_tests.saver_tests.edf_saver_test - savu.test.jenkins.plugin_tests.saver_tests.xrf_saver_test - + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.full_recon_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.full_recon_test.rst index 00e6b3033..8dca90085 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.full_recon_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.full_recon_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.full\_recon\_test module =============================================================== .. automodule:: savu.test.jenkins.process_list_tests.full_recon_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst index af5e559f5..91c6a0973 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.i18\_full\_pipeline\_test module ======================================================================= .. automodule:: savu.test.jenkins.process_list_tests.i18_full_pipeline_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst index 054d800ad..65e1fe6ee 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.i18\_stxm\_pipeline\_test module ======================================================================= .. automodule:: savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst index 7f974edbd..f8c6d3161 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.i18\_xrf\_pipeline\_test module ====================================================================== .. automodule:: savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst index 42d7530b8..4d8242ac9 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.mm\_processing\_template\_test module ============================================================================ .. automodule:: savu.test.jenkins.process_list_tests.mm_processing_template_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.new_fit_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.new_fit_test.rst index a981a8d9f..16499b9ea 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.new_fit_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.new_fit_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.new\_fit\_test module ============================================================ .. automodule:: savu.test.jenkins.process_list_tests.new_fit_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.rst b/doc/source/api/savu.test.jenkins.process_list_tests.rst index 2f1235e79..287f150cc 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.rst @@ -2,31 +2,24 @@ savu.test.jenkins.process\_list\_tests package ============================================== .. automodule:: savu.test.jenkins.process_list_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.jenkins.process_list_tests.full_recon_test - savu.test.jenkins.process_list_tests.i08_pymca_test - savu.test.jenkins.process_list_tests.i18_full_pipeline_test savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test - savu.test.jenkins.process_list_tests.i18_xrd_pipeline_test savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test savu.test.jenkins.process_list_tests.mm_processing_template_test savu.test.jenkins.process_list_tests.new_fit_test - savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test - savu.test.jenkins.process_list_tests.simple_fit_recon_test - savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test savu.test.jenkins.process_list_tests.simple_stxm_tomo_test savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test savu.test.jenkins.process_list_tests.stxm_tomo_test - savu.test.jenkins.process_list_tests.txm_tomo_test - diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst index 5ee654380..0feeb0d32 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.simple\_fit\_recon\_single\_sino\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst index e54939b92..7a9e8cced 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.simple\_fit\_recon\_test module ====================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_fit_recon_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst index 6239ad3c4..da294dc24 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.simple\_stxm\_tomo\_single\_sino\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst index bafc9eecd..d92d8ca66 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.simple\_stxm\_tomo\_test module ====================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_stxm_tomo_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst index 252198bf9..426a2d91b 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.spectra\_tomo\_chunking\_single\_sino\_te ========================================================================================= .. automodule:: savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst index f260daad0..c0d15eb43 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.spectra\_tomo\_chunking\_test module =========================================================================== .. automodule:: savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst index e0cc819f3..53a828f27 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.spectra\_tomo\_chunking\_with\_scanned\_p ===================================================================================================== .. automodule:: savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst b/doc/source/api/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst index 5efdc45fc..31d06f166 100644 --- a/doc/source/api/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst +++ b/doc/source/api/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst @@ -2,7 +2,7 @@ savu.test.jenkins.process\_list\_tests.stxm\_tomo\_test module ============================================================== .. automodule:: savu.test.jenkins.process_list_tests.stxm_tomo_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.jenkins.rst b/doc/source/api/savu.test.jenkins.rst index 85215a754..47730b440 100644 --- a/doc/source/api/savu.test.jenkins.rst +++ b/doc/source/api/savu.test.jenkins.rst @@ -2,17 +2,17 @@ savu.test.jenkins package ========================= .. automodule:: savu.test.jenkins - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.dawn_runner_tests - savu.test.jenkins.plugin_tests - savu.test.jenkins.process_list_tests - + savu.test.jenkins.dawn_runner_tests + savu.test.jenkins.plugin_tests + savu.test.jenkins.process_list_tests diff --git a/doc/source/api/savu.test.rst b/doc/source/api/savu.test.rst index 631491d26..9f43765d9 100644 --- a/doc/source/api/savu.test.rst +++ b/doc/source/api/savu.test.rst @@ -2,24 +2,26 @@ savu.test package ================= .. automodule:: savu.test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins - savu.test.travis + savu.test.jenkins + savu.test.travis Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.base_checkpoint_test + savu.test.test_process_list_utils savu.test.test_utils - diff --git a/doc/source/api/savu.test.test_process_list_utils.rst b/doc/source/api/savu.test.test_process_list_utils.rst new file mode 100644 index 000000000..6143b4eaa --- /dev/null +++ b/doc/source/api/savu.test.test_process_list_utils.rst @@ -0,0 +1,8 @@ +savu.test.test\_process\_list\_utils module +=========================================== + +.. automodule:: savu.test.test_process_list_utils + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.test_utils.rst b/doc/source/api/savu.test.test_utils.rst index c6d8a3115..2b01b57e0 100644 --- a/doc/source/api/savu.test.test_utils.rst +++ b/doc/source/api/savu.test.test_utils.rst @@ -2,7 +2,7 @@ savu.test.test\_utils module ============================ .. automodule:: savu.test.test_utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst b/doc/source/api/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst index 3d5902108..b7c9915ee 100644 --- a/doc/source/api/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.astra\_multiple\_parameter\_test module ========================================================================= .. automodule:: savu.test.travis.framework_tests.astra_multiple_parameter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.checkpoint_test.rst b/doc/source/api/savu.test.travis.framework_tests.checkpoint_test.rst index 661cad80e..0254c9a57 100644 --- a/doc/source/api/savu.test.travis.framework_tests.checkpoint_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.checkpoint_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.checkpoint\_test module ========================================================= .. automodule:: savu.test.travis.framework_tests.checkpoint_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.chunking_test.rst b/doc/source/api/savu.test.travis.framework_tests.chunking_test.rst index de81f126a..039385360 100644 --- a/doc/source/api/savu.test.travis.framework_tests.chunking_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.chunking_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.chunking\_test module ======================================================= .. automodule:: savu.test.travis.framework_tests.chunking_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.data_test.rst b/doc/source/api/savu.test.travis.framework_tests.data_test.rst index c0d27b909..de93ed4bb 100644 --- a/doc/source/api/savu.test.travis.framework_tests.data_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.data_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.data\_test module =================================================== .. automodule:: savu.test.travis.framework_tests.data_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.max_frames_test.rst b/doc/source/api/savu.test.travis.framework_tests.max_frames_test.rst index 2f96b524d..1299b86c4 100644 --- a/doc/source/api/savu.test.travis.framework_tests.max_frames_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.max_frames_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.max\_frames\_test module ========================================================== .. automodule:: savu.test.travis.framework_tests.max_frames_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.multiple_datasets_test.rst b/doc/source/api/savu.test.travis.framework_tests.multiple_datasets_test.rst index 2d321e257..130496a50 100644 --- a/doc/source/api/savu.test.travis.framework_tests.multiple_datasets_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.multiple_datasets_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.multiple\_datasets\_test module ================================================================= .. automodule:: savu.test.travis.framework_tests.multiple_datasets_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst b/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst index 47a593239..3115c9055 100644 --- a/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.multiple\_parameter\_process\_lists\_test modu ================================================================================== .. automodule:: savu.test.travis.framework_tests.multiple_parameter_process_lists_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_test.rst b/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_test.rst index 8dff421f4..2e121f804 100644 --- a/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.multiple_parameter_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.multiple\_parameter\_test module ================================================================== .. automodule:: savu.test.travis.framework_tests.multiple_parameter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.parameters_test.rst b/doc/source/api/savu.test.travis.framework_tests.parameters_test.rst index 4b35627bb..87ccbe8e7 100644 --- a/doc/source/api/savu.test.travis.framework_tests.parameters_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.parameters_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.parameters\_test module ========================================================= .. automodule:: savu.test.travis.framework_tests.parameters_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.plugin_coverage_test.rst b/doc/source/api/savu.test.travis.framework_tests.plugin_coverage_test.rst index 8ed62704d..12d7b09c1 100644 --- a/doc/source/api/savu.test.travis.framework_tests.plugin_coverage_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.plugin_coverage_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.plugin\_coverage\_test module =============================================================== .. automodule:: savu.test.travis.framework_tests.plugin_coverage_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.plugin_runner_test.rst b/doc/source/api/savu.test.travis.framework_tests.plugin_runner_test.rst index 576232332..7be3c4bae 100644 --- a/doc/source/api/savu.test.travis.framework_tests.plugin_runner_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.plugin_runner_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.plugin\_runner\_test module ============================================================= .. automodule:: savu.test.travis.framework_tests.plugin_runner_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.plugins_util_test.rst b/doc/source/api/savu.test.travis.framework_tests.plugins_util_test.rst index e8f24bb1e..bdf02121a 100644 --- a/doc/source/api/savu.test.travis.framework_tests.plugins_util_test.rst +++ b/doc/source/api/savu.test.travis.framework_tests.plugins_util_test.rst @@ -2,7 +2,7 @@ savu.test.travis.framework\_tests.plugins\_util\_test module ============================================================ .. automodule:: savu.test.travis.framework_tests.plugins_util_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.framework_tests.rst b/doc/source/api/savu.test.travis.framework_tests.rst index 3913679f2..4f0049398 100644 --- a/doc/source/api/savu.test.travis.framework_tests.rst +++ b/doc/source/api/savu.test.travis.framework_tests.rst @@ -2,18 +2,18 @@ savu.test.travis.framework\_tests package ========================================= .. automodule:: savu.test.travis.framework_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.framework_tests.astra_multiple_parameter_test - savu.test.travis.framework_tests.cgls_library_test savu.test.travis.framework_tests.checkpoint_test savu.test.travis.framework_tests.chunking_test savu.test.travis.framework_tests.data_test @@ -25,5 +25,3 @@ Submodules savu.test.travis.framework_tests.plugin_coverage_test savu.test.travis.framework_tests.plugin_runner_test savu.test.travis.framework_tests.plugins_util_test - savu.test.travis.framework_tests.test_utils - diff --git a/doc/source/api/savu.test.travis.plugin_tests.basic_operations_test.rst b/doc/source/api/savu.test.travis.plugin_tests.basic_operations_test.rst index 07eda3e60..e9e6c20e4 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.basic_operations_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.basic_operations_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.basic\_operations\_test module ============================================================= .. automodule:: savu.test.travis.plugin_tests.basic_operations_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst index aec378010..c1bbc37aa 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.correction\_tests.camera\_rot\_corr\_test module =============================================================================== .. automodule:: savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.rst index 382eebb56..0c8aec5de 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.rst @@ -2,17 +2,17 @@ savu.test.travis.plugin\_tests.correction\_tests package ======================================================== .. automodule:: savu.test.travis.plugin_tests.correction_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test savu.test.travis.plugin_tests.correction_tests.time_based_correction_test - diff --git a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst index 9bd95d38c..5a6048c41 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.correction\_tests.subpixel\_shift\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst index da0baf8a2..7c2368e37 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.correction\_tests.time\_based\_correction\_test m ===================================================================================== .. automodule:: savu.test.travis.plugin_tests.correction_tests.time_based_correction_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test.rst new file mode 100644 index 000000000..451d8f593 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise.band\_pass\_test module +============================================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test.rst new file mode 100644 index 000000000..d5204c5a5 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise.ccpi\_denoising\_cpu\_test module +====================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test.rst new file mode 100644 index 000000000..c8377cb00 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise.denoise\_bregman\_test module +================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.rst new file mode 100644 index 000000000..78a9e8a42 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.denoise.rst @@ -0,0 +1,18 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise package +============================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test + savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test + savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test.rst new file mode 100644 index 000000000..c2e06dd19 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.dezinger.dezinger\_test module +=========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.dezinger.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.dezinger.rst new file mode 100644 index 000000000..83b130f1f --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.dezinger.rst @@ -0,0 +1,16 @@ +savu.test.travis.plugin\_tests.filter\_tests.dezinger package +============================================================= + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.dezinger + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst index 541112079..0407bb3ad 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.distortion\_correction\_test module ================================================================================ .. automodule:: savu.test.travis.plugin_tests.filter_tests.distortion_correction_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst index 548fccd31..8fbfa24ef 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.downsample\_filter\_test module ============================================================================ .. automodule:: savu.test.travis.plugin_tests.filter_tests.downsample_filter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test.rst new file mode 100644 index 000000000..348269a23 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.fresnel\_filter\_test module +========================================================================= + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst index 6ad538e9e..dacd0285d 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.hilbert\_test module ================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.hilbert_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test.rst new file mode 100644 index 000000000..e6133a119 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.background\_estimator\_test module +========================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test.rst new file mode 100644 index 000000000..abe05a749 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.find\_peaks\_test module +================================================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test.rst new file mode 100644 index 000000000..69d148846 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.histogram\_test module +============================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.rst new file mode 100644 index 000000000..e021c0371 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.rst @@ -0,0 +1,21 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal package +=============================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test + savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test + savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test + savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test + savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test + savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test.rst new file mode 100644 index 000000000..8452fab1b --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.simple\_fit\_test module +================================================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test.rst new file mode 100644 index 000000000..60fa1a506 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.spectrum\_crop\_test module +=================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test.rst new file mode 100644 index 000000000..0ecaa5ddb --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.strip\_background\_test module +====================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst index 9ae7e8be9..57010b58c 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.paganin\_test module ================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.paganin_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test.rst new file mode 100644 index 000000000..87566843c --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.pyfai.pyfai\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pyfai.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pyfai.rst new file mode 100644 index 000000000..f7d6f0177 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pyfai.rst @@ -0,0 +1,16 @@ +savu.test.travis.plugin\_tests.filter\_tests.pyfai package +========================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pyfai + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test.rst new file mode 100644 index 000000000..10b9fec96 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca.list\_to\_projections\_test module +===================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test.rst new file mode 100644 index 000000000..1f89cc0a8 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca.monitor\_correction\_test module +=================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test.rst new file mode 100644 index 000000000..93a146a46 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca.pymca\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.rst new file mode 100644 index 000000000..6a5d7863b --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.pymca.rst @@ -0,0 +1,18 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca package +========================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test + savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test + savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst index 7f8b56b8d..02f6b651b 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.quantisation\_filter\_test module ============================================================================== .. automodule:: savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst index 9fca1cc5f..fd8e7b992 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.raven\_filter\_test module ======================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.raven_filter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test.rst new file mode 100644 index 000000000..bb0ae10f8 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.filter\_tests.ring\_removal.remove\_rings\_test module +===================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.ring_removal.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.ring_removal.rst new file mode 100644 index 000000000..45aeac686 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.ring_removal.rst @@ -0,0 +1,16 @@ +savu.test.travis.plugin\_tests.filter\_tests.ring\_removal package +================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.ring_removal + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.rst index ac8a149f9..b072c1c0b 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.rst @@ -2,40 +2,37 @@ savu.test.travis.plugin\_tests.filter\_tests package ==================================================== .. automodule:: savu.test.travis.plugin_tests.filter_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.denoise + savu.test.travis.plugin_tests.filter_tests.dezinger + savu.test.travis.plugin_tests.filter_tests.multimodal + savu.test.travis.plugin_tests.filter_tests.pyfai + savu.test.travis.plugin_tests.filter_tests.pymca + savu.test.travis.plugin_tests.filter_tests.ring_removal Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.travis.plugin_tests.filter_tests.background_estimator_test - savu.test.travis.plugin_tests.filter_tests.band_pass_test - savu.test.travis.plugin_tests.filter_tests.denoise_bregman_test - savu.test.travis.plugin_tests.filter_tests.dezinger_simple_test - savu.test.travis.plugin_tests.filter_tests.dezinger_sinogram_test - savu.test.travis.plugin_tests.filter_tests.dezinger_test savu.test.travis.plugin_tests.filter_tests.distortion_correction_test savu.test.travis.plugin_tests.filter_tests.downsample_filter_test - savu.test.travis.plugin_tests.filter_tests.find_peaks_test + savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test savu.test.travis.plugin_tests.filter_tests.hilbert_test - savu.test.travis.plugin_tests.filter_tests.histogram_test - savu.test.travis.plugin_tests.filter_tests.list_to_projections_test - savu.test.travis.plugin_tests.filter_tests.median_filter_test - savu.test.travis.plugin_tests.filter_tests.monitor_correction_test savu.test.travis.plugin_tests.filter_tests.paganin_test - savu.test.travis.plugin_tests.filter_tests.pyfai_filtered_test - savu.test.travis.plugin_tests.filter_tests.pyfai_separate_test - savu.test.travis.plugin_tests.filter_tests.pyfai_test - savu.test.travis.plugin_tests.filter_tests.pymca_test savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test savu.test.travis.plugin_tests.filter_tests.raven_filter_test - savu.test.travis.plugin_tests.filter_tests.simple_fit_test savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test - savu.test.travis.plugin_tests.filter_tests.strip_background_test savu.test.travis.plugin_tests.filter_tests.threshold_filter_test savu.test.travis.plugin_tests.filter_tests.vo_centering_test - diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst index 6b208634f..e0b7a9def 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.sinogram\_alignment\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst index 7d5a40239..129f03c6e 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.threshold\_filter\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.filter_tests.threshold_filter_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst index 60f58a477..e5568d338 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.filter\_tests.vo\_centering\_test module ======================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.vo_centering_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test.rst b/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test.rst new file mode 100644 index 000000000..a5831115a --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.imagesavers\_tests.image\_saver\_test module +=========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.rst new file mode 100644 index 000000000..e79691b5f --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.rst @@ -0,0 +1,17 @@ +savu.test.travis.plugin\_tests.imagesavers\_tests package +========================================================= + +.. automodule:: savu.test.travis.plugin_tests.imagesavers_tests + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test + savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test.rst b/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test.rst new file mode 100644 index 000000000..ee27ba12b --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.imagesavers\_tests.tiff\_saver\_test module +========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst index 353830de3..8095f0765 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_fluo\_loader\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst index 777d59aec..30cf1e648 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_mm\_loader\_test module ========================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst index 15710d6ef..a04afc00d 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_stxm\_loader\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst index 956b7b5be..5388302d5 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_xrd\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst index 38af56c03..c14723092 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.i22\_tomo\_loader\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst index 47e3a2220..58c0c805d 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.i22\_tomo\_test module =================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i22_tomo_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.mrc_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.mrc_loader_test.rst new file mode 100644 index 000000000..9ad6200a4 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.mrc_loader_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.loader\_tests.mrc\_loader\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.loader_tests.mrc_loader_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst index 2a50c87de..0f8d598d5 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_fluo\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst index 8fc0b04a0..f496b28c4 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_mm\_loader\_test module ======================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst index 7998448ec..86ebdbe33 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_monitor\_loader\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst index a8328e8ad..87e8f1d7c 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_stxm\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst index 2171ab1fd..d56febff5 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_tomo\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst index 8604523e7..d1e027e60 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_xrd\_loader\_test module ========================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.rst index dd61cedb5..8fb758f7f 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.rst @@ -2,22 +2,20 @@ savu.test.travis.plugin\_tests.loader\_tests package ==================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test - savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test - savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test - savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test savu.test.travis.plugin_tests.loader_tests.i22_tomo_test + savu.test.travis.plugin_tests.loader_tests.mrc_loader_test savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test @@ -27,4 +25,3 @@ Submodules savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test savu.test.travis.plugin_tests.loader_tests.template_loader_test savu.test.travis.plugin_tests.loader_tests.tiff_loader_test - diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst index 71ee16236..63b09ecf5 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.savu\_nexus\_loader\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst index 3f8cfbff4..c432c485e 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.template\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.template_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst index 18160ddc2..5f3e622f8 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.loader\_tests.tiff\_loader\_test module ====================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.tiff_loader_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst index cf230536c..31127870d 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.reconstruction\_tests.astra\_recon\_cpu\_test mod =================================================================================== .. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.fbp_test.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.fbp_test.rst new file mode 100644 index 000000000..b22ef4c6e --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.fbp_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.fbp\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.fbp_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.rst index a956ddb1a..1c286f94b 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.rst @@ -2,19 +2,20 @@ savu.test.travis.plugin\_tests.reconstruction\_tests package ============================================================ .. automodule:: savu.test.travis.plugin_tests.reconstruction_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test - savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_init_vol_test - savu.test.travis.plugin_tests.reconstruction_tests.plugin_sart_test - savu.test.travis.plugin_tests.reconstruction_tests.simple_tomo_test + savu.test.travis.plugin_tests.reconstruction_tests.fbp_test + savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test + savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test + savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test - diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test.rst new file mode 100644 index 000000000..56e65d7b2 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.scikit\_image\_recon\_test module +====================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test.rst new file mode 100644 index 000000000..b4261e507 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.tomo\_pipeline\_preview\_test module +========================================================================================= + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test.rst new file mode 100644 index 000000000..f80c6b263 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.tomobar\_recon2d\_cpu\_test module +======================================================================================= + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst index 6b287ae8f..b4cccaf8c 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst @@ -2,7 +2,7 @@ savu.test.travis.plugin\_tests.reconstruction\_tests.tomopy\_recon\_test module =============================================================================== .. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.rst index c32088a99..357b9bd26 100644 --- a/doc/source/api/savu.test.travis.plugin_tests.rst +++ b/doc/source/api/savu.test.travis.plugin_tests.rst @@ -2,27 +2,29 @@ savu.test.travis.plugin\_tests package ====================================== .. automodule:: savu.test.travis.plugin_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.travis.plugin_tests.correction_tests - savu.test.travis.plugin_tests.filter_tests - savu.test.travis.plugin_tests.loader_tests - savu.test.travis.plugin_tests.reconstruction_tests - savu.test.travis.plugin_tests.ring_removal_tests - savu.test.travis.plugin_tests.saver_tests + savu.test.travis.plugin_tests.correction_tests + savu.test.travis.plugin_tests.filter_tests + savu.test.travis.plugin_tests.imagesavers_tests + savu.test.travis.plugin_tests.loader_tests + savu.test.travis.plugin_tests.reconstruction_tests + savu.test.travis.plugin_tests.segmentation_tests + savu.test.travis.plugin_tests.simulation_tests Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.plugin_tests.basic_operations_test - diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test.rst new file mode 100644 index 000000000..e27ec7d49 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.geo\_dist\_test module +========================================================================= + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.gmm_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.gmm_test.rst new file mode 100644 index 000000000..8007bf5e4 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.gmm_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.gmm\_test module +=================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.gmm_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test.rst new file mode 100644 index 000000000..c3d8a0e97 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.mask\_initialise\_test module +================================================================================ + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test.rst new file mode 100644 index 000000000..3dd534645 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.morph\_operations\_test module +================================================================================= + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test.rst new file mode 100644 index 000000000..fd00802a3 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.morphproc\_line\_test module +=============================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test.rst new file mode 100644 index 000000000..5c1285b91 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.morphsnakes\_test module +=========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test.rst new file mode 100644 index 000000000..cc33cd8cc --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.regiongrow\_test module +========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.rst new file mode 100644 index 000000000..272bf41e2 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.segmentation_tests.rst @@ -0,0 +1,22 @@ +savu.test.travis.plugin\_tests.segmentation\_tests package +========================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test + savu.test.travis.plugin_tests.segmentation_tests.gmm_test + savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test + savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test + savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test + savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test + savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.simulation_tests.rst b/doc/source/api/savu.test.travis.plugin_tests.simulation_tests.rst new file mode 100644 index 000000000..e23c46944 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.simulation_tests.rst @@ -0,0 +1,16 @@ +savu.test.travis.plugin\_tests.simulation\_tests package +======================================================== + +.. automodule:: savu.test.travis.plugin_tests.simulation_tests + :members: + :private-members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.simulation_tests.tomophantom_test diff --git a/doc/source/api/savu.test.travis.plugin_tests.simulation_tests.tomophantom_test.rst b/doc/source/api/savu.test.travis.plugin_tests.simulation_tests.tomophantom_test.rst new file mode 100644 index 000000000..78c6a76b2 --- /dev/null +++ b/doc/source/api/savu.test.travis.plugin_tests.simulation_tests.tomophantom_test.rst @@ -0,0 +1,8 @@ +savu.test.travis.plugin\_tests.simulation\_tests.tomophantom\_test module +========================================================================= + +.. automodule:: savu.test.travis.plugin_tests.simulation_tests.tomophantom_test + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst b/doc/source/api/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst index 9ae5be5c4..f78f86a52 100644 --- a/doc/source/api/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst +++ b/doc/source/api/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst @@ -2,7 +2,7 @@ savu.test.travis.process\_list\_tests.map3dto4d\_pipeline\_test module ====================================================================== .. automodule:: savu.test.travis.process_list_tests.map3dto4d_pipeline_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.process_list_tests.mapping_3Dto4D.rst b/doc/source/api/savu.test.travis.process_list_tests.mapping_3Dto4D.rst index 12e108276..a1bf6d4b2 100644 --- a/doc/source/api/savu.test.travis.process_list_tests.mapping_3Dto4D.rst +++ b/doc/source/api/savu.test.travis.process_list_tests.mapping_3Dto4D.rst @@ -2,7 +2,7 @@ savu.test.travis.process\_list\_tests.mapping\_3Dto4D module ============================================================ .. automodule:: savu.test.travis.process_list_tests.mapping_3Dto4D - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.process_list_tests.mipmap_test.rst b/doc/source/api/savu.test.travis.process_list_tests.mipmap_test.rst index 280263047..41e6a8a02 100644 --- a/doc/source/api/savu.test.travis.process_list_tests.mipmap_test.rst +++ b/doc/source/api/savu.test.travis.process_list_tests.mipmap_test.rst @@ -2,7 +2,7 @@ savu.test.travis.process\_list\_tests.mipmap\_test module ========================================================= .. automodule:: savu.test.travis.process_list_tests.mipmap_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.process_list_tests.mm_test.rst b/doc/source/api/savu.test.travis.process_list_tests.mm_test.rst index 5a81d9f81..6af10ab3d 100644 --- a/doc/source/api/savu.test.travis.process_list_tests.mm_test.rst +++ b/doc/source/api/savu.test.travis.process_list_tests.mm_test.rst @@ -2,7 +2,7 @@ savu.test.travis.process\_list\_tests.mm\_test module ===================================================== .. automodule:: savu.test.travis.process_list_tests.mm_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.process_list_tests.rst b/doc/source/api/savu.test.travis.process_list_tests.rst index 897f7cd23..de8ee8551 100644 --- a/doc/source/api/savu.test.travis.process_list_tests.rst +++ b/doc/source/api/savu.test.travis.process_list_tests.rst @@ -2,22 +2,19 @@ savu.test.travis.process\_list\_tests package ============================================= .. automodule:: savu.test.travis.process_list_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.process_list_tests.map3dto4d_pipeline_test savu.test.travis.process_list_tests.mapping_3Dto4D savu.test.travis.process_list_tests.mipmap_test savu.test.travis.process_list_tests.mm_test - savu.test.travis.process_list_tests.scikit_image_recon_test - savu.test.travis.process_list_tests.spectrum_crop_test savu.test.travis.process_list_tests.stats_test - savu.test.travis.process_list_tests.tomo_pipeline_preview_test - diff --git a/doc/source/api/savu.test.travis.process_list_tests.stats_test.rst b/doc/source/api/savu.test.travis.process_list_tests.stats_test.rst index 71c3c287d..c93a57163 100644 --- a/doc/source/api/savu.test.travis.process_list_tests.stats_test.rst +++ b/doc/source/api/savu.test.travis.process_list_tests.stats_test.rst @@ -2,7 +2,7 @@ savu.test.travis.process\_list\_tests.stats\_test module ======================================================== .. automodule:: savu.test.travis.process_list_tests.stats_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.test.travis.rst b/doc/source/api/savu.test.travis.rst index 014aabcc5..7348e2a1d 100644 --- a/doc/source/api/savu.test.travis.rst +++ b/doc/source/api/savu.test.travis.rst @@ -2,17 +2,17 @@ savu.test.travis package ======================== .. automodule:: savu.test.travis - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.travis.framework_tests - savu.test.travis.plugin_tests - savu.test.travis.process_list_tests - + savu.test.travis.framework_tests + savu.test.travis.plugin_tests + savu.test.travis.process_list_tests diff --git a/doc/source/api/savu.tomo_recon.rst b/doc/source/api/savu.tomo_recon.rst index 060a79389..ba966a2db 100644 --- a/doc/source/api/savu.tomo_recon.rst +++ b/doc/source/api/savu.tomo_recon.rst @@ -2,7 +2,7 @@ savu.tomo\_recon module ======================= .. automodule:: savu.tomo_recon - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/savu.version.rst b/doc/source/api/savu.version.rst index bbd50eaad..19ba0d393 100644 --- a/doc/source/api/savu.version.rst +++ b/doc/source/api/savu.version.rst @@ -2,7 +2,7 @@ savu.version module =================== .. automodule:: savu.version - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.citation_extractor.citation_extractor.rst b/doc/source/api/scripts.citation_extractor.citation_extractor.rst index 710100f15..1652ba4f7 100644 --- a/doc/source/api/scripts.citation_extractor.citation_extractor.rst +++ b/doc/source/api/scripts.citation_extractor.citation_extractor.rst @@ -2,7 +2,7 @@ scripts.citation\_extractor.citation\_extractor module ====================================================== .. automodule:: scripts.citation_extractor.citation_extractor - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.citation_extractor.rst b/doc/source/api/scripts.citation_extractor.rst index 2b4e41368..6661b7b3f 100644 --- a/doc/source/api/scripts.citation_extractor.rst +++ b/doc/source/api/scripts.citation_extractor.rst @@ -2,15 +2,15 @@ scripts.citation\_extractor package =================================== .. automodule:: scripts.citation_extractor - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.citation_extractor.citation_extractor - diff --git a/doc/source/api/scripts.config_generator.arg_parsers.rst b/doc/source/api/scripts.config_generator.arg_parsers.rst index 5eb6153c8..eb77e5ab4 100644 --- a/doc/source/api/scripts.config_generator.arg_parsers.rst +++ b/doc/source/api/scripts.config_generator.arg_parsers.rst @@ -2,7 +2,7 @@ scripts.config\_generator.arg\_parsers module ============================================= .. automodule:: scripts.config_generator.arg_parsers - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.completer.rst b/doc/source/api/scripts.config_generator.completer.rst index 773b3127b..d0d2a492c 100644 --- a/doc/source/api/scripts.config_generator.completer.rst +++ b/doc/source/api/scripts.config_generator.completer.rst @@ -2,7 +2,7 @@ scripts.config\_generator.completer module ========================================== .. automodule:: scripts.config_generator.completer - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.config_utils.rst b/doc/source/api/scripts.config_generator.config_utils.rst index 7ece2b3fa..0787d96a5 100644 --- a/doc/source/api/scripts.config_generator.config_utils.rst +++ b/doc/source/api/scripts.config_generator.config_utils.rst @@ -2,7 +2,7 @@ scripts.config\_generator.config\_utils module ============================================== .. automodule:: scripts.config_generator.config_utils - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.content.rst b/doc/source/api/scripts.config_generator.content.rst index f54b99cc6..0e45d3566 100644 --- a/doc/source/api/scripts.config_generator.content.rst +++ b/doc/source/api/scripts.config_generator.content.rst @@ -2,7 +2,7 @@ scripts.config\_generator.content module ======================================== .. automodule:: scripts.config_generator.content - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.display_formatter.rst b/doc/source/api/scripts.config_generator.display_formatter.rst index 834d7d790..203827bf4 100644 --- a/doc/source/api/scripts.config_generator.display_formatter.rst +++ b/doc/source/api/scripts.config_generator.display_formatter.rst @@ -2,7 +2,7 @@ scripts.config\_generator.display\_formatter module =================================================== .. automodule:: scripts.config_generator.display_formatter - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.hdf5_template_extractor.rst b/doc/source/api/scripts.config_generator.hdf5_template_extractor.rst new file mode 100644 index 000000000..43f72b32f --- /dev/null +++ b/doc/source/api/scripts.config_generator.hdf5_template_extractor.rst @@ -0,0 +1,8 @@ +scripts.config\_generator.hdf5\_template\_extractor module +========================================================== + +.. automodule:: scripts.config_generator.hdf5_template_extractor + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.mutations.rst b/doc/source/api/scripts.config_generator.mutations.rst index 410967b10..8812772ca 100644 --- a/doc/source/api/scripts.config_generator.mutations.rst +++ b/doc/source/api/scripts.config_generator.mutations.rst @@ -2,7 +2,7 @@ scripts.config\_generator.mutations module ========================================== .. automodule:: scripts.config_generator.mutations - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.parameter_extractor.rst b/doc/source/api/scripts.config_generator.parameter_extractor.rst index 3ef8d59e7..0ed67db9f 100644 --- a/doc/source/api/scripts.config_generator.parameter_extractor.rst +++ b/doc/source/api/scripts.config_generator.parameter_extractor.rst @@ -2,7 +2,7 @@ scripts.config\_generator.parameter\_extractor module ===================================================== .. automodule:: scripts.config_generator.parameter_extractor - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.rst b/doc/source/api/scripts.config_generator.rst index 4be238290..91df25f38 100644 --- a/doc/source/api/scripts.config_generator.rst +++ b/doc/source/api/scripts.config_generator.rst @@ -2,24 +2,25 @@ scripts.config\_generator package ================================= .. automodule:: scripts.config_generator - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.config_generator.arg_parsers scripts.config_generator.completer scripts.config_generator.config_utils scripts.config_generator.content scripts.config_generator.display_formatter + scripts.config_generator.hdf5_template_extractor scripts.config_generator.mutations scripts.config_generator.parameter_extractor scripts.config_generator.savu_config scripts.config_generator.update_template scripts.config_generator.win_readline - diff --git a/doc/source/api/scripts.config_generator.savu_config.rst b/doc/source/api/scripts.config_generator.savu_config.rst index bdd462b00..a8a3daa76 100644 --- a/doc/source/api/scripts.config_generator.savu_config.rst +++ b/doc/source/api/scripts.config_generator.savu_config.rst @@ -2,7 +2,7 @@ scripts.config\_generator.savu\_config module ============================================= .. automodule:: scripts.config_generator.savu_config - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.update_template.rst b/doc/source/api/scripts.config_generator.update_template.rst index 292b0d7c9..a4dd2dc7a 100644 --- a/doc/source/api/scripts.config_generator.update_template.rst +++ b/doc/source/api/scripts.config_generator.update_template.rst @@ -2,7 +2,7 @@ scripts.config\_generator.update\_template module ================================================= .. automodule:: scripts.config_generator.update_template - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.config_generator.win_readline.rst b/doc/source/api/scripts.config_generator.win_readline.rst index abb38e69e..9deaa74bc 100644 --- a/doc/source/api/scripts.config_generator.win_readline.rst +++ b/doc/source/api/scripts.config_generator.win_readline.rst @@ -2,7 +2,7 @@ scripts.config\_generator.win\_readline module ============================================== .. automodule:: scripts.config_generator.win_readline - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.configurator_tests.dawn_compatible_test.rst b/doc/source/api/scripts.configurator_tests.dawn_compatible_test.rst index 419924c07..b7151827d 100644 --- a/doc/source/api/scripts.configurator_tests.dawn_compatible_test.rst +++ b/doc/source/api/scripts.configurator_tests.dawn_compatible_test.rst @@ -2,7 +2,7 @@ scripts.configurator\_tests.dawn\_compatible\_test module ========================================================= .. automodule:: scripts.configurator_tests.dawn_compatible_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.configurator_tests.refresh_process_lists_test.rst b/doc/source/api/scripts.configurator_tests.refresh_process_lists_test.rst index 5aeb74492..85d2dc890 100644 --- a/doc/source/api/scripts.configurator_tests.refresh_process_lists_test.rst +++ b/doc/source/api/scripts.configurator_tests.refresh_process_lists_test.rst @@ -2,7 +2,7 @@ scripts.configurator\_tests.refresh\_process\_lists\_test module ================================================================ .. automodule:: scripts.configurator_tests.refresh_process_lists_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.configurator_tests.rst b/doc/source/api/scripts.configurator_tests.rst index 390f873ff..396b5547c 100644 --- a/doc/source/api/scripts.configurator_tests.rst +++ b/doc/source/api/scripts.configurator_tests.rst @@ -2,17 +2,16 @@ scripts.configurator\_tests package =================================== .. automodule:: scripts.configurator_tests - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 - scripts.configurator_tests.dawn_compatible_test scripts.configurator_tests.refresh_process_lists_test scripts.configurator_tests.savu_config_test - diff --git a/doc/source/api/scripts.configurator_tests.savu_config_test.rst b/doc/source/api/scripts.configurator_tests.savu_config_test.rst index f2da4e304..631971abe 100644 --- a/doc/source/api/scripts.configurator_tests.savu_config_test.rst +++ b/doc/source/api/scripts.configurator_tests.savu_config_test.rst @@ -2,7 +2,7 @@ scripts.configurator\_tests.savu\_config\_test module ===================================================== .. automodule:: scripts.configurator_tests.savu_config_test - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.dawn_runner.rst b/doc/source/api/scripts.dawn_runner.rst index b78b65658..777c1ca7b 100644 --- a/doc/source/api/scripts.dawn_runner.rst +++ b/doc/source/api/scripts.dawn_runner.rst @@ -2,15 +2,15 @@ scripts.dawn\_runner package ============================ .. automodule:: scripts.dawn_runner - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.dawn_runner.run_savu - diff --git a/doc/source/api/scripts.dawn_runner.run_savu.rst b/doc/source/api/scripts.dawn_runner.run_savu.rst index fa52873ac..511d8589b 100644 --- a/doc/source/api/scripts.dawn_runner.run_savu.rst +++ b/doc/source/api/scripts.dawn_runner.run_savu.rst @@ -2,7 +2,7 @@ scripts.dawn\_runner.run\_savu module ===================================== .. automodule:: scripts.dawn_runner.run_savu - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.incomplete_jobs_finder.rst b/doc/source/api/scripts.incomplete_jobs_finder.rst new file mode 100644 index 000000000..293853e2f --- /dev/null +++ b/doc/source/api/scripts.incomplete_jobs_finder.rst @@ -0,0 +1,8 @@ +scripts.incomplete\_jobs\_finder module +======================================= + +.. automodule:: scripts.incomplete_jobs_finder + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler.rst b/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler.rst index e524c81de..b6f51d249 100644 --- a/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler.rst +++ b/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler.rst @@ -2,7 +2,7 @@ scripts.log\_evaluation.GraphicalThreadProfiler module ====================================================== .. automodule:: scripts.log_evaluation.GraphicalThreadProfiler - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst b/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst index a9fd5a298..72f53b937 100644 --- a/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst +++ b/doc/source/api/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst @@ -2,7 +2,7 @@ scripts.log\_evaluation.GraphicalThreadProfiler\_multi module ============================================================= .. automodule:: scripts.log_evaluation.GraphicalThreadProfiler_multi - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.log_evaluation.VisualiseProfileData.rst b/doc/source/api/scripts.log_evaluation.VisualiseProfileData.rst index 1a4743429..99ec5e550 100644 --- a/doc/source/api/scripts.log_evaluation.VisualiseProfileData.rst +++ b/doc/source/api/scripts.log_evaluation.VisualiseProfileData.rst @@ -2,7 +2,7 @@ scripts.log\_evaluation.VisualiseProfileData module =================================================== .. automodule:: scripts.log_evaluation.VisualiseProfileData - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.log_evaluation.rst b/doc/source/api/scripts.log_evaluation.rst index f02871182..b268ea05d 100644 --- a/doc/source/api/scripts.log_evaluation.rst +++ b/doc/source/api/scripts.log_evaluation.rst @@ -2,18 +2,18 @@ scripts.log\_evaluation package =============================== .. automodule:: scripts.log_evaluation - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.log_evaluation.GraphicalThreadProfiler scripts.log_evaluation.GraphicalThreadProfiler_multi scripts.log_evaluation.VisualiseProfileData scripts.log_evaluation.template_strings - diff --git a/doc/source/api/scripts.log_evaluation.template_strings.rst b/doc/source/api/scripts.log_evaluation.template_strings.rst index 98d5eb0d5..da3cd4c37 100644 --- a/doc/source/api/scripts.log_evaluation.template_strings.rst +++ b/doc/source/api/scripts.log_evaluation.template_strings.rst @@ -2,7 +2,7 @@ scripts.log\_evaluation.template\_strings module ================================================ .. automodule:: scripts.log_evaluation.template_strings - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/scripts.rst b/doc/source/api/scripts.rst index fbfa6f18e..0dcd7246e 100644 --- a/doc/source/api/scripts.rst +++ b/doc/source/api/scripts.rst @@ -2,26 +2,19 @@ scripts package =============== .. automodule:: scripts - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: Subpackages ----------- .. toctree:: + :maxdepth: 4 - scripts.citation_extractor - scripts.config_generator - scripts.configurator_tests - scripts.dawn_runner - scripts.log_evaluation - -Submodules ----------- - -.. toctree:: - - scripts.dawn_compatible_test - + scripts.citation_extractor + scripts.config_generator + scripts.configurator_tests + scripts.dawn_runner + scripts.log_evaluation diff --git a/doc/source/api/setup.rst b/doc/source/api/setup.rst index 329d4ece1..8366cedc0 100644 --- a/doc/source/api/setup.rst +++ b/doc/source/api/setup.rst @@ -2,7 +2,7 @@ setup module ============ .. automodule:: setup - :members: - :private-members: - :undoc-members: - :show-inheritance: + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api_plugin/plugin_examples.example_median_filter.rst b/doc/source/api_plugin/plugin_examples.example_median_filter.rst index 7256e8e3d..9d0e5057c 100644 --- a/doc/source/api_plugin/plugin_examples.example_median_filter.rst +++ b/doc/source/api_plugin/plugin_examples.example_median_filter.rst @@ -2,6 +2,6 @@ plugin\_examples.example\_median\_filter module =============================================== .. automodule:: plugin_examples.example_median_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template1.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template1.rst new file mode 100644 index 000000000..548e5d39b --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template1.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template1 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template1 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template10.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template10.rst new file mode 100644 index 000000000..4f6d2576b --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template10.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template10 module +==================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template10 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes.rst new file mode 100644 index 000000000..0009d3582 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template1\_with\_detailed\_notes module +========================================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template2.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template2.rst new file mode 100644 index 000000000..18240e884 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template2.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template2 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template2 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template3.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template3.rst new file mode 100644 index 000000000..ae9049b34 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template3.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template3 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template3 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template4.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template4.rst new file mode 100644 index 000000000..5b1267732 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template4.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template4 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template4 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template5.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template5.rst new file mode 100644 index 000000000..84f8a0b41 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template5.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template5 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template5 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template6.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template6.rst new file mode 100644 index 000000000..c4b39f231 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template6.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template6 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template6 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template7.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template7.rst new file mode 100644 index 000000000..55bcdea99 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template7.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template7 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template7 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template8.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template8.rst new file mode 100644 index 000000000..fb4eb1d63 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template8.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template8 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template8 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template9.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template9.rst new file mode 100644 index 000000000..31fda6e2e --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.plugin_template9.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.general.plugin\_template9 module +=================================================================== + +.. automodule:: plugin_examples.plugin_templates.general.plugin_template9 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.general.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.general.rst new file mode 100644 index 000000000..87463a736 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.general.rst @@ -0,0 +1,28 @@ +plugin\_examples.plugin\_templates.general package +================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates.general.plugin_template1 + plugin_examples.plugin_templates.general.plugin_template10 + plugin_examples.plugin_templates.general.plugin_template1_with_detailed_notes + plugin_examples.plugin_templates.general.plugin_template2 + plugin_examples.plugin_templates.general.plugin_template3 + plugin_examples.plugin_templates.general.plugin_template4 + plugin_examples.plugin_templates.general.plugin_template5 + plugin_examples.plugin_templates.general.plugin_template6 + plugin_examples.plugin_templates.general.plugin_template7 + plugin_examples.plugin_templates.general.plugin_template8 + plugin_examples.plugin_templates.general.plugin_template9 + +Module contents +--------------- + +.. automodule:: plugin_examples.plugin_templates.general + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.rst new file mode 100644 index 000000000..a1a760213 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.rst @@ -0,0 +1,21 @@ +plugin\_examples.plugin\_templates.iterative package +==================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates.iterative.testing_iterative_plugin + plugin_examples.plugin_templates.iterative.testing_iterative_plugin2 + plugin_examples.plugin_templates.iterative.testing_iterative_plugin3 + plugin_examples.plugin_templates.iterative.testing_iterative_plugin4 + +Module contents +--------------- + +.. automodule:: plugin_examples.plugin_templates.iterative + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin.rst new file mode 100644 index 000000000..f5919cff0 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin module +============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin2.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin2.rst new file mode 100644 index 000000000..3628f7465 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin2.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin2 module +=============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin2 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin3.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin3.rst new file mode 100644 index 000000000..b34f6e01f --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin3.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin3 module +=============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin3 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin4.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin4.rst new file mode 100644 index 000000000..3c5b573d8 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.iterative.testing_iterative_plugin4.rst @@ -0,0 +1,7 @@ +plugin\_examples.plugin\_templates.iterative.testing\_iterative\_plugin4 module +=============================================================================== + +.. automodule:: plugin_examples.plugin_templates.iterative.testing_iterative_plugin4 + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.plugin_templates.rst b/doc/source/api_plugin/plugin_examples.plugin_templates.rst new file mode 100644 index 000000000..bff170766 --- /dev/null +++ b/doc/source/api_plugin/plugin_examples.plugin_templates.rst @@ -0,0 +1,19 @@ +plugin\_examples.plugin\_templates package +========================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates.general + plugin_examples.plugin_templates.iterative + +Module contents +--------------- + +.. automodule:: plugin_examples.plugin_templates + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/plugin_examples.rst b/doc/source/api_plugin/plugin_examples.rst index 9cde52f8a..0f3109a71 100644 --- a/doc/source/api_plugin/plugin_examples.rst +++ b/doc/source/api_plugin/plugin_examples.rst @@ -1,10 +1,19 @@ plugin\_examples package ======================== +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + plugin_examples.plugin_templates + Submodules ---------- .. toctree:: + :maxdepth: 4 plugin_examples.example_median_filter @@ -12,6 +21,6 @@ Module contents --------------- .. automodule:: plugin_examples - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.basic_plugin_runner.rst b/doc/source/api_plugin/savu.core.basic_plugin_runner.rst index ceb06720a..f4ebcda37 100644 --- a/doc/source/api_plugin/savu.core.basic_plugin_runner.rst +++ b/doc/source/api_plugin/savu.core.basic_plugin_runner.rst @@ -2,6 +2,6 @@ savu.core.basic\_plugin\_runner module ====================================== .. automodule:: savu.core.basic_plugin_runner - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.checkpointing.rst b/doc/source/api_plugin/savu.core.checkpointing.rst index 667d792e2..6fbda600b 100644 --- a/doc/source/api_plugin/savu.core.checkpointing.rst +++ b/doc/source/api_plugin/savu.core.checkpointing.rst @@ -2,6 +2,6 @@ savu.core.checkpointing module ============================== .. automodule:: savu.core.checkpointing - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.plugin_runner.rst b/doc/source/api_plugin/savu.core.plugin_runner.rst index 603f09f5f..1039ee20c 100644 --- a/doc/source/api_plugin/savu.core.plugin_runner.rst +++ b/doc/source/api_plugin/savu.core.plugin_runner.rst @@ -2,6 +2,6 @@ savu.core.plugin\_runner module =============================== .. automodule:: savu.core.plugin_runner - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.rst b/doc/source/api_plugin/savu.core.rst index 4a3627de0..17b975a93 100644 --- a/doc/source/api_plugin/savu.core.rst +++ b/doc/source/api_plugin/savu.core.rst @@ -5,13 +5,15 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.core.transports + savu.core.transports Submodules ---------- .. toctree:: + :maxdepth: 4 savu.core.basic_plugin_runner savu.core.checkpointing @@ -23,6 +25,6 @@ Module contents --------------- .. automodule:: savu.core - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.transport_setup.rst b/doc/source/api_plugin/savu.core.transport_setup.rst index 40c676711..ca4519592 100644 --- a/doc/source/api_plugin/savu.core.transport_setup.rst +++ b/doc/source/api_plugin/savu.core.transport_setup.rst @@ -2,6 +2,6 @@ savu.core.transport\_setup module ================================= .. automodule:: savu.core.transport_setup - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.transports.base_transport.rst b/doc/source/api_plugin/savu.core.transports.base_transport.rst index cbfdf3a66..2aadf8ea1 100644 --- a/doc/source/api_plugin/savu.core.transports.base_transport.rst +++ b/doc/source/api_plugin/savu.core.transports.base_transport.rst @@ -2,6 +2,6 @@ savu.core.transports.base\_transport module =========================================== .. automodule:: savu.core.transports.base_transport - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.transports.basic_transport.rst b/doc/source/api_plugin/savu.core.transports.basic_transport.rst index 14108d20a..1bce03223 100644 --- a/doc/source/api_plugin/savu.core.transports.basic_transport.rst +++ b/doc/source/api_plugin/savu.core.transports.basic_transport.rst @@ -2,6 +2,6 @@ savu.core.transports.basic\_transport module ============================================ .. automodule:: savu.core.transports.basic_transport - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.transports.dosna_transport.rst b/doc/source/api_plugin/savu.core.transports.dosna_transport.rst index 18b4d2572..c62f4b0cf 100644 --- a/doc/source/api_plugin/savu.core.transports.dosna_transport.rst +++ b/doc/source/api_plugin/savu.core.transports.dosna_transport.rst @@ -2,6 +2,6 @@ savu.core.transports.dosna\_transport module ============================================ .. automodule:: savu.core.transports.dosna_transport - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.transports.hdf5_transport.rst b/doc/source/api_plugin/savu.core.transports.hdf5_transport.rst index d01bb7715..d73435bda 100644 --- a/doc/source/api_plugin/savu.core.transports.hdf5_transport.rst +++ b/doc/source/api_plugin/savu.core.transports.hdf5_transport.rst @@ -2,6 +2,6 @@ savu.core.transports.hdf5\_transport module =========================================== .. automodule:: savu.core.transports.hdf5_transport - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.transports.rst b/doc/source/api_plugin/savu.core.transports.rst index 2abe5bd6e..e0757d161 100644 --- a/doc/source/api_plugin/savu.core.transports.rst +++ b/doc/source/api_plugin/savu.core.transports.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.core.transports.base_transport savu.core.transports.basic_transport @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: savu.core.transports - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.core.utils.rst b/doc/source/api_plugin/savu.core.utils.rst index ed238b3e2..301c28d19 100644 --- a/doc/source/api_plugin/savu.core.utils.rst +++ b/doc/source/api_plugin/savu.core.utils.rst @@ -2,6 +2,6 @@ savu.core.utils module ====================== .. automodule:: savu.core.utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.chunking.rst b/doc/source/api_plugin/savu.data.chunking.rst index f1fbc1a9c..7175a924c 100644 --- a/doc/source/api_plugin/savu.data.chunking.rst +++ b/doc/source/api_plugin/savu.data.chunking.rst @@ -2,6 +2,6 @@ savu.data.chunking module ========================= .. automodule:: savu.data.chunking - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data.rst b/doc/source/api_plugin/savu.data.data_structures.data.rst index 36980a2b3..327bc121c 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data module ====================================== .. automodule:: savu.data.data_structures.data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_add_ons.rst b/doc/source/api_plugin/savu.data.data_structures.data_add_ons.rst index 8d8ca2cd7..df12b02f1 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_add_ons.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_add_ons.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_add\_ons module ================================================ .. automodule:: savu.data.data_structures.data_add_ons - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_create.rst b/doc/source/api_plugin/savu.data.data_structures.data_create.rst index 1b9ee634c..4d8f80c6f 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_create.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_create.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_create module ============================================== .. automodule:: savu.data.data_structures.data_create - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_notes.rst b/doc/source/api_plugin/savu.data.data_structures.data_notes.rst index 09cdbfbcf..d0aba149a 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_notes.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_notes.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_notes module ============================================= .. automodule:: savu.data.data_structures.data_notes - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.base_type.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.base_type.rst index 26f7f6205..7da4aea0d 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.base_type.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.base_type.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.base\_type module ======================================================== .. automodule:: savu.data.data_structures.data_types.base_type - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst index 9b5bfa160..b3ae7b38e 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.data_plus_darks_and_flats.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.data\_plus\_darks\_and\_flats module =========================================================================== .. automodule:: savu.data.data_structures.data_types.data_plus_darks_and_flats - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.image_data.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.image_data.rst index 989339127..99d46d80e 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.image_data.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.image_data.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.image\_data module ========================================================= .. automodule:: savu.data.data_structures.data_types.image_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.map_3dto4d_h5.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.map_3dto4d_h5.rst index 54e482489..98675e115 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.map_3dto4d_h5.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.map_3dto4d_h5.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.map\_3dto4d\_h5 module ============================================================= .. automodule:: savu.data.data_structures.data_types.map_3dto4d_h5 - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.mrc.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.mrc.rst index 0b5780655..878800ad4 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.mrc.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.mrc.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.mrc module ================================================= .. automodule:: savu.data.data_structures.data_types.mrc - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.replicate.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.replicate.rst index 1b2c5bfde..328686fd3 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.replicate.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.replicate.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.replicate module ======================================================= .. automodule:: savu.data.data_structures.data_types.replicate - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.rst index c633de104..369404c7b 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.data_structures.data_types.base_type savu.data.data_structures.data_types.data_plus_darks_and_flats @@ -18,6 +19,6 @@ Module contents --------------- .. automodule:: savu.data.data_structures.data_types - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.data_types.stitch_data.rst b/doc/source/api_plugin/savu.data.data_structures.data_types.stitch_data.rst index e4eec9e7f..0f7648954 100644 --- a/doc/source/api_plugin/savu.data.data_structures.data_types.stitch_data.rst +++ b/doc/source/api_plugin/savu.data.data_structures.data_types.stitch_data.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.data\_types.stitch\_data module ========================================================== .. automodule:: savu.data.data_structures.data_types.stitch_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.plugin_data.rst b/doc/source/api_plugin/savu.data.data_structures.plugin_data.rst index 4092fab43..7a96404a9 100644 --- a/doc/source/api_plugin/savu.data.data_structures.plugin_data.rst +++ b/doc/source/api_plugin/savu.data.data_structures.plugin_data.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.plugin\_data module ============================================== .. automodule:: savu.data.data_structures.plugin_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.preview.rst b/doc/source/api_plugin/savu.data.data_structures.preview.rst index ca22b6ed5..dca472ddd 100644 --- a/doc/source/api_plugin/savu.data.data_structures.preview.rst +++ b/doc/source/api_plugin/savu.data.data_structures.preview.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.preview module ========================================= .. automodule:: savu.data.data_structures.preview - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.rst b/doc/source/api_plugin/savu.data.data_structures.rst index 4cf6474f1..b6851c832 100644 --- a/doc/source/api_plugin/savu.data.data_structures.rst +++ b/doc/source/api_plugin/savu.data.data_structures.rst @@ -5,13 +5,15 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.data.data_structures.data_types + savu.data.data_structures.data_types Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.data_structures.data savu.data.data_structures.data_add_ons @@ -25,6 +27,6 @@ Module contents --------------- .. automodule:: savu.data.data_structures - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.data_structures.utils.rst b/doc/source/api_plugin/savu.data.data_structures.utils.rst index 4b947a0e0..2907fd9da 100644 --- a/doc/source/api_plugin/savu.data.data_structures.utils.rst +++ b/doc/source/api_plugin/savu.data.data_structures.utils.rst @@ -2,6 +2,6 @@ savu.data.data\_structures.utils module ======================================= .. automodule:: savu.data.data_structures.utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.experiment_collection.rst b/doc/source/api_plugin/savu.data.experiment_collection.rst index 999ffe453..c5f34f991 100644 --- a/doc/source/api_plugin/savu.data.experiment_collection.rst +++ b/doc/source/api_plugin/savu.data.experiment_collection.rst @@ -2,6 +2,6 @@ savu.data.experiment\_collection module ======================================= .. automodule:: savu.data.experiment_collection - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.framework_citations.rst b/doc/source/api_plugin/savu.data.framework_citations.rst index 1b1c482b5..364171036 100644 --- a/doc/source/api_plugin/savu.data.framework_citations.rst +++ b/doc/source/api_plugin/savu.data.framework_citations.rst @@ -2,6 +2,6 @@ savu.data.framework\_citations module ===================================== .. automodule:: savu.data.framework_citations - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.meta_data.rst b/doc/source/api_plugin/savu.data.meta_data.rst index 2c468a0d1..2856f6e23 100644 --- a/doc/source/api_plugin/savu.data.meta_data.rst +++ b/doc/source/api_plugin/savu.data.meta_data.rst @@ -2,6 +2,6 @@ savu.data.meta\_data module =========================== .. automodule:: savu.data.meta_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.plugin_list.rst b/doc/source/api_plugin/savu.data.plugin_list.rst index e7e2c2113..8c800a5b2 100644 --- a/doc/source/api_plugin/savu.data.plugin_list.rst +++ b/doc/source/api_plugin/savu.data.plugin_list.rst @@ -2,6 +2,6 @@ savu.data.plugin\_list module ============================= .. automodule:: savu.data.plugin_list - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.rst b/doc/source/api_plugin/savu.data.rst index 297f0417d..5a37ba4ca 100644 --- a/doc/source/api_plugin/savu.data.rst +++ b/doc/source/api_plugin/savu.data.rst @@ -5,14 +5,16 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.data.data_structures - savu.data.transport_data + savu.data.data_structures + savu.data.transport_data Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.chunking savu.data.experiment_collection @@ -24,6 +26,6 @@ Module contents --------------- .. automodule:: savu.data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.transport_data.base_transport_data.rst b/doc/source/api_plugin/savu.data.transport_data.base_transport_data.rst index 491b4c9ab..60d0cfa4b 100644 --- a/doc/source/api_plugin/savu.data.transport_data.base_transport_data.rst +++ b/doc/source/api_plugin/savu.data.transport_data.base_transport_data.rst @@ -2,6 +2,6 @@ savu.data.transport\_data.base\_transport\_data module ====================================================== .. automodule:: savu.data.transport_data.base_transport_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.transport_data.basic_transport_data.rst b/doc/source/api_plugin/savu.data.transport_data.basic_transport_data.rst index f71190fd2..325f827d8 100644 --- a/doc/source/api_plugin/savu.data.transport_data.basic_transport_data.rst +++ b/doc/source/api_plugin/savu.data.transport_data.basic_transport_data.rst @@ -2,6 +2,6 @@ savu.data.transport\_data.basic\_transport\_data module ======================================================= .. automodule:: savu.data.transport_data.basic_transport_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.transport_data.dosna_transport_data.rst b/doc/source/api_plugin/savu.data.transport_data.dosna_transport_data.rst index 54a4d2c9d..348ef1e6c 100644 --- a/doc/source/api_plugin/savu.data.transport_data.dosna_transport_data.rst +++ b/doc/source/api_plugin/savu.data.transport_data.dosna_transport_data.rst @@ -2,6 +2,6 @@ savu.data.transport\_data.dosna\_transport\_data module ======================================================= .. automodule:: savu.data.transport_data.dosna_transport_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.transport_data.hdf5_transport_data.rst b/doc/source/api_plugin/savu.data.transport_data.hdf5_transport_data.rst index 5a880b02d..c168bb5c7 100644 --- a/doc/source/api_plugin/savu.data.transport_data.hdf5_transport_data.rst +++ b/doc/source/api_plugin/savu.data.transport_data.hdf5_transport_data.rst @@ -2,6 +2,6 @@ savu.data.transport\_data.hdf5\_transport\_data module ====================================================== .. automodule:: savu.data.transport_data.hdf5_transport_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.transport_data.rst b/doc/source/api_plugin/savu.data.transport_data.rst index c58cc6651..6f14afef5 100644 --- a/doc/source/api_plugin/savu.data.transport_data.rst +++ b/doc/source/api_plugin/savu.data.transport_data.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.data.transport_data.base_transport_data savu.data.transport_data.basic_transport_data @@ -16,6 +17,6 @@ Module contents --------------- .. automodule:: savu.data.transport_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.data.transport_data.slice_lists.rst b/doc/source/api_plugin/savu.data.transport_data.slice_lists.rst index ebefcd2b6..fa7d3550b 100644 --- a/doc/source/api_plugin/savu.data.transport_data.slice_lists.rst +++ b/doc/source/api_plugin/savu.data.transport_data.slice_lists.rst @@ -2,6 +2,6 @@ savu.data.transport\_data.slice\_lists module ============================================= .. automodule:: savu.data.transport_data.slice_lists - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.absorption_corrections.base_absorption_correction.rst b/doc/source/api_plugin/savu.plugins.absorption_corrections.base_absorption_correction.rst index a70ece54f..0d4d30e2d 100644 --- a/doc/source/api_plugin/savu.plugins.absorption_corrections.base_absorption_correction.rst +++ b/doc/source/api_plugin/savu.plugins.absorption_corrections.base_absorption_correction.rst @@ -2,6 +2,6 @@ savu.plugins.absorption\_corrections.base\_absorption\_correction module ======================================================================== .. automodule:: savu.plugins.absorption_corrections.base_absorption_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst b/doc/source/api_plugin/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst index a6eebf636..baad633da 100644 --- a/doc/source/api_plugin/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst +++ b/doc/source/api_plugin/savu.plugins.absorption_corrections.mc_near_absorption_correction.rst @@ -2,6 +2,6 @@ savu.plugins.absorption\_corrections.mc\_near\_absorption\_correction module ============================================================================ .. automodule:: savu.plugins.absorption_corrections.mc_near_absorption_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.absorption_corrections.rst b/doc/source/api_plugin/savu.plugins.absorption_corrections.rst index 56130a7a1..8a4a47ea6 100644 --- a/doc/source/api_plugin/savu.plugins.absorption_corrections.rst +++ b/doc/source/api_plugin/savu.plugins.absorption_corrections.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.absorption_corrections.base_absorption_correction savu.plugins.absorption_corrections.mc_near_absorption_correction @@ -13,6 +14,6 @@ Module contents --------------- .. automodule:: savu.plugins.absorption_corrections - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.alignment.projection_shift.rst b/doc/source/api_plugin/savu.plugins.alignment.projection_shift.rst index 15f2eeb15..964356186 100644 --- a/doc/source/api_plugin/savu.plugins.alignment.projection_shift.rst +++ b/doc/source/api_plugin/savu.plugins.alignment.projection_shift.rst @@ -2,6 +2,6 @@ savu.plugins.alignment.projection\_shift module =============================================== .. automodule:: savu.plugins.alignment.projection_shift - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.alignment.projection_vertical_alignment.rst b/doc/source/api_plugin/savu.plugins.alignment.projection_vertical_alignment.rst index e12452833..c466bf573 100644 --- a/doc/source/api_plugin/savu.plugins.alignment.projection_vertical_alignment.rst +++ b/doc/source/api_plugin/savu.plugins.alignment.projection_vertical_alignment.rst @@ -2,6 +2,6 @@ savu.plugins.alignment.projection\_vertical\_alignment module ============================================================= .. automodule:: savu.plugins.alignment.projection_vertical_alignment - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.alignment.rst b/doc/source/api_plugin/savu.plugins.alignment.rst index 30844df9f..f566f863e 100644 --- a/doc/source/api_plugin/savu.plugins.alignment.rst +++ b/doc/source/api_plugin/savu.plugins.alignment.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.alignment.projection_shift savu.plugins.alignment.projection_vertical_alignment @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: savu.plugins.alignment - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.alignment.sinogram_alignment.rst b/doc/source/api_plugin/savu.plugins.alignment.sinogram_alignment.rst index d9517912f..a931f312b 100644 --- a/doc/source/api_plugin/savu.plugins.alignment.sinogram_alignment.rst +++ b/doc/source/api_plugin/savu.plugins.alignment.sinogram_alignment.rst @@ -2,6 +2,6 @@ savu.plugins.alignment.sinogram\_alignment module ================================================= .. automodule:: savu.plugins.alignment.sinogram_alignment - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.alignment.sinogram_clean.rst b/doc/source/api_plugin/savu.plugins.alignment.sinogram_clean.rst index d48624517..81d9fdc6c 100644 --- a/doc/source/api_plugin/savu.plugins.alignment.sinogram_clean.rst +++ b/doc/source/api_plugin/savu.plugins.alignment.sinogram_clean.rst @@ -2,6 +2,6 @@ savu.plugins.alignment.sinogram\_clean module ============================================= .. automodule:: savu.plugins.alignment.sinogram_clean - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.analysis.base_analysis.rst b/doc/source/api_plugin/savu.plugins.analysis.base_analysis.rst index 127ae1222..4f4ba6399 100644 --- a/doc/source/api_plugin/savu.plugins.analysis.base_analysis.rst +++ b/doc/source/api_plugin/savu.plugins.analysis.base_analysis.rst @@ -2,6 +2,6 @@ savu.plugins.analysis.base\_analysis module =========================================== .. automodule:: savu.plugins.analysis.base_analysis - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.analysis.histogram.rst b/doc/source/api_plugin/savu.plugins.analysis.histogram.rst index 919214bef..031fa2145 100644 --- a/doc/source/api_plugin/savu.plugins.analysis.histogram.rst +++ b/doc/source/api_plugin/savu.plugins.analysis.histogram.rst @@ -2,6 +2,6 @@ savu.plugins.analysis.histogram module ====================================== .. automodule:: savu.plugins.analysis.histogram - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.analysis.rst b/doc/source/api_plugin/savu.plugins.analysis.rst index f2a9d4ca7..2fb426cc4 100644 --- a/doc/source/api_plugin/savu.plugins.analysis.rst +++ b/doc/source/api_plugin/savu.plugins.analysis.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.analysis.base_analysis savu.plugins.analysis.histogram @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: savu.plugins.analysis - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.analysis.stats.rst b/doc/source/api_plugin/savu.plugins.analysis.stats.rst index 27f2f8153..dc28720df 100644 --- a/doc/source/api_plugin/savu.plugins.analysis.stats.rst +++ b/doc/source/api_plugin/savu.plugins.analysis.stats.rst @@ -2,6 +2,6 @@ savu.plugins.analysis.stats module ================================== .. automodule:: savu.plugins.analysis.stats - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.analysis.stxm_analysis.rst b/doc/source/api_plugin/savu.plugins.analysis.stxm_analysis.rst index ab2dcbaae..99cb8c022 100644 --- a/doc/source/api_plugin/savu.plugins.analysis.stxm_analysis.rst +++ b/doc/source/api_plugin/savu.plugins.analysis.stxm_analysis.rst @@ -2,6 +2,6 @@ savu.plugins.analysis.stxm\_analysis module =========================================== .. automodule:: savu.plugins.analysis.stxm_analysis - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst index 483a84854..c41ede883 100644 --- a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst +++ b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.base_azimuthal_integrator.rst @@ -2,6 +2,6 @@ savu.plugins.azimuthal\_integrators.base\_azimuthal\_integrator module ====================================================================== .. automodule:: savu.plugins.azimuthal_integrators.base_azimuthal_integrator - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst index 26d4b4103..d9bbc29c6 100644 --- a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst +++ b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator.rst @@ -2,6 +2,6 @@ savu.plugins.azimuthal\_integrators.pyfai\_azimuthal\_integrator module ======================================================================= .. automodule:: savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst index 26297939b..66fee9745 100644 --- a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst +++ b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate.rst @@ -2,6 +2,6 @@ savu.plugins.azimuthal\_integrators.pyfai\_azimuthal\_integrator\_separate modul ================================================================================= .. automodule:: savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst index 5bbdfb990..3b81e1fe9 100644 --- a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst +++ b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter.rst @@ -2,6 +2,6 @@ savu.plugins.azimuthal\_integrators.pyfai\_azimuthal\_integrator\_with\_bragg\_f ============================================================================================ .. automodule:: savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.rst b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.rst index ae1420b11..8b1e11a27 100644 --- a/doc/source/api_plugin/savu.plugins.azimuthal_integrators.rst +++ b/doc/source/api_plugin/savu.plugins.azimuthal_integrators.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.azimuthal_integrators.base_azimuthal_integrator savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: savu.plugins.azimuthal_integrators - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.arithmetic_operations.rst b/doc/source/api_plugin/savu.plugins.basic_operations.arithmetic_operations.rst index b80bf489f..87612d7c8 100644 --- a/doc/source/api_plugin/savu.plugins.basic_operations.arithmetic_operations.rst +++ b/doc/source/api_plugin/savu.plugins.basic_operations.arithmetic_operations.rst @@ -2,6 +2,6 @@ savu.plugins.basic\_operations.arithmetic\_operations module ============================================================ .. automodule:: savu.plugins.basic_operations.arithmetic_operations - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.basic_operations.rst b/doc/source/api_plugin/savu.plugins.basic_operations.basic_operations.rst index d723c7813..4a08b8541 100644 --- a/doc/source/api_plugin/savu.plugins.basic_operations.basic_operations.rst +++ b/doc/source/api_plugin/savu.plugins.basic_operations.basic_operations.rst @@ -2,6 +2,6 @@ savu.plugins.basic\_operations.basic\_operations module ======================================================= .. automodule:: savu.plugins.basic_operations.basic_operations - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.data_rescale.rst b/doc/source/api_plugin/savu.plugins.basic_operations.data_rescale.rst index 3c03b8fd3..1cbd1452f 100644 --- a/doc/source/api_plugin/savu.plugins.basic_operations.data_rescale.rst +++ b/doc/source/api_plugin/savu.plugins.basic_operations.data_rescale.rst @@ -2,6 +2,6 @@ savu.plugins.basic\_operations.data\_rescale module =================================================== .. automodule:: savu.plugins.basic_operations.data_rescale - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.data_threshold.rst b/doc/source/api_plugin/savu.plugins.basic_operations.data_threshold.rst new file mode 100644 index 000000000..d6527bfc7 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.basic_operations.data_threshold.rst @@ -0,0 +1,7 @@ +savu.plugins.basic\_operations.data\_threshold module +===================================================== + +.. automodule:: savu.plugins.basic_operations.data_threshold + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.elementwise_arrays_arithmetics.rst b/doc/source/api_plugin/savu.plugins.basic_operations.elementwise_arrays_arithmetics.rst new file mode 100644 index 000000000..4019bac2d --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.basic_operations.elementwise_arrays_arithmetics.rst @@ -0,0 +1,7 @@ +savu.plugins.basic\_operations.elementwise\_arrays\_arithmetics module +====================================================================== + +.. automodule:: savu.plugins.basic_operations.elementwise_arrays_arithmetics + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.get_data_statistics.rst b/doc/source/api_plugin/savu.plugins.basic_operations.get_data_statistics.rst index e404e6c89..39832f572 100644 --- a/doc/source/api_plugin/savu.plugins.basic_operations.get_data_statistics.rst +++ b/doc/source/api_plugin/savu.plugins.basic_operations.get_data_statistics.rst @@ -2,6 +2,6 @@ savu.plugins.basic\_operations.get\_data\_statistics module =========================================================== .. automodule:: savu.plugins.basic_operations.get_data_statistics - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.no_process_plugin.rst b/doc/source/api_plugin/savu.plugins.basic_operations.no_process_plugin.rst index 470db123c..00ef2482f 100644 --- a/doc/source/api_plugin/savu.plugins.basic_operations.no_process_plugin.rst +++ b/doc/source/api_plugin/savu.plugins.basic_operations.no_process_plugin.rst @@ -2,6 +2,6 @@ savu.plugins.basic\_operations.no\_process\_plugin module ========================================================= .. automodule:: savu.plugins.basic_operations.no_process_plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.rst b/doc/source/api_plugin/savu.plugins.basic_operations.rst index bd55f84cb..b6fcd37f1 100644 --- a/doc/source/api_plugin/savu.plugins.basic_operations.rst +++ b/doc/source/api_plugin/savu.plugins.basic_operations.rst @@ -5,17 +5,22 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.basic_operations.arithmetic_operations savu.plugins.basic_operations.basic_operations savu.plugins.basic_operations.data_rescale + savu.plugins.basic_operations.data_threshold + savu.plugins.basic_operations.elementwise_arrays_arithmetics savu.plugins.basic_operations.get_data_statistics savu.plugins.basic_operations.no_process_plugin + savu.plugins.basic_operations.test_plugin + savu.plugins.basic_operations.value_mask_replacement Module contents --------------- .. automodule:: savu.plugins.basic_operations - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.test_plugin.rst b/doc/source/api_plugin/savu.plugins.basic_operations.test_plugin.rst new file mode 100644 index 000000000..f527b8eaf --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.basic_operations.test_plugin.rst @@ -0,0 +1,7 @@ +savu.plugins.basic\_operations.test\_plugin module +================================================== + +.. automodule:: savu.plugins.basic_operations.test_plugin + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.basic_operations.value_mask_replacement.rst b/doc/source/api_plugin/savu.plugins.basic_operations.value_mask_replacement.rst new file mode 100644 index 000000000..4db312c43 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.basic_operations.value_mask_replacement.rst @@ -0,0 +1,7 @@ +savu.plugins.basic\_operations.value\_mask\_replacement module +============================================================== + +.. automodule:: savu.plugins.basic_operations.value_mask_replacement + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.centering.rst b/doc/source/api_plugin/savu.plugins.centering.rst index af691e257..107869b59 100644 --- a/doc/source/api_plugin/savu.plugins.centering.rst +++ b/doc/source/api_plugin/savu.plugins.centering.rst @@ -5,15 +5,15 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.centering.vo_centering - savu.plugins.centering.vo_centering_gpu savu.plugins.centering.vo_centering_iterative Module contents --------------- .. automodule:: savu.plugins.centering - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.centering.vo_centering.rst b/doc/source/api_plugin/savu.plugins.centering.vo_centering.rst index 130327d86..7beed2bd8 100644 --- a/doc/source/api_plugin/savu.plugins.centering.vo_centering.rst +++ b/doc/source/api_plugin/savu.plugins.centering.vo_centering.rst @@ -2,6 +2,6 @@ savu.plugins.centering.vo\_centering module =========================================== .. automodule:: savu.plugins.centering.vo_centering - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.centering.vo_centering_iterative.rst b/doc/source/api_plugin/savu.plugins.centering.vo_centering_iterative.rst index bb8fdf29b..dbd1df6ab 100644 --- a/doc/source/api_plugin/savu.plugins.centering.vo_centering_iterative.rst +++ b/doc/source/api_plugin/savu.plugins.centering.vo_centering_iterative.rst @@ -2,6 +2,6 @@ savu.plugins.centering.vo\_centering\_iterative module ====================================================== .. automodule:: savu.plugins.centering.vo_centering_iterative - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.component_analysis.base_component_analysis.rst b/doc/source/api_plugin/savu.plugins.component_analysis.base_component_analysis.rst index 52700f091..8f738ff92 100644 --- a/doc/source/api_plugin/savu.plugins.component_analysis.base_component_analysis.rst +++ b/doc/source/api_plugin/savu.plugins.component_analysis.base_component_analysis.rst @@ -2,6 +2,6 @@ savu.plugins.component\_analysis.base\_component\_analysis module ================================================================= .. automodule:: savu.plugins.component_analysis.base_component_analysis - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.component_analysis.ica.rst b/doc/source/api_plugin/savu.plugins.component_analysis.ica.rst index 3a67cd57b..ca7812a2a 100644 --- a/doc/source/api_plugin/savu.plugins.component_analysis.ica.rst +++ b/doc/source/api_plugin/savu.plugins.component_analysis.ica.rst @@ -2,6 +2,6 @@ savu.plugins.component\_analysis.ica module =========================================== .. automodule:: savu.plugins.component_analysis.ica - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.component_analysis.pca.rst b/doc/source/api_plugin/savu.plugins.component_analysis.pca.rst index 405c0c072..96379e2fd 100644 --- a/doc/source/api_plugin/savu.plugins.component_analysis.pca.rst +++ b/doc/source/api_plugin/savu.plugins.component_analysis.pca.rst @@ -2,6 +2,6 @@ savu.plugins.component\_analysis.pca module =========================================== .. automodule:: savu.plugins.component_analysis.pca - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.component_analysis.rst b/doc/source/api_plugin/savu.plugins.component_analysis.rst index d67c56deb..82412c7eb 100644 --- a/doc/source/api_plugin/savu.plugins.component_analysis.rst +++ b/doc/source/api_plugin/savu.plugins.component_analysis.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.component_analysis.base_component_analysis savu.plugins.component_analysis.ica @@ -14,6 +15,6 @@ Module contents --------------- .. automodule:: savu.plugins.component_analysis - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.base_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.base_correction.rst index 12415871c..2f89a68d3 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.base_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.base_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.base\_correction module ================================================ .. automodule:: savu.plugins.corrections.base_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.camera_rot_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.camera_rot_correction.rst index 73c8ab8d5..9c3c13407 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.camera_rot_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.camera_rot_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.camera\_rot\_correction module ======================================================= .. automodule:: savu.plugins.corrections.camera_rot_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.convert_360_180_sinogram.rst b/doc/source/api_plugin/savu.plugins.corrections.convert_360_180_sinogram.rst index d2cea3983..36d07da00 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.convert_360_180_sinogram.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.convert_360_180_sinogram.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.convert\_360\_180\_sinogram module =========================================================== .. automodule:: savu.plugins.corrections.convert_360_180_sinogram - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.dark_flat_field_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.dark_flat_field_correction.rst index bb9f8aab4..c425e2907 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.dark_flat_field_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.dark_flat_field_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.dark\_flat\_field\_correction module ============================================================= .. automodule:: savu.plugins.corrections.dark_flat_field_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.distortion_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.distortion_correction.rst index 488fc5611..969f5dcf7 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.distortion_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.distortion_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.distortion\_correction module ====================================================== .. automodule:: savu.plugins.corrections.distortion_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.monitor_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.monitor_correction.rst index 03111bf76..127150030 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.monitor_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.monitor_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.monitor\_correction module =================================================== .. automodule:: savu.plugins.corrections.monitor_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.monitor_correction_nd.rst b/doc/source/api_plugin/savu.plugins.corrections.monitor_correction_nd.rst index 85049e610..fd22dbbd7 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.monitor_correction_nd.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.monitor_correction_nd.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.monitor\_correction\_nd module ======================================================= .. automodule:: savu.plugins.corrections.monitor_correction_nd - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.mtf_deconvolution.rst b/doc/source/api_plugin/savu.plugins.corrections.mtf_deconvolution.rst new file mode 100644 index 000000000..fdc651b24 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.corrections.mtf_deconvolution.rst @@ -0,0 +1,7 @@ +savu.plugins.corrections.mtf\_deconvolution module +================================================== + +.. automodule:: savu.plugins.corrections.mtf_deconvolution + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.rst b/doc/source/api_plugin/savu.plugins.corrections.rst index 9dfe38208..bb29e2456 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.rst @@ -5,15 +5,16 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.corrections.base_correction savu.plugins.corrections.camera_rot_correction savu.plugins.corrections.convert_360_180_sinogram savu.plugins.corrections.dark_flat_field_correction savu.plugins.corrections.distortion_correction - savu.plugins.corrections.distortion_correction_deprecated savu.plugins.corrections.monitor_correction savu.plugins.corrections.monitor_correction_nd + savu.plugins.corrections.mtf_deconvolution savu.plugins.corrections.subpixel_shift savu.plugins.corrections.time_based_correction savu.plugins.corrections.time_based_plus_drift_correction @@ -24,6 +25,6 @@ Module contents --------------- .. automodule:: savu.plugins.corrections - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.subpixel_shift.rst b/doc/source/api_plugin/savu.plugins.corrections.subpixel_shift.rst index 3adf71784..bc5fa62b9 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.subpixel_shift.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.subpixel_shift.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.subpixel\_shift module =============================================== .. automodule:: savu.plugins.corrections.subpixel_shift - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.time_based_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.time_based_correction.rst index 4de2742c2..e44623625 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.time_based_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.time_based_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.time\_based\_correction module ======================================================= .. automodule:: savu.plugins.corrections.time_based_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.time_based_plus_drift_correction.rst b/doc/source/api_plugin/savu.plugins.corrections.time_based_plus_drift_correction.rst index c1e9ba150..6dce8bc1d 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.time_based_plus_drift_correction.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.time_based_plus_drift_correction.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.time\_based\_plus\_drift\_correction module ==================================================================== .. automodule:: savu.plugins.corrections.time_based_plus_drift_correction - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.timeseries_field_corrections.rst b/doc/source/api_plugin/savu.plugins.corrections.timeseries_field_corrections.rst index 2a50a10d3..25a80a47e 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.timeseries_field_corrections.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.timeseries_field_corrections.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.timeseries\_field\_corrections module ============================================================== .. automodule:: savu.plugins.corrections.timeseries_field_corrections - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.corrections.xrd_absorption_approximation.rst b/doc/source/api_plugin/savu.plugins.corrections.xrd_absorption_approximation.rst index b92c84972..54fc9a655 100644 --- a/doc/source/api_plugin/savu.plugins.corrections.xrd_absorption_approximation.rst +++ b/doc/source/api_plugin/savu.plugins.corrections.xrd_absorption_approximation.rst @@ -2,6 +2,6 @@ savu.plugins.corrections.xrd\_absorption\_approximation module ============================================================== .. automodule:: savu.plugins.corrections.xrd_absorption_approximation - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.developing.rst b/doc/source/api_plugin/savu.plugins.developing.rst index da2e66e6c..89c2fcd60 100644 --- a/doc/source/api_plugin/savu.plugins.developing.rst +++ b/doc/source/api_plugin/savu.plugins.developing.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.developing.testing_sino_align @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.developing - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.developing.testing_sino_align.rst b/doc/source/api_plugin/savu.plugins.developing.testing_sino_align.rst index 570378350..8cb06cd90 100644 --- a/doc/source/api_plugin/savu.plugins.developing.testing_sino_align.rst +++ b/doc/source/api_plugin/savu.plugins.developing.testing_sino_align.rst @@ -2,6 +2,6 @@ savu.plugins.developing.testing\_sino\_align module =================================================== .. automodule:: savu.plugins.developing.testing_sino_align - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.docstring_parser.rst b/doc/source/api_plugin/savu.plugins.docstring_parser.rst index cf8336971..bd13be3f8 100644 --- a/doc/source/api_plugin/savu.plugins.docstring_parser.rst +++ b/doc/source/api_plugin/savu.plugins.docstring_parser.rst @@ -2,6 +2,6 @@ savu.plugins.docstring\_parser module ===================================== .. automodule:: savu.plugins.docstring_parser - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.all_cpus_plugin.rst b/doc/source/api_plugin/savu.plugins.driver.all_cpus_plugin.rst index 243443319..3bc7d1187 100644 --- a/doc/source/api_plugin/savu.plugins.driver.all_cpus_plugin.rst +++ b/doc/source/api_plugin/savu.plugins.driver.all_cpus_plugin.rst @@ -2,6 +2,6 @@ savu.plugins.driver.all\_cpus\_plugin module ============================================ .. automodule:: savu.plugins.driver.all_cpus_plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.base_driver.rst b/doc/source/api_plugin/savu.plugins.driver.base_driver.rst index 9e9d145df..72c4e632a 100644 --- a/doc/source/api_plugin/savu.plugins.driver.base_driver.rst +++ b/doc/source/api_plugin/savu.plugins.driver.base_driver.rst @@ -2,6 +2,6 @@ savu.plugins.driver.base\_driver module ======================================= .. automodule:: savu.plugins.driver.base_driver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.basic_driver.rst b/doc/source/api_plugin/savu.plugins.driver.basic_driver.rst index 1ff4bfc2f..653d5909e 100644 --- a/doc/source/api_plugin/savu.plugins.driver.basic_driver.rst +++ b/doc/source/api_plugin/savu.plugins.driver.basic_driver.rst @@ -2,6 +2,6 @@ savu.plugins.driver.basic\_driver module ======================================== .. automodule:: savu.plugins.driver.basic_driver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.cpu_plugin.rst b/doc/source/api_plugin/savu.plugins.driver.cpu_plugin.rst index ada3c0f34..9583ac6ca 100644 --- a/doc/source/api_plugin/savu.plugins.driver.cpu_plugin.rst +++ b/doc/source/api_plugin/savu.plugins.driver.cpu_plugin.rst @@ -2,6 +2,6 @@ savu.plugins.driver.cpu\_plugin module ====================================== .. automodule:: savu.plugins.driver.cpu_plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.gpu_plugin.rst b/doc/source/api_plugin/savu.plugins.driver.gpu_plugin.rst index fbf2dbbbb..eced57d56 100644 --- a/doc/source/api_plugin/savu.plugins.driver.gpu_plugin.rst +++ b/doc/source/api_plugin/savu.plugins.driver.gpu_plugin.rst @@ -2,6 +2,6 @@ savu.plugins.driver.gpu\_plugin module ====================================== .. automodule:: savu.plugins.driver.gpu_plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.iterative_plugin.rst b/doc/source/api_plugin/savu.plugins.driver.iterative_plugin.rst index 04894b0b3..f214b7c32 100644 --- a/doc/source/api_plugin/savu.plugins.driver.iterative_plugin.rst +++ b/doc/source/api_plugin/savu.plugins.driver.iterative_plugin.rst @@ -2,6 +2,6 @@ savu.plugins.driver.iterative\_plugin module ============================================ .. automodule:: savu.plugins.driver.iterative_plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.multi_threaded_plugin.rst b/doc/source/api_plugin/savu.plugins.driver.multi_threaded_plugin.rst index f7c285011..573bd3edf 100644 --- a/doc/source/api_plugin/savu.plugins.driver.multi_threaded_plugin.rst +++ b/doc/source/api_plugin/savu.plugins.driver.multi_threaded_plugin.rst @@ -2,6 +2,6 @@ savu.plugins.driver.multi\_threaded\_plugin module ================================================== .. automodule:: savu.plugins.driver.multi_threaded_plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.plugin_driver.rst b/doc/source/api_plugin/savu.plugins.driver.plugin_driver.rst index a92afb263..6bc26ceb2 100644 --- a/doc/source/api_plugin/savu.plugins.driver.plugin_driver.rst +++ b/doc/source/api_plugin/savu.plugins.driver.plugin_driver.rst @@ -2,6 +2,6 @@ savu.plugins.driver.plugin\_driver module ========================================= .. automodule:: savu.plugins.driver.plugin_driver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.driver.rst b/doc/source/api_plugin/savu.plugins.driver.rst index 9cd0ec534..01e15cf99 100644 --- a/doc/source/api_plugin/savu.plugins.driver.rst +++ b/doc/source/api_plugin/savu.plugins.driver.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.driver.all_cpus_plugin savu.plugins.driver.base_driver @@ -14,12 +15,11 @@ Submodules savu.plugins.driver.iterative_plugin savu.plugins.driver.multi_threaded_plugin savu.plugins.driver.plugin_driver - savu.plugins.driver.single_node_multi_threaded_plugin Module contents --------------- .. automodule:: savu.plugins.driver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.band_pass.rst b/doc/source/api_plugin/savu.plugins.filters.band_pass.rst index c9e1851a1..d9aaeabb3 100644 --- a/doc/source/api_plugin/savu.plugins.filters.band_pass.rst +++ b/doc/source/api_plugin/savu.plugins.filters.band_pass.rst @@ -2,6 +2,6 @@ savu.plugins.filters.band\_pass module ====================================== .. automodule:: savu.plugins.filters.band_pass - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.base_filter.rst b/doc/source/api_plugin/savu.plugins.filters.base_filter.rst index ea342d2a3..ceb525dd3 100644 --- a/doc/source/api_plugin/savu.plugins.filters.base_filter.rst +++ b/doc/source/api_plugin/savu.plugins.filters.base_filter.rst @@ -2,6 +2,6 @@ savu.plugins.filters.base\_filter module ======================================== .. automodule:: savu.plugins.filters.base_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu.rst new file mode 100644 index 000000000..6d482321a --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_cpu module +========================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_cpu + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D.rst new file mode 100644 index 000000000..693f4a41f --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_cpu\_3D module +============================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_cpu_3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu.rst new file mode 100644 index 000000000..6506c7033 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_gpu module +========================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_gpu + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D.rst new file mode 100644 index 000000000..3835020be --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.ccpi\_denoising\_gpu\_3D module +============================================================== + +.. automodule:: savu.plugins.filters.denoising.ccpi_denoising_gpu_3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.denoise_bregman_filter.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.denoise_bregman_filter.rst new file mode 100644 index 000000000..7dda18d76 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.denoise_bregman_filter.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.denoise\_bregman\_filter module +============================================================== + +.. automodule:: savu.plugins.filters.denoising.denoise_bregman_filter + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter.rst new file mode 100644 index 000000000..921f2322a --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.median\_filter module +==================================================== + +.. automodule:: savu.plugins.filters.denoising.median_filter + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter_deprecated.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter_deprecated.rst new file mode 100644 index 000000000..7dd3960c8 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter_deprecated.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.median\_filter\_deprecated module +================================================================ + +.. automodule:: savu.plugins.filters.denoising.median_filter_deprecated + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter_gpu.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter_gpu.rst new file mode 100644 index 000000000..e7ea69df4 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.median_filter_gpu.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.denoising.median\_filter\_gpu module +========================================================= + +.. automodule:: savu.plugins.filters.denoising.median_filter_gpu + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.denoising.rst b/doc/source/api_plugin/savu.plugins.filters.denoising.rst new file mode 100644 index 000000000..ed606ba97 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.denoising.rst @@ -0,0 +1,25 @@ +savu.plugins.filters.denoising package +====================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.filters.denoising.ccpi_denoising_cpu + savu.plugins.filters.denoising.ccpi_denoising_cpu_3D + savu.plugins.filters.denoising.ccpi_denoising_gpu + savu.plugins.filters.denoising.ccpi_denoising_gpu_3D + savu.plugins.filters.denoising.denoise_bregman_filter + savu.plugins.filters.denoising.median_filter + savu.plugins.filters.denoising.median_filter_deprecated + savu.plugins.filters.denoising.median_filter_gpu + +Module contents +--------------- + +.. automodule:: savu.plugins.filters.denoising + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezinger.rst b/doc/source/api_plugin/savu.plugins.filters.dezinger.rst index d3dddbb37..ed7fa0628 100644 --- a/doc/source/api_plugin/savu.plugins.filters.dezinger.rst +++ b/doc/source/api_plugin/savu.plugins.filters.dezinger.rst @@ -2,6 +2,6 @@ savu.plugins.filters.dezinger module ==================================== .. automodule:: savu.plugins.filters.dezinger - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezinger_deprecated.rst b/doc/source/api_plugin/savu.plugins.filters.dezinger_deprecated.rst new file mode 100644 index 000000000..000b3ed8d --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.dezinger_deprecated.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.dezinger\_deprecated module +================================================ + +.. automodule:: savu.plugins.filters.dezinger_deprecated + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezinger_simple.rst b/doc/source/api_plugin/savu.plugins.filters.dezinger_simple.rst index 143a31654..c3dbb9de2 100644 --- a/doc/source/api_plugin/savu.plugins.filters.dezinger_simple.rst +++ b/doc/source/api_plugin/savu.plugins.filters.dezinger_simple.rst @@ -2,6 +2,6 @@ savu.plugins.filters.dezinger\_simple module ============================================ .. automodule:: savu.plugins.filters.dezinger_simple - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezinger_sinogram.rst b/doc/source/api_plugin/savu.plugins.filters.dezinger_sinogram.rst index 243fdb055..350c9c171 100644 --- a/doc/source/api_plugin/savu.plugins.filters.dezinger_sinogram.rst +++ b/doc/source/api_plugin/savu.plugins.filters.dezinger_sinogram.rst @@ -2,6 +2,6 @@ savu.plugins.filters.dezinger\_sinogram module ============================================== .. automodule:: savu.plugins.filters.dezinger_sinogram - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger.rst b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger.rst new file mode 100644 index 000000000..fdc2d3ea2 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.dezingers.dezinger module +============================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_gpu.rst b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_gpu.rst new file mode 100644 index 000000000..75fb6048b --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_gpu.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.dezingers.dezinger\_gpu module +=================================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger_gpu + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_simple_deprecated.rst b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_simple_deprecated.rst new file mode 100644 index 000000000..885e6f63e --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_simple_deprecated.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.dezingers.dezinger\_simple\_deprecated module +================================================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger_simple_deprecated + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated.rst b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated.rst new file mode 100644 index 000000000..8ea98ff51 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated.rst @@ -0,0 +1,7 @@ +savu.plugins.filters.dezingers.dezinger\_sinogram\_deprecated module +==================================================================== + +.. automodule:: savu.plugins.filters.dezingers.dezinger_sinogram_deprecated + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dezingers.rst b/doc/source/api_plugin/savu.plugins.filters.dezingers.rst new file mode 100644 index 000000000..80b93f44a --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.filters.dezingers.rst @@ -0,0 +1,21 @@ +savu.plugins.filters.dezingers package +====================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.filters.dezingers.dezinger + savu.plugins.filters.dezingers.dezinger_gpu + savu.plugins.filters.dezingers.dezinger_simple_deprecated + savu.plugins.filters.dezingers.dezinger_sinogram_deprecated + +Module contents +--------------- + +.. automodule:: savu.plugins.filters.dezingers + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.dials_find_spots.rst b/doc/source/api_plugin/savu.plugins.filters.dials_find_spots.rst index 1ecc07dc4..8c34ce5ee 100644 --- a/doc/source/api_plugin/savu.plugins.filters.dials_find_spots.rst +++ b/doc/source/api_plugin/savu.plugins.filters.dials_find_spots.rst @@ -2,6 +2,6 @@ savu.plugins.filters.dials\_find\_spots module ============================================== .. automodule:: savu.plugins.filters.dials_find_spots - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.find_peaks.rst b/doc/source/api_plugin/savu.plugins.filters.find_peaks.rst index fdc87724d..0f940170d 100644 --- a/doc/source/api_plugin/savu.plugins.filters.find_peaks.rst +++ b/doc/source/api_plugin/savu.plugins.filters.find_peaks.rst @@ -2,6 +2,6 @@ savu.plugins.filters.find\_peaks module ======================================= .. automodule:: savu.plugins.filters.find_peaks - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.fresnel_filter.rst b/doc/source/api_plugin/savu.plugins.filters.fresnel_filter.rst index d0f200ec8..c4601dce8 100644 --- a/doc/source/api_plugin/savu.plugins.filters.fresnel_filter.rst +++ b/doc/source/api_plugin/savu.plugins.filters.fresnel_filter.rst @@ -2,6 +2,6 @@ savu.plugins.filters.fresnel\_filter module =========================================== .. automodule:: savu.plugins.filters.fresnel_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.hilbert_filter.rst b/doc/source/api_plugin/savu.plugins.filters.hilbert_filter.rst index daa235695..6ddaffbec 100644 --- a/doc/source/api_plugin/savu.plugins.filters.hilbert_filter.rst +++ b/doc/source/api_plugin/savu.plugins.filters.hilbert_filter.rst @@ -2,6 +2,6 @@ savu.plugins.filters.hilbert\_filter module =========================================== .. automodule:: savu.plugins.filters.hilbert_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.image_interpolation.rst b/doc/source/api_plugin/savu.plugins.filters.image_interpolation.rst index 84e776c97..efa0ae4a5 100644 --- a/doc/source/api_plugin/savu.plugins.filters.image_interpolation.rst +++ b/doc/source/api_plugin/savu.plugins.filters.image_interpolation.rst @@ -2,6 +2,6 @@ savu.plugins.filters.image\_interpolation module ================================================ .. automodule:: savu.plugins.filters.image_interpolation - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.list_to_projections.rst b/doc/source/api_plugin/savu.plugins.filters.list_to_projections.rst index c01a486aa..175ef643d 100644 --- a/doc/source/api_plugin/savu.plugins.filters.list_to_projections.rst +++ b/doc/source/api_plugin/savu.plugins.filters.list_to_projections.rst @@ -2,6 +2,6 @@ savu.plugins.filters.list\_to\_projections module ================================================= .. automodule:: savu.plugins.filters.list_to_projections - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.paganin_filter.rst b/doc/source/api_plugin/savu.plugins.filters.paganin_filter.rst index e21702fa4..45eaa8c0d 100644 --- a/doc/source/api_plugin/savu.plugins.filters.paganin_filter.rst +++ b/doc/source/api_plugin/savu.plugins.filters.paganin_filter.rst @@ -2,6 +2,6 @@ savu.plugins.filters.paganin\_filter module =========================================== .. automodule:: savu.plugins.filters.paganin_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.poly_background_estimator.rst b/doc/source/api_plugin/savu.plugins.filters.poly_background_estimator.rst index 01be41a12..d1cc8d4bf 100644 --- a/doc/source/api_plugin/savu.plugins.filters.poly_background_estimator.rst +++ b/doc/source/api_plugin/savu.plugins.filters.poly_background_estimator.rst @@ -2,6 +2,6 @@ savu.plugins.filters.poly\_background\_estimator module ======================================================= .. automodule:: savu.plugins.filters.poly_background_estimator - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.pymca.rst b/doc/source/api_plugin/savu.plugins.filters.pymca.rst index 848ff739e..ffdb780d8 100644 --- a/doc/source/api_plugin/savu.plugins.filters.pymca.rst +++ b/doc/source/api_plugin/savu.plugins.filters.pymca.rst @@ -2,6 +2,6 @@ savu.plugins.filters.pymca module ================================= .. automodule:: savu.plugins.filters.pymca - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.quantisation_filter.rst b/doc/source/api_plugin/savu.plugins.filters.quantisation_filter.rst index 7cba4324f..8e371d00c 100644 --- a/doc/source/api_plugin/savu.plugins.filters.quantisation_filter.rst +++ b/doc/source/api_plugin/savu.plugins.filters.quantisation_filter.rst @@ -2,6 +2,6 @@ savu.plugins.filters.quantisation\_filter module ================================================ .. automodule:: savu.plugins.filters.quantisation_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.rst b/doc/source/api_plugin/savu.plugins.filters.rst index 55153686a..ca7872b2b 100644 --- a/doc/source/api_plugin/savu.plugins.filters.rst +++ b/doc/source/api_plugin/savu.plugins.filters.rst @@ -1,26 +1,31 @@ savu.plugins.filters package ============================ +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.filters.denoising + savu.plugins.filters.dezingers + Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.filters.band_pass savu.plugins.filters.base_filter - savu.plugins.filters.ccpi_denoising_cpu - savu.plugins.filters.ccpi_denoising_gpu - savu.plugins.filters.denoise_bregman_filter savu.plugins.filters.dezinger - savu.plugins.filters.dezinger_simple - savu.plugins.filters.dezinger_sinogram + savu.plugins.filters.dezinger_deprecated savu.plugins.filters.dials_find_spots savu.plugins.filters.find_peaks savu.plugins.filters.fresnel_filter savu.plugins.filters.hilbert_filter savu.plugins.filters.image_interpolation savu.plugins.filters.list_to_projections - savu.plugins.filters.median_filter savu.plugins.filters.paganin_filter savu.plugins.filters.poly_background_estimator savu.plugins.filters.pymca @@ -34,6 +39,6 @@ Module contents --------------- .. automodule:: savu.plugins.filters - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.spectrum_crop.rst b/doc/source/api_plugin/savu.plugins.filters.spectrum_crop.rst index 9a5502f14..c203e13e1 100644 --- a/doc/source/api_plugin/savu.plugins.filters.spectrum_crop.rst +++ b/doc/source/api_plugin/savu.plugins.filters.spectrum_crop.rst @@ -2,6 +2,6 @@ savu.plugins.filters.spectrum\_crop module ========================================== .. automodule:: savu.plugins.filters.spectrum_crop - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.strip_background.rst b/doc/source/api_plugin/savu.plugins.filters.strip_background.rst index d65fe6596..c840585a7 100644 --- a/doc/source/api_plugin/savu.plugins.filters.strip_background.rst +++ b/doc/source/api_plugin/savu.plugins.filters.strip_background.rst @@ -2,6 +2,6 @@ savu.plugins.filters.strip\_background module ============================================= .. automodule:: savu.plugins.filters.strip_background - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.threshold_filter.rst b/doc/source/api_plugin/savu.plugins.filters.threshold_filter.rst index ef0f4bb16..8933d96fd 100644 --- a/doc/source/api_plugin/savu.plugins.filters.threshold_filter.rst +++ b/doc/source/api_plugin/savu.plugins.filters.threshold_filter.rst @@ -2,6 +2,6 @@ savu.plugins.filters.threshold\_filter module ============================================= .. automodule:: savu.plugins.filters.threshold_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.filters.umpa.rst b/doc/source/api_plugin/savu.plugins.filters.umpa.rst index 0d8f40dc5..bb615b5b1 100644 --- a/doc/source/api_plugin/savu.plugins.filters.umpa.rst +++ b/doc/source/api_plugin/savu.plugins.filters.umpa.rst @@ -2,6 +2,6 @@ savu.plugins.filters.umpa module ================================ .. automodule:: savu.plugins.filters.umpa - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fitters.base_fitter.rst b/doc/source/api_plugin/savu.plugins.fitters.base_fitter.rst index a2f7b5519..274624252 100644 --- a/doc/source/api_plugin/savu.plugins.fitters.base_fitter.rst +++ b/doc/source/api_plugin/savu.plugins.fitters.base_fitter.rst @@ -2,6 +2,6 @@ savu.plugins.fitters.base\_fitter module ======================================== .. automodule:: savu.plugins.fitters.base_fitter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fitters.ral_fit.rst b/doc/source/api_plugin/savu.plugins.fitters.ral_fit.rst index 13dcadcc6..72a179dfc 100644 --- a/doc/source/api_plugin/savu.plugins.fitters.ral_fit.rst +++ b/doc/source/api_plugin/savu.plugins.fitters.ral_fit.rst @@ -2,6 +2,6 @@ savu.plugins.fitters.ral\_fit module ==================================== .. automodule:: savu.plugins.fitters.ral_fit - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fitters.reproduce_fit.rst b/doc/source/api_plugin/savu.plugins.fitters.reproduce_fit.rst index adf7f3e58..33e9ce832 100644 --- a/doc/source/api_plugin/savu.plugins.fitters.reproduce_fit.rst +++ b/doc/source/api_plugin/savu.plugins.fitters.reproduce_fit.rst @@ -2,6 +2,6 @@ savu.plugins.fitters.reproduce\_fit module ========================================== .. automodule:: savu.plugins.fitters.reproduce_fit - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fitters.rst b/doc/source/api_plugin/savu.plugins.fitters.rst index 761cce12d..cf410387a 100644 --- a/doc/source/api_plugin/savu.plugins.fitters.rst +++ b/doc/source/api_plugin/savu.plugins.fitters.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.fitters.base_fitter savu.plugins.fitters.ral_fit @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: savu.plugins.fitters - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fitters.simple_fit.rst b/doc/source/api_plugin/savu.plugins.fitters.simple_fit.rst index 1d91fb489..12302d303 100644 --- a/doc/source/api_plugin/savu.plugins.fitters.simple_fit.rst +++ b/doc/source/api_plugin/savu.plugins.fitters.simple_fit.rst @@ -2,6 +2,6 @@ savu.plugins.fitters.simple\_fit module ======================================= .. automodule:: savu.plugins.fitters.simple_fit - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fluo_fitters.base_fluo_fitter.rst b/doc/source/api_plugin/savu.plugins.fluo_fitters.base_fluo_fitter.rst index 12f205309..8e7e4c573 100644 --- a/doc/source/api_plugin/savu.plugins.fluo_fitters.base_fluo_fitter.rst +++ b/doc/source/api_plugin/savu.plugins.fluo_fitters.base_fluo_fitter.rst @@ -2,6 +2,6 @@ savu.plugins.fluo\_fitters.base\_fluo\_fitter module ==================================================== .. automodule:: savu.plugins.fluo_fitters.base_fluo_fitter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fluo_fitters.fastxrf_fitting.rst b/doc/source/api_plugin/savu.plugins.fluo_fitters.fastxrf_fitting.rst index 10cd00710..18ee5ce56 100644 --- a/doc/source/api_plugin/savu.plugins.fluo_fitters.fastxrf_fitting.rst +++ b/doc/source/api_plugin/savu.plugins.fluo_fitters.fastxrf_fitting.rst @@ -2,6 +2,6 @@ savu.plugins.fluo\_fitters.fastxrf\_fitting module ================================================== .. automodule:: savu.plugins.fluo_fitters.fastxrf_fitting - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fluo_fitters.rst b/doc/source/api_plugin/savu.plugins.fluo_fitters.rst index e5449135f..01d9ffc4b 100644 --- a/doc/source/api_plugin/savu.plugins.fluo_fitters.rst +++ b/doc/source/api_plugin/savu.plugins.fluo_fitters.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.fluo_fitters.base_fluo_fitter savu.plugins.fluo_fitters.fastxrf_fitting @@ -14,6 +15,6 @@ Module contents --------------- .. automodule:: savu.plugins.fluo_fitters - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.fluo_fitters.simple_fit_xrf.rst b/doc/source/api_plugin/savu.plugins.fluo_fitters.simple_fit_xrf.rst index e2f6ffc04..37f16865d 100644 --- a/doc/source/api_plugin/savu.plugins.fluo_fitters.simple_fit_xrf.rst +++ b/doc/source/api_plugin/savu.plugins.fluo_fitters.simple_fit_xrf.rst @@ -2,6 +2,6 @@ savu.plugins.fluo\_fitters.simple\_fit\_xrf module ================================================== .. automodule:: savu.plugins.fluo_fitters.simple_fit_xrf - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.kinematics.rst b/doc/source/api_plugin/savu.plugins.kinematics.rst index f551ec9e3..16c485f1b 100644 --- a/doc/source/api_plugin/savu.plugins.kinematics.rst +++ b/doc/source/api_plugin/savu.plugins.kinematics.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.kinematics.stage_motion @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.kinematics - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.kinematics.stage_motion.rst b/doc/source/api_plugin/savu.plugins.kinematics.stage_motion.rst index db7f805a6..d7234b97f 100644 --- a/doc/source/api_plugin/savu.plugins.kinematics.stage_motion.rst +++ b/doc/source/api_plugin/savu.plugins.kinematics.stage_motion.rst @@ -2,6 +2,6 @@ savu.plugins.kinematics.stage\_motion module ============================================ .. automodule:: savu.plugins.kinematics.stage_motion - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.base_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.base_loader.rst index 6a4017f95..1341e86f6 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.base_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.base_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.base\_loader module ======================================== .. automodule:: savu.plugins.loaders.base_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst index 1700a4639..7c7a6e3b1 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.dxchange_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.full\_field\_loaders.dxchange\_loader module ================================================================= .. automodule:: savu.plugins.loaders.full_field_loaders.dxchange_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.image_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.image_loader.rst index b3974f7ff..2fb79d98c 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.image_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.image_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.full\_field\_loaders.image\_loader module ============================================================== .. automodule:: savu.plugins.loaders.full_field_loaders.image_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.lfov_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.lfov_loader.rst new file mode 100644 index 000000000..c85fa6c5c --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.lfov_loader.rst @@ -0,0 +1,7 @@ +savu.plugins.loaders.full\_field\_loaders.lfov\_loader module +============================================================= + +.. automodule:: savu.plugins.loaders.full_field_loaders.lfov_loader + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.mrc_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.mrc_loader.rst index 45b3a47f0..60fcb6185 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.mrc_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.mrc_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.full\_field\_loaders.mrc\_loader module ============================================================ .. automodule:: savu.plugins.loaders.full_field_loaders.mrc_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst index 80a95385a..ff4d9bfc2 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.full\_field\_loaders.multi\_nxtomo\_loader module ====================================================================== .. automodule:: savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst index bffd99b14..8b4c283a6 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.nxtomo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.full\_field\_loaders.nxtomo\_loader module =============================================================== .. automodule:: savu.plugins.loaders.full_field_loaders.nxtomo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst index 2298a077f..5fc8de489 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.full\_field\_loaders.random\_3d\_tomo\_loader module ========================================================================= .. automodule:: savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.rst index 9201ecd95..17b55f0f7 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.full_field_loaders.rst @@ -5,10 +5,11 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.full_field_loaders.dxchange_loader - savu.plugins.loaders.full_field_loaders.fake_nxtomo_loader savu.plugins.loaders.full_field_loaders.image_loader + savu.plugins.loaders.full_field_loaders.lfov_loader savu.plugins.loaders.full_field_loaders.mrc_loader savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader savu.plugins.loaders.full_field_loaders.nxtomo_loader @@ -18,6 +19,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.full_field_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.hdf5_template_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.hdf5_template_loader.rst index dc3a0416a..b0f169bf2 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.hdf5_template_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.hdf5_template_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.hdf5\_template\_loader module ================================================== .. automodule:: savu.plugins.loaders.hdf5_template_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.image_template_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.image_template_loader.rst index 4834cf609..f0b4cc591 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.image_template_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.image_template_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.image\_template\_loader module =================================================== .. automodule:: savu.plugins.loaders.image_template_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst index aa86cb5e0..5a4b241e3 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.base_multi_modal_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.base\_multi\_modal\_loader module ======================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.base_multi_modal_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst index 4ff869e3d..608868796 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i08\_loaders.i08\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.rst index 6960293ac..440939c0a 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i08_loaders.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i08_loaders.i08_fluo_loader @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.mapping_loaders.i08_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst index ff7f62464..7e2bf4fd4 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst index c93edcf98..4cc704b35 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_ptycho\_loader module ============================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst index 89d4ebba2..c9eca0411 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_speckle\_loader module ============================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst index 7cb588a50..bf1f823b5 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_stxm\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst index 8ca40a5b3..c54dafd61 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_stxm\_monitor\_loader mo ==================================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst index 2395e0a81..16f96bb1c 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i13\_loaders.i13\_stxm\_xrf\_loader module ================================================================================ .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.rst index e87545158..fd9c1f952 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader @@ -17,6 +18,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.mapping_loaders.i13_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst index 573ed1b81..4a79a61e0 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i14\_loaders.i14\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.rst index 8ab3d92d4..d70371ba5 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.mapping_loaders.i14_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst index 6c28ef285..c91e15865 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.base\_i18\_multi\_modal\_load ========================================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst index 9eca3113f..033c880f5 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_fluo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst index 0b8a5925a..feaf771bf 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_mm\_loader module ========================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst index 5d1837988..750ee34dc 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_monitor\_loader module ============================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst index 45c273d93..89f639044 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_stxm\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst index bbf6fd2f2..3158ece27 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i18\_loaders.i18\_xrd\_loader module ========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.rst index abaee9f7a..47bb7663a 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader @@ -17,6 +18,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.mapping_loaders.i18_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst index ac3c6adf3..a9a8434c0 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.i22\_loaders.i22\_tomo\_loader module =========================================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.rst index 98c16c6b0..6ddda7ac8 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.mapping_loaders.i22_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.mm_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.mm_loader.rst index 4ef004d63..d104fc208 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.mm_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.mm_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.mm\_loader module ======================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.mm_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst index 0731ad926..4d0a4fca3 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxfluo_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.nxfluo\_loader module =========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxfluo_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst index a8010ecf9..08b136793 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxmonitor_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.nxmonitor\_loader module ============================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxmonitor_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst index fc630eb9c..e7dda4b4f 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxptycho_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.nxptycho\_loader module ============================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.nxptycho_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst index 52a47ce97..adc7dcf1e 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxstxm_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.nxstxm\_loader module =========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxstxm_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst index b122da4d7..8667b2734 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.nxxrd_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.nxxrd\_loader module ========================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.nxxrd_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst index 0a552e927..acbc625f7 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.p2r\_fly\_scan\_detector\_loader module ============================================================================= .. automodule:: savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.rst index b3921f84b..3567d01a8 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.rst @@ -5,17 +5,18 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.loaders.mapping_loaders.i08_loaders - savu.plugins.loaders.mapping_loaders.i13_loaders - savu.plugins.loaders.mapping_loaders.i14_loaders - savu.plugins.loaders.mapping_loaders.i18_loaders - savu.plugins.loaders.mapping_loaders.i22_loaders + savu.plugins.loaders.mapping_loaders.i08_loaders + savu.plugins.loaders.mapping_loaders.i13_loaders + savu.plugins.loaders.mapping_loaders.i14_loaders + savu.plugins.loaders.mapping_loaders.i22_loaders Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.mapping_loaders.base_multi_modal_loader savu.plugins.loaders.mapping_loaders.mm_loader @@ -31,6 +32,6 @@ Module contents --------------- .. automodule:: savu.plugins.loaders.mapping_loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.txm_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.txm_loader.rst index ff9fc6e3d..18ff06e9e 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.txm_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.mapping_loaders.txm_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.mapping\_loaders.txm\_loader module ======================================================== .. automodule:: savu.plugins.loaders.mapping_loaders.txm_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.multi_savu_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.multi_savu_loader.rst index b1f3e123d..fcb790c7d 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.multi_savu_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.multi_savu_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.multi\_savu\_loader module =============================================== .. automodule:: savu.plugins.loaders.multi_savu_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.random_hdf5_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.random_hdf5_loader.rst index 3f8e85389..7f99bc987 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.random_hdf5_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.random_hdf5_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.random\_hdf5\_loader module ================================================ .. automodule:: savu.plugins.loaders.random_hdf5_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.rst b/doc/source/api_plugin/savu.plugins.loaders.rst index aa903fd5a..ed0906401 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.rst @@ -5,15 +5,18 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.loaders.full_field_loaders - savu.plugins.loaders.mapping_loaders - savu.plugins.loaders.utils + savu.plugins.loaders.full_field_loaders + savu.plugins.loaders.mapping_loaders + savu.plugins.loaders.templates + savu.plugins.loaders.utils Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.loaders.base_loader savu.plugins.loaders.hdf5_template_loader @@ -21,13 +24,12 @@ Submodules savu.plugins.loaders.multi_savu_loader savu.plugins.loaders.random_hdf5_loader savu.plugins.loaders.savu_nexus_loader - savu.plugins.loaders.stitch_data_template_loader savu.plugins.loaders.yaml_converter Module contents --------------- .. automodule:: savu.plugins.loaders - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.savu_nexus_loader.rst b/doc/source/api_plugin/savu.plugins.loaders.savu_nexus_loader.rst index c9352175e..a22c79417 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.savu_nexus_loader.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.savu_nexus_loader.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.savu\_nexus\_loader module =============================================== .. automodule:: savu.plugins.loaders.savu_nexus_loader - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.templates.malcolm_templates.rst b/doc/source/api_plugin/savu.plugins.loaders.templates.malcolm_templates.rst new file mode 100644 index 000000000..77969c39d --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.loaders.templates.malcolm_templates.rst @@ -0,0 +1,10 @@ +savu.plugins.loaders.templates.malcolm\_templates package +========================================================= + +Module contents +--------------- + +.. automodule:: savu.plugins.loaders.templates.malcolm_templates + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.templates.rst b/doc/source/api_plugin/savu.plugins.loaders.templates.rst new file mode 100644 index 000000000..c51c642b4 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.loaders.templates.rst @@ -0,0 +1,18 @@ +savu.plugins.loaders.templates package +====================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.loaders.templates.malcolm_templates + +Module contents +--------------- + +.. automodule:: savu.plugins.loaders.templates + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.utils.rst b/doc/source/api_plugin/savu.plugins.loaders.utils.rst index b3217abb7..bce9d31d8 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.utils.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.utils.rst @@ -5,14 +5,14 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.plugins.loaders.utils.mrc_header savu.plugins.loaders.utils.yaml_utils Module contents --------------- .. automodule:: savu.plugins.loaders.utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.utils.yaml_utils.rst b/doc/source/api_plugin/savu.plugins.loaders.utils.yaml_utils.rst index e3bda0d9f..e308d0deb 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.utils.yaml_utils.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.utils.yaml_utils.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.utils.yaml\_utils module ============================================= .. automodule:: savu.plugins.loaders.utils.yaml_utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.loaders.yaml_converter.rst b/doc/source/api_plugin/savu.plugins.loaders.yaml_converter.rst index 1c0eb58bc..b37595264 100644 --- a/doc/source/api_plugin/savu.plugins.loaders.yaml_converter.rst +++ b/doc/source/api_plugin/savu.plugins.loaders.yaml_converter.rst @@ -2,6 +2,6 @@ savu.plugins.loaders.yaml\_converter module =========================================== .. automodule:: savu.plugins.loaders.yaml_converter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.missing_data.rst b/doc/source/api_plugin/savu.plugins.missing_data.rst index 8660d12a4..59a33602d 100644 --- a/doc/source/api_plugin/savu.plugins.missing_data.rst +++ b/doc/source/api_plugin/savu.plugins.missing_data.rst @@ -5,6 +5,6 @@ Module contents --------------- .. automodule:: savu.plugins.missing_data - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.plugin.rst b/doc/source/api_plugin/savu.plugins.plugin.rst index 09a883b7c..63d165ab9 100644 --- a/doc/source/api_plugin/savu.plugins.plugin.rst +++ b/doc/source/api_plugin/savu.plugins.plugin.rst @@ -2,6 +2,6 @@ savu.plugins.plugin module ========================== .. automodule:: savu.plugins.plugin - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.plugin_datasets.rst b/doc/source/api_plugin/savu.plugins.plugin_datasets.rst index c094b27c1..6bac3fa5c 100644 --- a/doc/source/api_plugin/savu.plugins.plugin_datasets.rst +++ b/doc/source/api_plugin/savu.plugins.plugin_datasets.rst @@ -2,6 +2,6 @@ savu.plugins.plugin\_datasets module ==================================== .. automodule:: savu.plugins.plugin_datasets - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.plugin_datasets_notes.rst b/doc/source/api_plugin/savu.plugins.plugin_datasets_notes.rst index 721396797..68f67db82 100644 --- a/doc/source/api_plugin/savu.plugins.plugin_datasets_notes.rst +++ b/doc/source/api_plugin/savu.plugins.plugin_datasets_notes.rst @@ -2,6 +2,6 @@ savu.plugins.plugin\_datasets\_notes module =========================================== .. automodule:: savu.plugins.plugin_datasets_notes - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ptychography.base_ptycho.rst b/doc/source/api_plugin/savu.plugins.ptychography.base_ptycho.rst index 8d3d99ca6..282ded755 100644 --- a/doc/source/api_plugin/savu.plugins.ptychography.base_ptycho.rst +++ b/doc/source/api_plugin/savu.plugins.ptychography.base_ptycho.rst @@ -2,6 +2,6 @@ savu.plugins.ptychography.base\_ptycho module ============================================= .. automodule:: savu.plugins.ptychography.base_ptycho - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ptychography.dummy_ptycho.rst b/doc/source/api_plugin/savu.plugins.ptychography.dummy_ptycho.rst index b9c7a45a1..f69f9045a 100644 --- a/doc/source/api_plugin/savu.plugins.ptychography.dummy_ptycho.rst +++ b/doc/source/api_plugin/savu.plugins.ptychography.dummy_ptycho.rst @@ -2,6 +2,6 @@ savu.plugins.ptychography.dummy\_ptycho module ============================================== .. automodule:: savu.plugins.ptychography.dummy_ptycho - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ptychography.ptypy_batch.rst b/doc/source/api_plugin/savu.plugins.ptychography.ptypy_batch.rst index 6faea3103..ba22960b9 100644 --- a/doc/source/api_plugin/savu.plugins.ptychography.ptypy_batch.rst +++ b/doc/source/api_plugin/savu.plugins.ptychography.ptypy_batch.rst @@ -2,6 +2,6 @@ savu.plugins.ptychography.ptypy\_batch module ============================================= .. automodule:: savu.plugins.ptychography.ptypy_batch - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ptychography.ptypy_compact.rst b/doc/source/api_plugin/savu.plugins.ptychography.ptypy_compact.rst index 7389cd3eb..92bbf9139 100644 --- a/doc/source/api_plugin/savu.plugins.ptychography.ptypy_compact.rst +++ b/doc/source/api_plugin/savu.plugins.ptychography.ptypy_compact.rst @@ -2,6 +2,6 @@ savu.plugins.ptychography.ptypy\_compact module =============================================== .. automodule:: savu.plugins.ptychography.ptypy_compact - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ptychography.rst b/doc/source/api_plugin/savu.plugins.ptychography.rst index cf2c5638d..6fed5ae5b 100644 --- a/doc/source/api_plugin/savu.plugins.ptychography.rst +++ b/doc/source/api_plugin/savu.plugins.ptychography.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.ptychography.base_ptycho savu.plugins.ptychography.dummy_ptycho @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: savu.plugins.ptychography - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst index 9f2c02f6a..d42001e07 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_cpu.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.astra\_recons.astra\_recon\_cpu module =================================================================== .. automodule:: savu.plugins.reconstructions.astra_recons.astra_recon_cpu - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst index 20c9685be..7641f28af 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_gpu.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.astra\_recons.astra\_recon\_gpu module =================================================================== .. automodule:: savu.plugins.reconstructions.astra_recons.astra_recon_gpu - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst index 190a5ef1a..1e1bc1d3a 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_recon.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.astra\_recons.base\_astra\_recon module ==================================================================== .. automodule:: savu.plugins.reconstructions.astra_recons.base_astra_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon.rst new file mode 100644 index 000000000..6562309b7 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon.rst @@ -0,0 +1,7 @@ +savu.plugins.reconstructions.astra\_recons.base\_astra\_vector\_recon module +============================================================================ + +.. automodule:: savu.plugins.reconstructions.astra_recons.base_astra_vector_recon + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.rst b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.rst index e8af470e0..380dac1df 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.astra_recons.rst @@ -5,15 +5,17 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.reconstructions.astra_recons.astra_recon_cpu savu.plugins.reconstructions.astra_recons.astra_recon_gpu savu.plugins.reconstructions.astra_recons.base_astra_recon + savu.plugins.reconstructions.astra_recons.base_astra_vector_recon Module contents --------------- .. automodule:: savu.plugins.reconstructions.astra_recons - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.base_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.base_recon.rst index a62882ec4..91d3b743d 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.base_recon.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.base_recon.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.base\_recon module =============================================== .. automodule:: savu.plugins.reconstructions.base_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.ccpi_cgls_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.ccpi_cgls_recon.rst index 3204fc960..007b5f7e9 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.ccpi_cgls_recon.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.ccpi_cgls_recon.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.ccpi\_cgls\_recon module ===================================================== .. automodule:: savu.plugins.reconstructions.ccpi_cgls_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.rst b/doc/source/api_plugin/savu.plugins.reconstructions.rst index 9bb069735..b2783143a 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.rst @@ -5,22 +5,21 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.reconstructions.astra_recons + savu.plugins.reconstructions.astra_recons + savu.plugins.reconstructions.tomobar Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.reconstructions.base_recon - savu.plugins.reconstructions.ccpi_cgls_recon savu.plugins.reconstructions.scikitimage_filter_back_projection savu.plugins.reconstructions.scikitimage_sart savu.plugins.reconstructions.simple_recon - savu.plugins.reconstructions.tomobar_recon - savu.plugins.reconstructions.tomobar_recon_3D - savu.plugins.reconstructions.tomobar_recon_cpu savu.plugins.reconstructions.tomopy_recon savu.plugins.reconstructions.visual_hulls_recon @@ -28,6 +27,6 @@ Module contents --------------- .. automodule:: savu.plugins.reconstructions - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst b/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst index fc52b138a..d4c32707a 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_filter_back_projection.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.scikitimage\_filter\_back\_projection module ========================================================================= .. automodule:: savu.plugins.reconstructions.scikitimage_filter_back_projection - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_sart.rst b/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_sart.rst index 5f042a48c..c69121b76 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_sart.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.scikitimage_sart.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.scikitimage\_sart module ===================================================== .. automodule:: savu.plugins.reconstructions.scikitimage_sart - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.simple_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.simple_recon.rst index 5457c4ef7..711b21d30 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.simple_recon.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.simple_recon.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.simple\_recon module ================================================= .. automodule:: savu.plugins.reconstructions.simple_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.rst b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.rst new file mode 100644 index 000000000..29cfcbf96 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.rst @@ -0,0 +1,20 @@ +savu.plugins.reconstructions.tomobar package +============================================ + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.reconstructions.tomobar.tomobar_recon + savu.plugins.reconstructions.tomobar.tomobar_recon_3D + savu.plugins.reconstructions.tomobar.tomobar_recon_cpu + +Module contents +--------------- + +.. automodule:: savu.plugins.reconstructions.tomobar + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon.rst new file mode 100644 index 000000000..59237f2bc --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon.rst @@ -0,0 +1,7 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon module +========================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_3D.rst b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_3D.rst new file mode 100644 index 000000000..a8173eb3e --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_3D.rst @@ -0,0 +1,7 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon\_3D module +============================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon_3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu.rst b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu.rst new file mode 100644 index 000000000..30ecea372 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu.rst @@ -0,0 +1,7 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon\_cpu module +=============================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon_cpu + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D.rst b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D.rst new file mode 100644 index 000000000..ca6529323 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D.rst @@ -0,0 +1,7 @@ +savu.plugins.reconstructions.tomobar.tomobar\_recon\_fully\_3D module +===================================================================== + +.. automodule:: savu.plugins.reconstructions.tomobar.tomobar_recon_fully_3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.tomopy_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.tomopy_recon.rst index 80f079dd9..e687c12a1 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.tomopy_recon.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.tomopy_recon.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.tomopy\_recon module ================================================= .. automodule:: savu.plugins.reconstructions.tomopy_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reconstructions.visual_hulls_recon.rst b/doc/source/api_plugin/savu.plugins.reconstructions.visual_hulls_recon.rst index 69d822412..b9be7e114 100644 --- a/doc/source/api_plugin/savu.plugins.reconstructions.visual_hulls_recon.rst +++ b/doc/source/api_plugin/savu.plugins.reconstructions.visual_hulls_recon.rst @@ -2,6 +2,6 @@ savu.plugins.reconstructions.visual\_hulls\_recon module ======================================================== .. automodule:: savu.plugins.reconstructions.visual_hulls_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reshape.data_removal.rst b/doc/source/api_plugin/savu.plugins.reshape.data_removal.rst index b8ccbf98a..b9ed7d551 100644 --- a/doc/source/api_plugin/savu.plugins.reshape.data_removal.rst +++ b/doc/source/api_plugin/savu.plugins.reshape.data_removal.rst @@ -2,6 +2,6 @@ savu.plugins.reshape.data\_removal module ========================================= .. automodule:: savu.plugins.reshape.data_removal - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reshape.downsample_filter.rst b/doc/source/api_plugin/savu.plugins.reshape.downsample_filter.rst index a3e3dc67b..ba79545ba 100644 --- a/doc/source/api_plugin/savu.plugins.reshape.downsample_filter.rst +++ b/doc/source/api_plugin/savu.plugins.reshape.downsample_filter.rst @@ -2,6 +2,6 @@ savu.plugins.reshape.downsample\_filter module ============================================== .. automodule:: savu.plugins.reshape.downsample_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reshape.image_stitching.rst b/doc/source/api_plugin/savu.plugins.reshape.image_stitching.rst new file mode 100644 index 000000000..f2f427a17 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.reshape.image_stitching.rst @@ -0,0 +1,7 @@ +savu.plugins.reshape.image\_stitching module +============================================ + +.. automodule:: savu.plugins.reshape.image_stitching + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reshape.mipmap.rst b/doc/source/api_plugin/savu.plugins.reshape.mipmap.rst index 2840c255b..576b8c792 100644 --- a/doc/source/api_plugin/savu.plugins.reshape.mipmap.rst +++ b/doc/source/api_plugin/savu.plugins.reshape.mipmap.rst @@ -2,6 +2,6 @@ savu.plugins.reshape.mipmap module ================================== .. automodule:: savu.plugins.reshape.mipmap - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.reshape.rst b/doc/source/api_plugin/savu.plugins.reshape.rst index 99f326b4a..501b95b74 100644 --- a/doc/source/api_plugin/savu.plugins.reshape.rst +++ b/doc/source/api_plugin/savu.plugins.reshape.rst @@ -5,15 +5,17 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.reshape.data_removal savu.plugins.reshape.downsample_filter + savu.plugins.reshape.image_stitching savu.plugins.reshape.mipmap Module contents --------------- .. automodule:: savu.plugins.reshape - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst index 3d1bd315d..9511d2890 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ccpi_ring_artefact_filter.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ccpi\_ring\_artefact\_filter module ============================================================== .. automodule:: savu.plugins.ring_removal.ccpi_ring_artefact_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.raven_filter.rst b/doc/source/api_plugin/savu.plugins.ring_removal.raven_filter.rst index e843824d8..7768ba80a 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.raven_filter.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.raven_filter.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.raven\_filter module =============================================== .. automodule:: savu.plugins.ring_removal.raven_filter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.remove_all_rings.rst b/doc/source/api_plugin/savu.plugins.ring_removal.remove_all_rings.rst index 04e1c4ae4..5a234de9e 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.remove_all_rings.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.remove_all_rings.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.remove\_all\_rings module ==================================================== .. automodule:: savu.plugins.ring_removal.remove_all_rings - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.remove_large_rings.rst b/doc/source/api_plugin/savu.plugins.ring_removal.remove_large_rings.rst index 33404824a..85fe25e79 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.remove_large_rings.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.remove_large_rings.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.remove\_large\_rings module ====================================================== .. automodule:: savu.plugins.ring_removal.remove_large_rings - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst b/doc/source/api_plugin/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst index efa177c14..64c30a802 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.remove\_unresponsive\_and\_fluctuating\_rings module =============================================================================== .. automodule:: savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_filtering.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_filtering.rst index 4e98e6d9c..d1d09aeda 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_filtering.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_filtering.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ring\_removal\_filtering module ========================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_filtering - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_fitting.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_fitting.rst index 1ce31043e..3238877de 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_fitting.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_fitting.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ring\_removal\_fitting module ======================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_fitting - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_interpolation.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_interpolation.rst new file mode 100644 index 000000000..d86d6f604 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_interpolation.rst @@ -0,0 +1,7 @@ +savu.plugins.ring\_removal.ring\_removal\_interpolation module +============================================================== + +.. automodule:: savu.plugins.ring_removal.ring_removal_interpolation + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_normalization.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_normalization.rst index 7a73beffd..6833b7dad 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_normalization.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_normalization.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ring\_removal\_normalization module ============================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_normalization - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_regularization.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_regularization.rst index ac8c9a986..bc549baee 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_regularization.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_regularization.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ring\_removal\_regularization module =============================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_regularization - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_sorting.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_sorting.rst index 4ef4a55bc..450d76d7c 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_sorting.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_sorting.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ring\_removal\_sorting module ======================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_sorting - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_waveletfft.rst b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_waveletfft.rst index 4a70a23c7..2aa2b7002 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_waveletfft.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.ring_removal_waveletfft.rst @@ -2,6 +2,6 @@ savu.plugins.ring\_removal.ring\_removal\_waveletfft module =========================================================== .. automodule:: savu.plugins.ring_removal.ring_removal_waveletfft - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.ring_removal.rst b/doc/source/api_plugin/savu.plugins.ring_removal.rst index 728caf94d..7c52851f6 100644 --- a/doc/source/api_plugin/savu.plugins.ring_removal.rst +++ b/doc/source/api_plugin/savu.plugins.ring_removal.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.ring_removal.ccpi_ring_artefact_filter savu.plugins.ring_removal.raven_filter @@ -13,6 +14,7 @@ Submodules savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings savu.plugins.ring_removal.ring_removal_filtering savu.plugins.ring_removal.ring_removal_fitting + savu.plugins.ring_removal.ring_removal_interpolation savu.plugins.ring_removal.ring_removal_normalization savu.plugins.ring_removal.ring_removal_regularization savu.plugins.ring_removal.ring_removal_sorting @@ -22,6 +24,6 @@ Module contents --------------- .. automodule:: savu.plugins.ring_removal - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.rst b/doc/source/api_plugin/savu.plugins.rst index 6109c0df9..16530b8b8 100644 --- a/doc/source/api_plugin/savu.plugins.rst +++ b/doc/source/api_plugin/savu.plugins.rst @@ -5,36 +5,38 @@ Subpackages ----------- .. toctree:: - - savu.plugins.absorption_corrections - savu.plugins.alignment - savu.plugins.analysis - savu.plugins.azimuthal_integrators - savu.plugins.basic_operations - savu.plugins.centering - savu.plugins.component_analysis - savu.plugins.corrections - savu.plugins.developing - savu.plugins.driver - savu.plugins.filters - savu.plugins.fitters - savu.plugins.fluo_fitters - savu.plugins.kinematics - savu.plugins.loaders - savu.plugins.missing_data - savu.plugins.ptychography - savu.plugins.reconstructions - savu.plugins.reshape - savu.plugins.ring_removal - savu.plugins.savers - savu.plugins.segmentation - savu.plugins.stats - savu.plugins.visualisation + :maxdepth: 4 + + savu.plugins.absorption_corrections + savu.plugins.alignment + savu.plugins.analysis + savu.plugins.azimuthal_integrators + savu.plugins.basic_operations + savu.plugins.centering + savu.plugins.component_analysis + savu.plugins.corrections + savu.plugins.developing + savu.plugins.driver + savu.plugins.filters + savu.plugins.fitters + savu.plugins.kinematics + savu.plugins.loaders + savu.plugins.missing_data + savu.plugins.ptychography + savu.plugins.reconstructions + savu.plugins.reshape + savu.plugins.ring_removal + savu.plugins.savers + savu.plugins.segmentation + savu.plugins.simulation + savu.plugins.stats + savu.plugins.visualisation Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.docstring_parser savu.plugins.plugin @@ -46,6 +48,6 @@ Module contents --------------- .. automodule:: savu.plugins - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.base_image_saver.rst b/doc/source/api_plugin/savu.plugins.savers.base_image_saver.rst index edfe5bc8d..e1f44f682 100644 --- a/doc/source/api_plugin/savu.plugins.savers.base_image_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.base_image_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.base\_image\_saver module ============================================= .. automodule:: savu.plugins.savers.base_image_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.base_saver.rst b/doc/source/api_plugin/savu.plugins.savers.base_saver.rst index 6f1b769ad..b628b13fe 100644 --- a/doc/source/api_plugin/savu.plugins.savers.base_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.base_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.base\_saver module ====================================== .. automodule:: savu.plugins.savers.base_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.edf_saver.rst b/doc/source/api_plugin/savu.plugins.savers.edf_saver.rst index 79c2dada4..d9c98265c 100644 --- a/doc/source/api_plugin/savu.plugins.savers.edf_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.edf_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.edf\_saver module ===================================== .. automodule:: savu.plugins.savers.edf_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.hdf5_saver.rst b/doc/source/api_plugin/savu.plugins.savers.hdf5_saver.rst index 339affc31..c47349b5e 100644 --- a/doc/source/api_plugin/savu.plugins.savers.hdf5_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.hdf5_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.hdf5\_saver module ====================================== .. automodule:: savu.plugins.savers.hdf5_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.image_saver.rst b/doc/source/api_plugin/savu.plugins.savers.image_saver.rst index 3a80c8dde..b6e6a694a 100644 --- a/doc/source/api_plugin/savu.plugins.savers.image_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.image_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.image\_saver module ======================================= .. automodule:: savu.plugins.savers.image_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.rst b/doc/source/api_plugin/savu.plugins.savers.rst index 209a34a77..20915042a 100644 --- a/doc/source/api_plugin/savu.plugins.savers.rst +++ b/doc/source/api_plugin/savu.plugins.savers.rst @@ -5,13 +5,15 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.savers.utils + savu.plugins.savers.utils Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.savers.base_image_saver savu.plugins.savers.base_saver @@ -25,6 +27,6 @@ Module contents --------------- .. automodule:: savu.plugins.savers - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.tiff_saver.rst b/doc/source/api_plugin/savu.plugins.savers.tiff_saver.rst index 9bd7ba46f..673400f0f 100644 --- a/doc/source/api_plugin/savu.plugins.savers.tiff_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.tiff_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.tiff\_saver module ====================================== .. automodule:: savu.plugins.savers.tiff_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.utils.hdf5_utils.rst b/doc/source/api_plugin/savu.plugins.savers.utils.hdf5_utils.rst index e648adada..5c623817d 100644 --- a/doc/source/api_plugin/savu.plugins.savers.utils.hdf5_utils.rst +++ b/doc/source/api_plugin/savu.plugins.savers.utils.hdf5_utils.rst @@ -2,6 +2,6 @@ savu.plugins.savers.utils.hdf5\_utils module ============================================ .. automodule:: savu.plugins.savers.utils.hdf5_utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.utils.rst b/doc/source/api_plugin/savu.plugins.savers.utils.rst index b5b86b43d..12362e3a8 100644 --- a/doc/source/api_plugin/savu.plugins.savers.utils.rst +++ b/doc/source/api_plugin/savu.plugins.savers.utils.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.savers.utils.hdf5_utils @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.savers.utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.savers.xrf_saver.rst b/doc/source/api_plugin/savu.plugins.savers.xrf_saver.rst index e6285fc66..bf195cd94 100644 --- a/doc/source/api_plugin/savu.plugins.savers.xrf_saver.rst +++ b/doc/source/api_plugin/savu.plugins.savers.xrf_saver.rst @@ -2,6 +2,6 @@ savu.plugins.savers.xrf\_saver module ===================================== .. automodule:: savu.plugins.savers.xrf_saver - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes.rst b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes.rst new file mode 100644 index 000000000..083f14c6f --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.evolving\_contours.morph\_snakes module +================================================================= + +.. automodule:: savu.plugins.segmentation.evolving_contours.morph_snakes + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes3D.rst b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes3D.rst new file mode 100644 index 000000000..7dd6d3223 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes3D.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.evolving\_contours.morph\_snakes3D module +=================================================================== + +.. automodule:: savu.plugins.segmentation.evolving_contours.morph_snakes3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.region_grow.rst b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.region_grow.rst new file mode 100644 index 000000000..bad9aa9cb --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.region_grow.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.evolving\_contours.region\_grow module +================================================================ + +.. automodule:: savu.plugins.segmentation.evolving_contours.region_grow + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.region_grow3D.rst b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.region_grow3D.rst new file mode 100644 index 000000000..9ee1c0160 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.region_grow3D.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.evolving\_contours.region\_grow3D module +================================================================== + +.. automodule:: savu.plugins.segmentation.evolving_contours.region_grow3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.rst b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.rst new file mode 100644 index 000000000..c88f06b51 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.evolving_contours.rst @@ -0,0 +1,21 @@ +savu.plugins.segmentation.evolving\_contours package +==================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.evolving_contours.morph_snakes + savu.plugins.segmentation.evolving_contours.morph_snakes3D + savu.plugins.segmentation.evolving_contours.region_grow + savu.plugins.segmentation.evolving_contours.region_grow3D + +Module contents +--------------- + +.. automodule:: savu.plugins.segmentation.evolving_contours + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D.rst b/doc/source/api_plugin/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D.rst new file mode 100644 index 000000000..5d9bf5dcd --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.gaussian\_mixtures.gmm\_segment3D module +================================================================== + +.. automodule:: savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.gaussian_mixtures.rst b/doc/source/api_plugin/savu.plugins.segmentation.gaussian_mixtures.rst new file mode 100644 index 000000000..5737a025a --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.gaussian_mixtures.rst @@ -0,0 +1,18 @@ +savu.plugins.segmentation.gaussian\_mixtures package +==================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D + +Module contents +--------------- + +.. automodule:: savu.plugins.segmentation.gaussian_mixtures + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.geo_distance.rst b/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.geo_distance.rst new file mode 100644 index 000000000..9e6984de9 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.geo_distance.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.geo\_distance.geo\_distance module +============================================================ + +.. automodule:: savu.plugins.segmentation.geo_distance.geo_distance + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.geo_distance3D.rst b/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.geo_distance3D.rst new file mode 100644 index 000000000..716b3c1bb --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.geo_distance3D.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.geo\_distance.geo\_distance3D module +============================================================== + +.. automodule:: savu.plugins.segmentation.geo_distance.geo_distance3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.rst b/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.rst index fa3dd7b32..b6d1aec33 100644 --- a/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.rst +++ b/doc/source/api_plugin/savu.plugins.segmentation.geo_distance.rst @@ -1,7 +1,19 @@ -savu.plugins.segmentation.geo\_distance module -============================================== +savu.plugins.segmentation.geo\_distance package +=============================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.geo_distance.geo_distance + savu.plugins.segmentation.geo_distance.geo_distance3D + +Module contents +--------------- .. automodule:: savu.plugins.segmentation.geo_distance - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.masks_initialise.mask_initialiser.rst b/doc/source/api_plugin/savu.plugins.segmentation.masks_initialise.mask_initialiser.rst new file mode 100644 index 000000000..87efcde55 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.masks_initialise.mask_initialiser.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.masks\_initialise.mask\_initialiser module +==================================================================== + +.. automodule:: savu.plugins.segmentation.masks_initialise.mask_initialiser + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.masks_initialise.rst b/doc/source/api_plugin/savu.plugins.segmentation.masks_initialise.rst new file mode 100644 index 000000000..4c25ac020 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.masks_initialise.rst @@ -0,0 +1,18 @@ +savu.plugins.segmentation.masks\_initialise package +=================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.masks_initialise.mask_initialiser + +Module contents +--------------- + +.. automodule:: savu.plugins.segmentation.masks_initialise + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc.rst b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc.rst index dda1fe8ad..2fef375cd 100644 --- a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc.rst +++ b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc.rst @@ -2,6 +2,6 @@ savu.plugins.segmentation.morphological\_operations.morph\_proc module ====================================================================== .. automodule:: savu.plugins.segmentation.morphological_operations.morph_proc - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line.rst b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line.rst new file mode 100644 index 000000000..9d07f0765 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.morphological\_operations.morph\_proc\_line module +============================================================================ + +.. automodule:: savu.plugins.segmentation.morphological_operations.morph_proc_line + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line3D.rst b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line3D.rst new file mode 100644 index 000000000..b24aa5b0b --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line3D.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.morphological\_operations.morph\_proc\_line3D module +============================================================================== + +.. automodule:: savu.plugins.segmentation.morphological_operations.morph_proc_line3D + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_remove_objects.rst b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_remove_objects.rst new file mode 100644 index 000000000..b4f0f9de5 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.morph_remove_objects.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.morphological\_operations.morph\_remove\_objects module +================================================================================= + +.. automodule:: savu.plugins.segmentation.morphological_operations.morph_remove_objects + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.rst b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.rst index e6b42251c..620de9d26 100644 --- a/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.rst +++ b/doc/source/api_plugin/savu.plugins.segmentation.morphological_operations.rst @@ -5,13 +5,17 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.segmentation.morphological_operations.morph_proc + savu.plugins.segmentation.morphological_operations.morph_proc_line + savu.plugins.segmentation.morphological_operations.morph_proc_line3D + savu.plugins.segmentation.morphological_operations.morph_remove_objects Module contents --------------- .. automodule:: savu.plugins.segmentation.morphological_operations - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.rst b/doc/source/api_plugin/savu.plugins.segmentation.rst index 992bfa7d3..32ad9c97c 100644 --- a/doc/source/api_plugin/savu.plugins.segmentation.rst +++ b/doc/source/api_plugin/savu.plugins.segmentation.rst @@ -5,27 +5,19 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.plugins.segmentation.i23segmentation - savu.plugins.segmentation.morphological_operations - -Submodules ----------- - -.. toctree:: - + savu.plugins.segmentation.evolving_contours + savu.plugins.segmentation.gaussian_mixtures savu.plugins.segmentation.geo_distance - savu.plugins.segmentation.gmm_segment3D - savu.plugins.segmentation.mask_evolve - savu.plugins.segmentation.mask_initialiser - savu.plugins.segmentation.morph_snakes - savu.plugins.segmentation.morph_snakes3D - savu.plugins.segmentation.thresh_segm + savu.plugins.segmentation.masks_initialise + savu.plugins.segmentation.morphological_operations + savu.plugins.segmentation.thresholding Module contents --------------- .. automodule:: savu.plugins.segmentation - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.thresholding.rst b/doc/source/api_plugin/savu.plugins.segmentation.thresholding.rst new file mode 100644 index 000000000..fd701efe4 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.thresholding.rst @@ -0,0 +1,18 @@ +savu.plugins.segmentation.thresholding package +============================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.segmentation.thresholding.thresh_segm + +Module contents +--------------- + +.. automodule:: savu.plugins.segmentation.thresholding + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.segmentation.thresholding.thresh_segm.rst b/doc/source/api_plugin/savu.plugins.segmentation.thresholding.thresh_segm.rst new file mode 100644 index 000000000..df750323e --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.segmentation.thresholding.thresh_segm.rst @@ -0,0 +1,7 @@ +savu.plugins.segmentation.thresholding.thresh\_segm module +========================================================== + +.. automodule:: savu.plugins.segmentation.thresholding.thresh_segm + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.simulation.rst b/doc/source/api_plugin/savu.plugins.simulation.rst new file mode 100644 index 000000000..111025277 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.simulation.rst @@ -0,0 +1,19 @@ +savu.plugins.simulation package +=============================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.plugins.simulation.tomo_phantom + savu.plugins.simulation.tomo_phantom_quantification + +Module contents +--------------- + +.. automodule:: savu.plugins.simulation + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.simulation.tomo_phantom.rst b/doc/source/api_plugin/savu.plugins.simulation.tomo_phantom.rst new file mode 100644 index 000000000..a5a8b7a8d --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.simulation.tomo_phantom.rst @@ -0,0 +1,7 @@ +savu.plugins.simulation.tomo\_phantom module +============================================ + +.. automodule:: savu.plugins.simulation.tomo_phantom + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.simulation.tomo_phantom_quantification.rst b/doc/source/api_plugin/savu.plugins.simulation.tomo_phantom_quantification.rst new file mode 100644 index 000000000..beeee4ca3 --- /dev/null +++ b/doc/source/api_plugin/savu.plugins.simulation.tomo_phantom_quantification.rst @@ -0,0 +1,7 @@ +savu.plugins.simulation.tomo\_phantom\_quantification module +============================================================ + +.. automodule:: savu.plugins.simulation.tomo_phantom_quantification + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.stats.min_and_max.rst b/doc/source/api_plugin/savu.plugins.stats.min_and_max.rst index 3774ab260..df311071f 100644 --- a/doc/source/api_plugin/savu.plugins.stats.min_and_max.rst +++ b/doc/source/api_plugin/savu.plugins.stats.min_and_max.rst @@ -2,6 +2,6 @@ savu.plugins.stats.min\_and\_max module ======================================= .. automodule:: savu.plugins.stats.min_and_max - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.stats.rst b/doc/source/api_plugin/savu.plugins.stats.rst index d29c1e04f..fbcec0cbd 100644 --- a/doc/source/api_plugin/savu.plugins.stats.rst +++ b/doc/source/api_plugin/savu.plugins.stats.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.stats.min_and_max @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.stats - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.utils.rst b/doc/source/api_plugin/savu.plugins.utils.rst index 5f5e3c4ad..67270da11 100644 --- a/doc/source/api_plugin/savu.plugins.utils.rst +++ b/doc/source/api_plugin/savu.plugins.utils.rst @@ -2,6 +2,6 @@ savu.plugins.utils module ========================= .. automodule:: savu.plugins.utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.visualisation.ortho_slice.rst b/doc/source/api_plugin/savu.plugins.visualisation.ortho_slice.rst index 0583ad7b1..6ec392e2b 100644 --- a/doc/source/api_plugin/savu.plugins.visualisation.ortho_slice.rst +++ b/doc/source/api_plugin/savu.plugins.visualisation.ortho_slice.rst @@ -2,6 +2,6 @@ savu.plugins.visualisation.ortho\_slice module ============================================== .. automodule:: savu.plugins.visualisation.ortho_slice - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.plugins.visualisation.rst b/doc/source/api_plugin/savu.plugins.visualisation.rst index 4f99da965..26a8bb1a5 100644 --- a/doc/source/api_plugin/savu.plugins.visualisation.rst +++ b/doc/source/api_plugin/savu.plugins.visualisation.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.plugins.visualisation.ortho_slice @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: savu.plugins.visualisation - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.rst b/doc/source/api_plugin/savu.rst index dd5c7aaeb..db129654a 100644 --- a/doc/source/api_plugin/savu.rst +++ b/doc/source/api_plugin/savu.rst @@ -5,16 +5,18 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.core - savu.data - savu.plugins - savu.test + savu.core + savu.data + savu.plugins + savu.test Submodules ---------- .. toctree:: + :maxdepth: 4 savu.tomo_recon savu.version @@ -23,6 +25,6 @@ Module contents --------------- .. automodule:: savu - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.base_checkpoint_test.rst b/doc/source/api_plugin/savu.test.base_checkpoint_test.rst index 2ee548997..899add5ba 100644 --- a/doc/source/api_plugin/savu.test.base_checkpoint_test.rst +++ b/doc/source/api_plugin/savu.test.base_checkpoint_test.rst @@ -2,6 +2,6 @@ savu.test.base\_checkpoint\_test module ======================================= .. automodule:: savu.test.base_checkpoint_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.dawn_runner_tests.rst b/doc/source/api_plugin/savu.test.jenkins.dawn_runner_tests.rst index 5fd9eace9..32968709b 100644 --- a/doc/source/api_plugin/savu.test.jenkins.dawn_runner_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.dawn_runner_tests.rst @@ -1,17 +1,10 @@ savu.test.jenkins.dawn\_runner\_tests package ============================================= -Submodules ----------- - -.. toctree:: - - savu.test.jenkins.dawn_runner_tests.i08_pymca_runner_test - Module contents --------------- .. automodule:: savu.test.jenkins.dawn_runner_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst index 739036907..62ac760df 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.plugin\_tests.filter\_tests.ccpi\_denoising\_gpu\_test module =============================================================================== .. automodule:: savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst index c655a08b2..acba48d6e 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.plugin\_tests.filter\_tests.ccpi\_ring\_artefact\_test module =============================================================================== .. automodule:: savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test.rst new file mode 100644 index 000000000..e76cae23e --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.dezinger\_gpu\_test module +======================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test.rst new file mode 100644 index 000000000..07ccb5885 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.median\_filter\_gpu\_test module +============================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.rst index cc3ae17e3..6708973a7 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.rst @@ -1,29 +1,29 @@ savu.test.jenkins.plugin\_tests.filter\_tests package ===================================================== +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.filter_tests.under_revision + Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_cpu_test savu.test.jenkins.plugin_tests.filter_tests.ccpi_denoising_gpu_test savu.test.jenkins.plugin_tests.filter_tests.ccpi_ring_artefact_test - savu.test.jenkins.plugin_tests.filter_tests.component_analysis_test - savu.test.jenkins.plugin_tests.filter_tests.diffraction_absorption_test - savu.test.jenkins.plugin_tests.filter_tests.dummy_ptycho_test - savu.test.jenkins.plugin_tests.filter_tests.i08_pymca_test - savu.test.jenkins.plugin_tests.filter_tests.i14_pymca_test - savu.test.jenkins.plugin_tests.filter_tests.image_interpolation_test - savu.test.jenkins.plugin_tests.filter_tests.mc_near_absorption_correct_test - savu.test.jenkins.plugin_tests.filter_tests.pca_test - savu.test.jenkins.plugin_tests.filter_tests.ptypy_compact_test - savu.test.jenkins.plugin_tests.filter_tests.umpa_test + savu.test.jenkins.plugin_tests.filter_tests.dezinger_gpu_test + savu.test.jenkins.plugin_tests.filter_tests.median_filter_gpu_test Module contents --------------- .. automodule:: savu.test.jenkins.plugin_tests.filter_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te.rst new file mode 100644 index 000000000..8b3c76d7d --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.component\_analysis\_te module +============================================================================================ + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te.rst new file mode 100644 index 000000000..7eb7941db --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.diffraction\_absorption\_te module +================================================================================================ + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te.rst new file mode 100644 index 000000000..090ca826c --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.image\_interpolation\_te module +============================================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te.rst new file mode 100644 index 000000000..8ffc4e6a2 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.mc\_near\_absorption\_correct\_te module +====================================================================================================== + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te.rst new file mode 100644 index 000000000..cef150e03 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.pca\_te module +============================================================================ + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.rst new file mode 100644 index 000000000..9ca94efe4 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.rst @@ -0,0 +1,23 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision package +===================================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.filter_tests.under_revision.component_analysis_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.diffraction_absorption_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.image_interpolation_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.mc_near_absorption_correct_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.pca_te + savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te + +Module contents +--------------- + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te.rst new file mode 100644 index 000000000..41d38fef1 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.filter\_tests.under\_revision.umpa\_te module +============================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.filter_tests.under_revision.umpa_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.rst index 4b6240cf3..73874f50b 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.rst @@ -1,22 +1,18 @@ savu.test.jenkins.plugin\_tests.loader\_tests package ===================================================== -Submodules ----------- +Subpackages +----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.loader_tests.i08_fluo_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i13_fluo_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i13_ptycho_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i13_speckle_tracking_loader_test - savu.test.jenkins.plugin_tests.loader_tests.i14_fluo_loader_test - savu.test.jenkins.plugin_tests.loader_tests.nx_ptycho_loader_test + savu.test.jenkins.plugin_tests.loader_tests.under_revision Module contents --------------- .. automodule:: savu.test.jenkins.plugin_tests.loader_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te.rst new file mode 100644 index 000000000..106aa8b44 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.loader\_tests.under\_revision.i13\_speckle\_tracking\_loader\_te module +======================================================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.under_revision.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.under_revision.rst new file mode 100644 index 000000000..2f792b6de --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.loader_tests.under_revision.rst @@ -0,0 +1,18 @@ +savu.test.jenkins.plugin\_tests.loader\_tests.under\_revision package +===================================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.loader_tests.under_revision.i13_speckle_tracking_loader_te + +Module contents +--------------- + +.. automodule:: savu.test.jenkins.plugin_tests.loader_tests.under_revision + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst index d1b026dc7..c1ac0e509 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.plugin\_tests.reconstruction\_tests.astra\_recon\_gpu\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst index 50ecd3e84..73e151bcc 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.plugin\_tests.reconstruction\_tests.ccpi\_cgls\_recon\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.rst index e9a6dcad4..359c7a5af 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.rst @@ -1,21 +1,26 @@ savu.test.jenkins.plugin\_tests.reconstruction\_tests package ============================================================= +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar + Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.reconstruction_tests.CGLS_astra_test savu.test.jenkins.plugin_tests.reconstruction_tests.astra_recon_gpu_test - savu.test.jenkins.plugin_tests.reconstruction_tests.ccpi_cgls_recon_test - savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar_recon_test - savu.test.jenkins.plugin_tests.reconstruction_tests.tomopy_test Module contents --------------- .. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.rst new file mode 100644 index 000000000..16e098083 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.rst @@ -0,0 +1,18 @@ +savu.test.jenkins.plugin\_tests.reconstruction\_tests.tomobar package +===================================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test + +Module contents +--------------- + +.. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test.rst new file mode 100644 index 000000000..2159166b8 --- /dev/null +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test.rst @@ -0,0 +1,7 @@ +savu.test.jenkins.plugin\_tests.reconstruction\_tests.tomobar.tomobar\_gpu\_test module +======================================================================================= + +.. automodule:: savu.test.jenkins.plugin_tests.reconstruction_tests.tomobar.tomobar_gpu_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.rst index 82bbc518a..6ed029e25 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.rst @@ -5,16 +5,17 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.plugin_tests.filter_tests - savu.test.jenkins.plugin_tests.loader_tests - savu.test.jenkins.plugin_tests.reconstruction_tests - savu.test.jenkins.plugin_tests.saver_tests + savu.test.jenkins.plugin_tests.filter_tests + savu.test.jenkins.plugin_tests.loader_tests + savu.test.jenkins.plugin_tests.reconstruction_tests + savu.test.jenkins.plugin_tests.saver_tests Module contents --------------- .. automodule:: savu.test.jenkins.plugin_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.saver_tests.rst b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.saver_tests.rst index fc8d0c2f0..e79124475 100644 --- a/doc/source/api_plugin/savu.test.jenkins.plugin_tests.saver_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.plugin_tests.saver_tests.rst @@ -1,18 +1,10 @@ savu.test.jenkins.plugin\_tests.saver\_tests package ==================================================== -Submodules ----------- - -.. toctree:: - - savu.test.jenkins.plugin_tests.saver_tests.edf_saver_test - savu.test.jenkins.plugin_tests.saver_tests.xrf_saver_test - Module contents --------------- .. automodule:: savu.test.jenkins.plugin_tests.saver_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.full_recon_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.full_recon_test.rst index 03efda61e..e74733698 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.full_recon_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.full_recon_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.full\_recon\_test module =============================================================== .. automodule:: savu.test.jenkins.process_list_tests.full_recon_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst index 5a2269bc5..200859b60 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_full_pipeline_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.i18\_full\_pipeline\_test module ======================================================================= .. automodule:: savu.test.jenkins.process_list_tests.i18_full_pipeline_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst index 2c7beb591..f241ee263 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.i18\_stxm\_pipeline\_test module ======================================================================= .. automodule:: savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst index a239cf9a2..3c9de5b74 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.i18\_xrf\_pipeline\_test module ====================================================================== .. automodule:: savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst index f16b7abf9..60f045572 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.mm_processing_template_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.mm\_processing\_template\_test module ============================================================================ .. automodule:: savu.test.jenkins.process_list_tests.mm_processing_template_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.new_fit_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.new_fit_test.rst index 93d4ddcd1..45f5fa8e8 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.new_fit_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.new_fit_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.new\_fit\_test module ============================================================ .. automodule:: savu.test.jenkins.process_list_tests.new_fit_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.rst index 549df75e4..46390378d 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.rst @@ -5,29 +5,23 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.jenkins.process_list_tests.full_recon_test - savu.test.jenkins.process_list_tests.i08_pymca_test - savu.test.jenkins.process_list_tests.i18_full_pipeline_test savu.test.jenkins.process_list_tests.i18_stxm_pipeline_test - savu.test.jenkins.process_list_tests.i18_xrd_pipeline_test savu.test.jenkins.process_list_tests.i18_xrf_pipeline_test savu.test.jenkins.process_list_tests.mm_processing_template_test savu.test.jenkins.process_list_tests.new_fit_test - savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test - savu.test.jenkins.process_list_tests.simple_fit_recon_test - savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test savu.test.jenkins.process_list_tests.simple_stxm_tomo_test savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test savu.test.jenkins.process_list_tests.stxm_tomo_test - savu.test.jenkins.process_list_tests.txm_tomo_test Module contents --------------- .. automodule:: savu.test.jenkins.process_list_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst index 53f3d684d..a76a90b1e 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.simple\_fit\_recon\_single\_sino\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_fit_recon_single_sino_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst index 9be4855e9..338f2011a 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_fit_recon_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.simple\_fit\_recon\_test module ====================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_fit_recon_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst index 2eb4f95a3..ba13a405b 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.simple\_stxm\_tomo\_single\_sino\_test mo ==================================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_stxm_tomo_single_sino_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst index ea6fe524e..1b68c7874 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.simple_stxm_tomo_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.simple\_stxm\_tomo\_test module ====================================================================== .. automodule:: savu.test.jenkins.process_list_tests.simple_stxm_tomo_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst index 3609dec6f..f272d58da 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.spectra\_tomo\_chunking\_single\_sino\_te ========================================================================================= .. automodule:: savu.test.jenkins.process_list_tests.spectra_tomo_chunking_single_sino_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst index ef9a7de84..ea2cb0508 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.spectra\_tomo\_chunking\_test module =========================================================================== .. automodule:: savu.test.jenkins.process_list_tests.spectra_tomo_chunking_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst index 08e0771d7..e7ba238df 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.spectra\_tomo\_chunking\_with\_scanned\_p ===================================================================================================== .. automodule:: savu.test.jenkins.process_list_tests.spectra_tomo_chunking_with_scanned_parameter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst index b8050a4f6..d9af687ba 100644 --- a/doc/source/api_plugin/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst +++ b/doc/source/api_plugin/savu.test.jenkins.process_list_tests.stxm_tomo_test.rst @@ -2,6 +2,6 @@ savu.test.jenkins.process\_list\_tests.stxm\_tomo\_test module ============================================================== .. automodule:: savu.test.jenkins.process_list_tests.stxm_tomo_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.jenkins.rst b/doc/source/api_plugin/savu.test.jenkins.rst index 0d1ccb1e0..aa8e88ce8 100644 --- a/doc/source/api_plugin/savu.test.jenkins.rst +++ b/doc/source/api_plugin/savu.test.jenkins.rst @@ -5,15 +5,16 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins.dawn_runner_tests - savu.test.jenkins.plugin_tests - savu.test.jenkins.process_list_tests + savu.test.jenkins.dawn_runner_tests + savu.test.jenkins.plugin_tests + savu.test.jenkins.process_list_tests Module contents --------------- .. automodule:: savu.test.jenkins - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.rst b/doc/source/api_plugin/savu.test.rst index 8d8306138..ac47e8d0e 100644 --- a/doc/source/api_plugin/savu.test.rst +++ b/doc/source/api_plugin/savu.test.rst @@ -5,22 +5,25 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.jenkins - savu.test.travis + savu.test.jenkins + savu.test.travis Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.base_checkpoint_test + savu.test.test_process_list_utils savu.test.test_utils Module contents --------------- .. automodule:: savu.test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.test_process_list_utils.rst b/doc/source/api_plugin/savu.test.test_process_list_utils.rst new file mode 100644 index 000000000..6980555e4 --- /dev/null +++ b/doc/source/api_plugin/savu.test.test_process_list_utils.rst @@ -0,0 +1,7 @@ +savu.test.test\_process\_list\_utils module +=========================================== + +.. automodule:: savu.test.test_process_list_utils + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.test_utils.rst b/doc/source/api_plugin/savu.test.test_utils.rst index 27ca3ef49..e47a89d16 100644 --- a/doc/source/api_plugin/savu.test.test_utils.rst +++ b/doc/source/api_plugin/savu.test.test_utils.rst @@ -2,6 +2,6 @@ savu.test.test\_utils module ============================ .. automodule:: savu.test.test_utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst index 1b9057a24..1a989a401 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.astra_multiple_parameter_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.astra\_multiple\_parameter\_test module ========================================================================= .. automodule:: savu.test.travis.framework_tests.astra_multiple_parameter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.checkpoint_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.checkpoint_test.rst index e699c6e1d..c1f2d5d2e 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.checkpoint_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.checkpoint_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.checkpoint\_test module ========================================================= .. automodule:: savu.test.travis.framework_tests.checkpoint_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.chunking_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.chunking_test.rst index 0dfcf3a8b..0d85167a8 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.chunking_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.chunking_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.chunking\_test module ======================================================= .. automodule:: savu.test.travis.framework_tests.chunking_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.data_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.data_test.rst index 94c0b2495..548aa7708 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.data_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.data_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.data\_test module =================================================== .. automodule:: savu.test.travis.framework_tests.data_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.max_frames_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.max_frames_test.rst index 1d90b63c6..e1a2d20ba 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.max_frames_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.max_frames_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.max\_frames\_test module ========================================================== .. automodule:: savu.test.travis.framework_tests.max_frames_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_datasets_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_datasets_test.rst index b8cee89ef..db83a728c 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_datasets_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_datasets_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.multiple\_datasets\_test module ================================================================= .. automodule:: savu.test.travis.framework_tests.multiple_datasets_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst index b1c9ac7a4..83f56348c 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_process_lists_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.multiple\_parameter\_process\_lists\_test modu ================================================================================== .. automodule:: savu.test.travis.framework_tests.multiple_parameter_process_lists_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_test.rst index bb2375d9e..f1a59f6b6 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.multiple_parameter_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.multiple\_parameter\_test module ================================================================== .. automodule:: savu.test.travis.framework_tests.multiple_parameter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.parameters_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.parameters_test.rst index 274e21ad9..ddd6bcc7a 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.parameters_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.parameters_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.parameters\_test module ========================================================= .. automodule:: savu.test.travis.framework_tests.parameters_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_coverage_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_coverage_test.rst index 42cabf4e4..167c1b9d7 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_coverage_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_coverage_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.plugin\_coverage\_test module =============================================================== .. automodule:: savu.test.travis.framework_tests.plugin_coverage_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_runner_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_runner_test.rst index 9d3641aa8..74e7fb95a 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_runner_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.plugin_runner_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.plugin\_runner\_test module ============================================================= .. automodule:: savu.test.travis.framework_tests.plugin_runner_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.plugins_util_test.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.plugins_util_test.rst index 9e594334b..952febd38 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.plugins_util_test.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.plugins_util_test.rst @@ -2,6 +2,6 @@ savu.test.travis.framework\_tests.plugins\_util\_test module ============================================================ .. automodule:: savu.test.travis.framework_tests.plugins_util_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.framework_tests.rst b/doc/source/api_plugin/savu.test.travis.framework_tests.rst index ecacab1e9..b191c76cf 100644 --- a/doc/source/api_plugin/savu.test.travis.framework_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.framework_tests.rst @@ -5,9 +5,9 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.framework_tests.astra_multiple_parameter_test - savu.test.travis.framework_tests.cgls_library_test savu.test.travis.framework_tests.checkpoint_test savu.test.travis.framework_tests.chunking_test savu.test.travis.framework_tests.data_test @@ -19,12 +19,11 @@ Submodules savu.test.travis.framework_tests.plugin_coverage_test savu.test.travis.framework_tests.plugin_runner_test savu.test.travis.framework_tests.plugins_util_test - savu.test.travis.framework_tests.test_utils Module contents --------------- .. automodule:: savu.test.travis.framework_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.basic_operations_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.basic_operations_test.rst index c680c58da..6b4dcf8a8 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.basic_operations_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.basic_operations_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.basic\_operations\_test module ============================================================= .. automodule:: savu.test.travis.plugin_tests.basic_operations_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst index c5026a09a..96e79f13d 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.correction\_tests.camera\_rot\_corr\_test module =============================================================================== .. automodule:: savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.rst index 0adbe05c5..df044125c 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.plugin_tests.correction_tests.camera_rot_corr_test savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test @@ -14,6 +15,6 @@ Module contents --------------- .. automodule:: savu.test.travis.plugin_tests.correction_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst index a456545c4..025383de6 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.correction\_tests.subpixel\_shift\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.correction_tests.subpixel_shift_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst index 2162589ff..421126fa0 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.correction_tests.time_based_correction_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.correction\_tests.time\_based\_correction\_test m ===================================================================================== .. automodule:: savu.test.travis.plugin_tests.correction_tests.time_based_correction_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test.rst new file mode 100644 index 000000000..c2f8fa323 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise.band\_pass\_test module +============================================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test.rst new file mode 100644 index 000000000..af41aa076 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise.ccpi\_denoising\_cpu\_test module +====================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test.rst new file mode 100644 index 000000000..453617312 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise.denoise\_bregman\_test module +================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.rst new file mode 100644 index 000000000..1105690db --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.denoise.rst @@ -0,0 +1,20 @@ +savu.test.travis.plugin\_tests.filter\_tests.denoise package +============================================================ + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.denoise.band_pass_test + savu.test.travis.plugin_tests.filter_tests.denoise.ccpi_denoising_cpu_test + savu.test.travis.plugin_tests.filter_tests.denoise.denoise_bregman_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.denoise + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test.rst new file mode 100644 index 000000000..95913f6a2 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.dezinger.dezinger\_test module +=========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.dezinger.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.dezinger.rst new file mode 100644 index 000000000..77e183c34 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.dezinger.rst @@ -0,0 +1,18 @@ +savu.test.travis.plugin\_tests.filter\_tests.dezinger package +============================================================= + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.dezinger.dezinger_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.dezinger + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst index 1ef5b12b1..300ae0104 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.distortion_correction_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.distortion\_correction\_test module ================================================================================ .. automodule:: savu.test.travis.plugin_tests.filter_tests.distortion_correction_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst index cfc40f019..a4b00d9cd 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.downsample_filter_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.downsample\_filter\_test module ============================================================================ .. automodule:: savu.test.travis.plugin_tests.filter_tests.downsample_filter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test.rst new file mode 100644 index 000000000..a90dacc82 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.fresnel\_filter\_test module +========================================================================= + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst index 2c50d3023..bbbbf6a9d 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.hilbert_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.hilbert\_test module ================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.hilbert_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test.rst new file mode 100644 index 000000000..615b6d744 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.background\_estimator\_test module +========================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test.rst new file mode 100644 index 000000000..312900665 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.find\_peaks\_test module +================================================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test.rst new file mode 100644 index 000000000..45865ed2b --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.histogram\_test module +============================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.rst new file mode 100644 index 000000000..d127c1171 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.rst @@ -0,0 +1,23 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal package +=============================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.multimodal.background_estimator_test + savu.test.travis.plugin_tests.filter_tests.multimodal.find_peaks_test + savu.test.travis.plugin_tests.filter_tests.multimodal.histogram_test + savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test + savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test + savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test.rst new file mode 100644 index 000000000..70aaa3240 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.simple\_fit\_test module +================================================================================ + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.simple_fit_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test.rst new file mode 100644 index 000000000..b0241b5e3 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.spectrum\_crop\_test module +=================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.spectrum_crop_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test.rst new file mode 100644 index 000000000..4c66d0c75 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.multimodal.strip\_background\_test module +====================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.multimodal.strip_background_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst index 38c03c8f3..34b95e2de 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.paganin_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.paganin\_test module ================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.paganin_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test.rst new file mode 100644 index 000000000..da7c1a03b --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.pyfai.pyfai\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pyfai.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pyfai.rst new file mode 100644 index 000000000..4bf59d12c --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pyfai.rst @@ -0,0 +1,18 @@ +savu.test.travis.plugin\_tests.filter\_tests.pyfai package +========================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.pyfai.pyfai_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pyfai + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test.rst new file mode 100644 index 000000000..b3a2c879f --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca.list\_to\_projections\_test module +===================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test.rst new file mode 100644 index 000000000..cdc429bee --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca.monitor\_correction\_test module +=================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test.rst new file mode 100644 index 000000000..05fb5248f --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca.pymca\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.rst new file mode 100644 index 000000000..16ec1e709 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.pymca.rst @@ -0,0 +1,20 @@ +savu.test.travis.plugin\_tests.filter\_tests.pymca package +========================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.pymca.list_to_projections_test + savu.test.travis.plugin_tests.filter_tests.pymca.monitor_correction_test + savu.test.travis.plugin_tests.filter_tests.pymca.pymca_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.pymca + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst index 788183607..9b57d8d51 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.quantisation\_filter\_test module ============================================================================== .. automodule:: savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst index ce1d4ad71..504fdfb83 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.raven_filter_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.raven\_filter\_test module ======================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.raven_filter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test.rst new file mode 100644 index 000000000..dbf09692e --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.filter\_tests.ring\_removal.remove\_rings\_test module +===================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.ring_removal.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.ring_removal.rst new file mode 100644 index 000000000..163259f10 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.ring_removal.rst @@ -0,0 +1,18 @@ +savu.test.travis.plugin\_tests.filter\_tests.ring\_removal package +================================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.ring_removal.remove_rings_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.filter_tests.ring_removal + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.rst index d7025b7aa..e4c4e5f2a 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.rst @@ -1,35 +1,33 @@ savu.test.travis.plugin\_tests.filter\_tests package ==================================================== +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.filter_tests.denoise + savu.test.travis.plugin_tests.filter_tests.dezinger + savu.test.travis.plugin_tests.filter_tests.multimodal + savu.test.travis.plugin_tests.filter_tests.pyfai + savu.test.travis.plugin_tests.filter_tests.pymca + savu.test.travis.plugin_tests.filter_tests.ring_removal + Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.travis.plugin_tests.filter_tests.background_estimator_test - savu.test.travis.plugin_tests.filter_tests.band_pass_test - savu.test.travis.plugin_tests.filter_tests.denoise_bregman_test - savu.test.travis.plugin_tests.filter_tests.dezinger_simple_test - savu.test.travis.plugin_tests.filter_tests.dezinger_sinogram_test - savu.test.travis.plugin_tests.filter_tests.dezinger_test savu.test.travis.plugin_tests.filter_tests.distortion_correction_test savu.test.travis.plugin_tests.filter_tests.downsample_filter_test - savu.test.travis.plugin_tests.filter_tests.find_peaks_test + savu.test.travis.plugin_tests.filter_tests.fresnel_filter_test savu.test.travis.plugin_tests.filter_tests.hilbert_test - savu.test.travis.plugin_tests.filter_tests.histogram_test - savu.test.travis.plugin_tests.filter_tests.list_to_projections_test - savu.test.travis.plugin_tests.filter_tests.median_filter_test - savu.test.travis.plugin_tests.filter_tests.monitor_correction_test savu.test.travis.plugin_tests.filter_tests.paganin_test - savu.test.travis.plugin_tests.filter_tests.pyfai_filtered_test - savu.test.travis.plugin_tests.filter_tests.pyfai_separate_test - savu.test.travis.plugin_tests.filter_tests.pyfai_test - savu.test.travis.plugin_tests.filter_tests.pymca_test savu.test.travis.plugin_tests.filter_tests.quantisation_filter_test savu.test.travis.plugin_tests.filter_tests.raven_filter_test - savu.test.travis.plugin_tests.filter_tests.simple_fit_test savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test - savu.test.travis.plugin_tests.filter_tests.strip_background_test savu.test.travis.plugin_tests.filter_tests.threshold_filter_test savu.test.travis.plugin_tests.filter_tests.vo_centering_test @@ -37,6 +35,6 @@ Module contents --------------- .. automodule:: savu.test.travis.plugin_tests.filter_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst index af9fde593..d43fc3653 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.sinogram\_alignment\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.sinogram_alignment_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst index 2c02066f3..acb067dd0 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.threshold_filter_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.threshold\_filter\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.filter_tests.threshold_filter_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst index 4b47efa7a..7291bd805 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.filter_tests.vo_centering_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.filter\_tests.vo\_centering\_test module ======================================================================= .. automodule:: savu.test.travis.plugin_tests.filter_tests.vo_centering_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test.rst new file mode 100644 index 000000000..d795e5b58 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.imagesavers\_tests.image\_saver\_test module +=========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.rst new file mode 100644 index 000000000..98f9158f3 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.rst @@ -0,0 +1,19 @@ +savu.test.travis.plugin\_tests.imagesavers\_tests package +========================================================= + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.imagesavers_tests.image_saver_test + savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.imagesavers_tests + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test.rst new file mode 100644 index 000000000..8123ea000 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.imagesavers\_tests.tiff\_saver\_test module +========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.imagesavers_tests.tiff_saver_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst index c7fdecaf5..9440d28b8 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_fluo\_loader\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst index e2ba98662..596301fc4 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_mm\_loader\_test module ========================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst index 99e17e4cf..684d5d63a 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_stxm\_loader\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst index ed624c571..bb35ba43b 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.i18\_xrd\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst index b4adeb41a..e6c7be271 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.i22\_tomo\_loader\_test module =========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst index 2e1eceaec..8b115bbb6 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.i22_tomo_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.i22\_tomo\_test module =================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.i22_tomo_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.mrc_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.mrc_loader_test.rst new file mode 100644 index 000000000..91ac9f1b5 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.mrc_loader_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.loader\_tests.mrc\_loader\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.loader_tests.mrc_loader_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst index b606cfd8d..cda043f50 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_fluo\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst index 3d51db427..d7d5415da 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_mm\_loader\_test module ======================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst index f5bfc3497..e4853ef4c 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_monitor\_loader\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst index 558763aec..10a7e04e0 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_stxm\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_stxm_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst index d7a92d094..531c29254 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_tomo\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_tomo_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst index 5c00df44c..432c8f53f 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.nx\_xrd\_loader\_test module ========================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.nx_xrd_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.rst index ccc3f1f62..e62333462 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.rst @@ -5,13 +5,11 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 - savu.test.travis.plugin_tests.loader_tests.i18_fluo_loader_test - savu.test.travis.plugin_tests.loader_tests.i18_mm_loader_test - savu.test.travis.plugin_tests.loader_tests.i18_stxm_loader_test - savu.test.travis.plugin_tests.loader_tests.i18_xrd_loader_test savu.test.travis.plugin_tests.loader_tests.i22_tomo_loader_test savu.test.travis.plugin_tests.loader_tests.i22_tomo_test + savu.test.travis.plugin_tests.loader_tests.mrc_loader_test savu.test.travis.plugin_tests.loader_tests.nx_fluo_loader_test savu.test.travis.plugin_tests.loader_tests.nx_mm_loader_test savu.test.travis.plugin_tests.loader_tests.nx_monitor_loader_test @@ -26,6 +24,6 @@ Module contents --------------- .. automodule:: savu.test.travis.plugin_tests.loader_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst index 1cfaccc0f..31a0d947a 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.savu\_nexus\_loader\_test module ============================================================================= .. automodule:: savu.test.travis.plugin_tests.loader_tests.savu_nexus_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst index fb1b1a782..7be47b320 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.template_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.template\_loader\_test module ========================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.template_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst index 468a86a39..e730ba462 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.loader_tests.tiff_loader_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.loader\_tests.tiff\_loader\_test module ====================================================================== .. automodule:: savu.test.travis.plugin_tests.loader_tests.tiff_loader_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst index eb4738818..1806c638d 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.reconstruction\_tests.astra\_recon\_cpu\_test mod =================================================================================== .. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.fbp_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.fbp_test.rst new file mode 100644 index 000000000..fcba468ee --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.fbp_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.fbp\_test module +===================================================================== + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.fbp_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.rst index 52db11cd8..63cb26229 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.rst @@ -5,17 +5,19 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_cpu_test - savu.test.travis.plugin_tests.reconstruction_tests.astra_recon_init_vol_test - savu.test.travis.plugin_tests.reconstruction_tests.plugin_sart_test - savu.test.travis.plugin_tests.reconstruction_tests.simple_tomo_test + savu.test.travis.plugin_tests.reconstruction_tests.fbp_test + savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test + savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test + savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test Module contents --------------- .. automodule:: savu.test.travis.plugin_tests.reconstruction_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test.rst new file mode 100644 index 000000000..ba24e0fb3 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.scikit\_image\_recon\_test module +====================================================================================== + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.scikit_image_recon_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test.rst new file mode 100644 index 000000000..8808fad47 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.tomo\_pipeline\_preview\_test module +========================================================================================= + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.tomo_pipeline_preview_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test.rst new file mode 100644 index 000000000..6272ea910 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.reconstruction\_tests.tomobar\_recon2d\_cpu\_test module +======================================================================================= + +.. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.tomobar_recon2d_cpu_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst index f034369fa..b5be70529 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test.rst @@ -2,6 +2,6 @@ savu.test.travis.plugin\_tests.reconstruction\_tests.tomopy\_recon\_test module =============================================================================== .. automodule:: savu.test.travis.plugin_tests.reconstruction_tests.tomopy_recon_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.rst index d4cd8f2ff..79111d997 100644 --- a/doc/source/api_plugin/savu.test.travis.plugin_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.rst @@ -5,18 +5,21 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.travis.plugin_tests.correction_tests - savu.test.travis.plugin_tests.filter_tests - savu.test.travis.plugin_tests.loader_tests - savu.test.travis.plugin_tests.reconstruction_tests - savu.test.travis.plugin_tests.ring_removal_tests - savu.test.travis.plugin_tests.saver_tests + savu.test.travis.plugin_tests.correction_tests + savu.test.travis.plugin_tests.filter_tests + savu.test.travis.plugin_tests.imagesavers_tests + savu.test.travis.plugin_tests.loader_tests + savu.test.travis.plugin_tests.reconstruction_tests + savu.test.travis.plugin_tests.segmentation_tests + savu.test.travis.plugin_tests.simulation_tests Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.plugin_tests.basic_operations_test @@ -24,6 +27,6 @@ Module contents --------------- .. automodule:: savu.test.travis.plugin_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test.rst new file mode 100644 index 000000000..5cebab5bd --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.geo\_dist\_test module +========================================================================= + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.gmm_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.gmm_test.rst new file mode 100644 index 000000000..db69a31fd --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.gmm_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.gmm\_test module +=================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.gmm_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test.rst new file mode 100644 index 000000000..3b05766dc --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.mask\_initialise\_test module +================================================================================ + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test.rst new file mode 100644 index 000000000..6d1ec796a --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.morph\_operations\_test module +================================================================================= + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test.rst new file mode 100644 index 000000000..8fccafa76 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.morphproc\_line\_test module +=============================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test.rst new file mode 100644 index 000000000..76d4b1c7c --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.morphsnakes\_test module +=========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test.rst new file mode 100644 index 000000000..e86484692 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.segmentation\_tests.regiongrow\_test module +========================================================================== + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.rst new file mode 100644 index 000000000..6bb78c0d0 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.segmentation_tests.rst @@ -0,0 +1,24 @@ +savu.test.travis.plugin\_tests.segmentation\_tests package +========================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.segmentation_tests.geo_dist_test + savu.test.travis.plugin_tests.segmentation_tests.gmm_test + savu.test.travis.plugin_tests.segmentation_tests.mask_initialise_test + savu.test.travis.plugin_tests.segmentation_tests.morph_operations_test + savu.test.travis.plugin_tests.segmentation_tests.morphproc_line_test + savu.test.travis.plugin_tests.segmentation_tests.morphsnakes_test + savu.test.travis.plugin_tests.segmentation_tests.regiongrow_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.segmentation_tests + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.simulation_tests.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.simulation_tests.rst new file mode 100644 index 000000000..eae9b7c84 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.simulation_tests.rst @@ -0,0 +1,18 @@ +savu.test.travis.plugin\_tests.simulation\_tests package +======================================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + savu.test.travis.plugin_tests.simulation_tests.tomophantom_test + +Module contents +--------------- + +.. automodule:: savu.test.travis.plugin_tests.simulation_tests + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.plugin_tests.simulation_tests.tomophantom_test.rst b/doc/source/api_plugin/savu.test.travis.plugin_tests.simulation_tests.tomophantom_test.rst new file mode 100644 index 000000000..3761c4308 --- /dev/null +++ b/doc/source/api_plugin/savu.test.travis.plugin_tests.simulation_tests.tomophantom_test.rst @@ -0,0 +1,7 @@ +savu.test.travis.plugin\_tests.simulation\_tests.tomophantom\_test module +========================================================================= + +.. automodule:: savu.test.travis.plugin_tests.simulation_tests.tomophantom_test + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst b/doc/source/api_plugin/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst index 164b5a2d1..bb81f5723 100644 --- a/doc/source/api_plugin/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst +++ b/doc/source/api_plugin/savu.test.travis.process_list_tests.map3dto4d_pipeline_test.rst @@ -2,6 +2,6 @@ savu.test.travis.process\_list\_tests.map3dto4d\_pipeline\_test module ====================================================================== .. automodule:: savu.test.travis.process_list_tests.map3dto4d_pipeline_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.process_list_tests.mapping_3Dto4D.rst b/doc/source/api_plugin/savu.test.travis.process_list_tests.mapping_3Dto4D.rst index 292f8daf2..a85ec6e76 100644 --- a/doc/source/api_plugin/savu.test.travis.process_list_tests.mapping_3Dto4D.rst +++ b/doc/source/api_plugin/savu.test.travis.process_list_tests.mapping_3Dto4D.rst @@ -2,6 +2,6 @@ savu.test.travis.process\_list\_tests.mapping\_3Dto4D module ============================================================ .. automodule:: savu.test.travis.process_list_tests.mapping_3Dto4D - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.process_list_tests.mipmap_test.rst b/doc/source/api_plugin/savu.test.travis.process_list_tests.mipmap_test.rst index 447b2227c..f385c3e7e 100644 --- a/doc/source/api_plugin/savu.test.travis.process_list_tests.mipmap_test.rst +++ b/doc/source/api_plugin/savu.test.travis.process_list_tests.mipmap_test.rst @@ -2,6 +2,6 @@ savu.test.travis.process\_list\_tests.mipmap\_test module ========================================================= .. automodule:: savu.test.travis.process_list_tests.mipmap_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.process_list_tests.mm_test.rst b/doc/source/api_plugin/savu.test.travis.process_list_tests.mm_test.rst index a39ca3b7f..49c3b3f0a 100644 --- a/doc/source/api_plugin/savu.test.travis.process_list_tests.mm_test.rst +++ b/doc/source/api_plugin/savu.test.travis.process_list_tests.mm_test.rst @@ -2,6 +2,6 @@ savu.test.travis.process\_list\_tests.mm\_test module ===================================================== .. automodule:: savu.test.travis.process_list_tests.mm_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.process_list_tests.rst b/doc/source/api_plugin/savu.test.travis.process_list_tests.rst index a54a17774..39b824131 100644 --- a/doc/source/api_plugin/savu.test.travis.process_list_tests.rst +++ b/doc/source/api_plugin/savu.test.travis.process_list_tests.rst @@ -5,20 +5,18 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 savu.test.travis.process_list_tests.map3dto4d_pipeline_test savu.test.travis.process_list_tests.mapping_3Dto4D savu.test.travis.process_list_tests.mipmap_test savu.test.travis.process_list_tests.mm_test - savu.test.travis.process_list_tests.scikit_image_recon_test - savu.test.travis.process_list_tests.spectrum_crop_test savu.test.travis.process_list_tests.stats_test - savu.test.travis.process_list_tests.tomo_pipeline_preview_test Module contents --------------- .. automodule:: savu.test.travis.process_list_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.process_list_tests.stats_test.rst b/doc/source/api_plugin/savu.test.travis.process_list_tests.stats_test.rst index 324ec9d47..f852b44aa 100644 --- a/doc/source/api_plugin/savu.test.travis.process_list_tests.stats_test.rst +++ b/doc/source/api_plugin/savu.test.travis.process_list_tests.stats_test.rst @@ -2,6 +2,6 @@ savu.test.travis.process\_list\_tests.stats\_test module ======================================================== .. automodule:: savu.test.travis.process_list_tests.stats_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.test.travis.rst b/doc/source/api_plugin/savu.test.travis.rst index d9fad5810..162b7295d 100644 --- a/doc/source/api_plugin/savu.test.travis.rst +++ b/doc/source/api_plugin/savu.test.travis.rst @@ -5,15 +5,16 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - savu.test.travis.framework_tests - savu.test.travis.plugin_tests - savu.test.travis.process_list_tests + savu.test.travis.framework_tests + savu.test.travis.plugin_tests + savu.test.travis.process_list_tests Module contents --------------- .. automodule:: savu.test.travis - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.tomo_recon.rst b/doc/source/api_plugin/savu.tomo_recon.rst index bc20e1ebe..cc30b465d 100644 --- a/doc/source/api_plugin/savu.tomo_recon.rst +++ b/doc/source/api_plugin/savu.tomo_recon.rst @@ -2,6 +2,6 @@ savu.tomo\_recon module ======================= .. automodule:: savu.tomo_recon - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/savu.version.rst b/doc/source/api_plugin/savu.version.rst index c6c447b4a..2319c1542 100644 --- a/doc/source/api_plugin/savu.version.rst +++ b/doc/source/api_plugin/savu.version.rst @@ -2,6 +2,6 @@ savu.version module =================== .. automodule:: savu.version - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.citation_extractor.citation_extractor.rst b/doc/source/api_plugin/scripts.citation_extractor.citation_extractor.rst index f8b9e1854..65449ce02 100644 --- a/doc/source/api_plugin/scripts.citation_extractor.citation_extractor.rst +++ b/doc/source/api_plugin/scripts.citation_extractor.citation_extractor.rst @@ -2,6 +2,6 @@ scripts.citation\_extractor.citation\_extractor module ====================================================== .. automodule:: scripts.citation_extractor.citation_extractor - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.citation_extractor.rst b/doc/source/api_plugin/scripts.citation_extractor.rst index 07a307319..c0778e78d 100644 --- a/doc/source/api_plugin/scripts.citation_extractor.rst +++ b/doc/source/api_plugin/scripts.citation_extractor.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.citation_extractor.citation_extractor @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: scripts.citation_extractor - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.arg_parsers.rst b/doc/source/api_plugin/scripts.config_generator.arg_parsers.rst index c68f92488..db5cbb9fb 100644 --- a/doc/source/api_plugin/scripts.config_generator.arg_parsers.rst +++ b/doc/source/api_plugin/scripts.config_generator.arg_parsers.rst @@ -2,6 +2,6 @@ scripts.config\_generator.arg\_parsers module ============================================= .. automodule:: scripts.config_generator.arg_parsers - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.completer.rst b/doc/source/api_plugin/scripts.config_generator.completer.rst index e2e1924b6..9093093d8 100644 --- a/doc/source/api_plugin/scripts.config_generator.completer.rst +++ b/doc/source/api_plugin/scripts.config_generator.completer.rst @@ -2,6 +2,6 @@ scripts.config\_generator.completer module ========================================== .. automodule:: scripts.config_generator.completer - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.config_utils.rst b/doc/source/api_plugin/scripts.config_generator.config_utils.rst index 0efe33490..b2636b771 100644 --- a/doc/source/api_plugin/scripts.config_generator.config_utils.rst +++ b/doc/source/api_plugin/scripts.config_generator.config_utils.rst @@ -2,6 +2,6 @@ scripts.config\_generator.config\_utils module ============================================== .. automodule:: scripts.config_generator.config_utils - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.content.rst b/doc/source/api_plugin/scripts.config_generator.content.rst index efdad328d..7e07b3d2b 100644 --- a/doc/source/api_plugin/scripts.config_generator.content.rst +++ b/doc/source/api_plugin/scripts.config_generator.content.rst @@ -2,6 +2,6 @@ scripts.config\_generator.content module ======================================== .. automodule:: scripts.config_generator.content - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.display_formatter.rst b/doc/source/api_plugin/scripts.config_generator.display_formatter.rst index 1782352a7..f2a7c2b0e 100644 --- a/doc/source/api_plugin/scripts.config_generator.display_formatter.rst +++ b/doc/source/api_plugin/scripts.config_generator.display_formatter.rst @@ -2,6 +2,6 @@ scripts.config\_generator.display\_formatter module =================================================== .. automodule:: scripts.config_generator.display_formatter - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.hdf5_template_extractor.rst b/doc/source/api_plugin/scripts.config_generator.hdf5_template_extractor.rst new file mode 100644 index 000000000..dc57ab41e --- /dev/null +++ b/doc/source/api_plugin/scripts.config_generator.hdf5_template_extractor.rst @@ -0,0 +1,7 @@ +scripts.config\_generator.hdf5\_template\_extractor module +========================================================== + +.. automodule:: scripts.config_generator.hdf5_template_extractor + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.mutations.rst b/doc/source/api_plugin/scripts.config_generator.mutations.rst index 55f8f3454..5673af0b6 100644 --- a/doc/source/api_plugin/scripts.config_generator.mutations.rst +++ b/doc/source/api_plugin/scripts.config_generator.mutations.rst @@ -2,6 +2,6 @@ scripts.config\_generator.mutations module ========================================== .. automodule:: scripts.config_generator.mutations - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.parameter_extractor.rst b/doc/source/api_plugin/scripts.config_generator.parameter_extractor.rst index 59a7ba345..6120d9c32 100644 --- a/doc/source/api_plugin/scripts.config_generator.parameter_extractor.rst +++ b/doc/source/api_plugin/scripts.config_generator.parameter_extractor.rst @@ -2,6 +2,6 @@ scripts.config\_generator.parameter\_extractor module ===================================================== .. automodule:: scripts.config_generator.parameter_extractor - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.rst b/doc/source/api_plugin/scripts.config_generator.rst index 5bbc260da..3448adbfc 100644 --- a/doc/source/api_plugin/scripts.config_generator.rst +++ b/doc/source/api_plugin/scripts.config_generator.rst @@ -5,12 +5,14 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.config_generator.arg_parsers scripts.config_generator.completer scripts.config_generator.config_utils scripts.config_generator.content scripts.config_generator.display_formatter + scripts.config_generator.hdf5_template_extractor scripts.config_generator.mutations scripts.config_generator.parameter_extractor scripts.config_generator.savu_config @@ -21,6 +23,6 @@ Module contents --------------- .. automodule:: scripts.config_generator - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.savu_config.rst b/doc/source/api_plugin/scripts.config_generator.savu_config.rst index 21552985d..237933c4f 100644 --- a/doc/source/api_plugin/scripts.config_generator.savu_config.rst +++ b/doc/source/api_plugin/scripts.config_generator.savu_config.rst @@ -2,6 +2,6 @@ scripts.config\_generator.savu\_config module ============================================= .. automodule:: scripts.config_generator.savu_config - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.update_template.rst b/doc/source/api_plugin/scripts.config_generator.update_template.rst index 2de1c5260..025e1f5f9 100644 --- a/doc/source/api_plugin/scripts.config_generator.update_template.rst +++ b/doc/source/api_plugin/scripts.config_generator.update_template.rst @@ -2,6 +2,6 @@ scripts.config\_generator.update\_template module ================================================= .. automodule:: scripts.config_generator.update_template - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.config_generator.win_readline.rst b/doc/source/api_plugin/scripts.config_generator.win_readline.rst index 294198d39..7e58ef3f3 100644 --- a/doc/source/api_plugin/scripts.config_generator.win_readline.rst +++ b/doc/source/api_plugin/scripts.config_generator.win_readline.rst @@ -2,6 +2,6 @@ scripts.config\_generator.win\_readline module ============================================== .. automodule:: scripts.config_generator.win_readline - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.configurator_tests.dawn_compatible_test.rst b/doc/source/api_plugin/scripts.configurator_tests.dawn_compatible_test.rst index 7e93b307f..8efc7908a 100644 --- a/doc/source/api_plugin/scripts.configurator_tests.dawn_compatible_test.rst +++ b/doc/source/api_plugin/scripts.configurator_tests.dawn_compatible_test.rst @@ -2,6 +2,6 @@ scripts.configurator\_tests.dawn\_compatible\_test module ========================================================= .. automodule:: scripts.configurator_tests.dawn_compatible_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.configurator_tests.refresh_process_lists_test.rst b/doc/source/api_plugin/scripts.configurator_tests.refresh_process_lists_test.rst index cb7a0d2ff..c20b27b6c 100644 --- a/doc/source/api_plugin/scripts.configurator_tests.refresh_process_lists_test.rst +++ b/doc/source/api_plugin/scripts.configurator_tests.refresh_process_lists_test.rst @@ -2,6 +2,6 @@ scripts.configurator\_tests.refresh\_process\_lists\_test module ================================================================ .. automodule:: scripts.configurator_tests.refresh_process_lists_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.configurator_tests.rst b/doc/source/api_plugin/scripts.configurator_tests.rst index 60e301464..bcc861246 100644 --- a/doc/source/api_plugin/scripts.configurator_tests.rst +++ b/doc/source/api_plugin/scripts.configurator_tests.rst @@ -5,8 +5,8 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 - scripts.configurator_tests.dawn_compatible_test scripts.configurator_tests.refresh_process_lists_test scripts.configurator_tests.savu_config_test @@ -14,6 +14,6 @@ Module contents --------------- .. automodule:: scripts.configurator_tests - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.configurator_tests.savu_config_test.rst b/doc/source/api_plugin/scripts.configurator_tests.savu_config_test.rst index 000cbac15..2bd094886 100644 --- a/doc/source/api_plugin/scripts.configurator_tests.savu_config_test.rst +++ b/doc/source/api_plugin/scripts.configurator_tests.savu_config_test.rst @@ -2,6 +2,6 @@ scripts.configurator\_tests.savu\_config\_test module ===================================================== .. automodule:: scripts.configurator_tests.savu_config_test - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.dawn_runner.rst b/doc/source/api_plugin/scripts.dawn_runner.rst index d2f73ff4d..514772c82 100644 --- a/doc/source/api_plugin/scripts.dawn_runner.rst +++ b/doc/source/api_plugin/scripts.dawn_runner.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.dawn_runner.run_savu @@ -12,6 +13,6 @@ Module contents --------------- .. automodule:: scripts.dawn_runner - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.dawn_runner.run_savu.rst b/doc/source/api_plugin/scripts.dawn_runner.run_savu.rst index c0ce5219c..2b445977b 100644 --- a/doc/source/api_plugin/scripts.dawn_runner.run_savu.rst +++ b/doc/source/api_plugin/scripts.dawn_runner.run_savu.rst @@ -2,6 +2,6 @@ scripts.dawn\_runner.run\_savu module ===================================== .. automodule:: scripts.dawn_runner.run_savu - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.incomplete_jobs_finder.rst b/doc/source/api_plugin/scripts.incomplete_jobs_finder.rst new file mode 100644 index 000000000..58cb1aad7 --- /dev/null +++ b/doc/source/api_plugin/scripts.incomplete_jobs_finder.rst @@ -0,0 +1,7 @@ +scripts.incomplete\_jobs\_finder module +======================================= + +.. automodule:: scripts.incomplete_jobs_finder + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler.rst b/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler.rst index acafc3f13..7da003af2 100644 --- a/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler.rst +++ b/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler.rst @@ -2,6 +2,6 @@ scripts.log\_evaluation.GraphicalThreadProfiler module ====================================================== .. automodule:: scripts.log_evaluation.GraphicalThreadProfiler - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst b/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst index 1044820b1..4f1814662 100644 --- a/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst +++ b/doc/source/api_plugin/scripts.log_evaluation.GraphicalThreadProfiler_multi.rst @@ -2,6 +2,6 @@ scripts.log\_evaluation.GraphicalThreadProfiler\_multi module ============================================================= .. automodule:: scripts.log_evaluation.GraphicalThreadProfiler_multi - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.log_evaluation.VisualiseProfileData.rst b/doc/source/api_plugin/scripts.log_evaluation.VisualiseProfileData.rst index 0eae66c8c..add85138e 100644 --- a/doc/source/api_plugin/scripts.log_evaluation.VisualiseProfileData.rst +++ b/doc/source/api_plugin/scripts.log_evaluation.VisualiseProfileData.rst @@ -2,6 +2,6 @@ scripts.log\_evaluation.VisualiseProfileData module =================================================== .. automodule:: scripts.log_evaluation.VisualiseProfileData - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.log_evaluation.rst b/doc/source/api_plugin/scripts.log_evaluation.rst index af61da932..4ae9142ec 100644 --- a/doc/source/api_plugin/scripts.log_evaluation.rst +++ b/doc/source/api_plugin/scripts.log_evaluation.rst @@ -5,6 +5,7 @@ Submodules ---------- .. toctree:: + :maxdepth: 4 scripts.log_evaluation.GraphicalThreadProfiler scripts.log_evaluation.GraphicalThreadProfiler_multi @@ -15,6 +16,6 @@ Module contents --------------- .. automodule:: scripts.log_evaluation - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.log_evaluation.template_strings.rst b/doc/source/api_plugin/scripts.log_evaluation.template_strings.rst index 152e2e339..9326f5b7b 100644 --- a/doc/source/api_plugin/scripts.log_evaluation.template_strings.rst +++ b/doc/source/api_plugin/scripts.log_evaluation.template_strings.rst @@ -2,6 +2,6 @@ scripts.log\_evaluation.template\_strings module ================================================ .. automodule:: scripts.log_evaluation.template_strings - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/scripts.rst b/doc/source/api_plugin/scripts.rst index c42302b20..5e979adcb 100644 --- a/doc/source/api_plugin/scripts.rst +++ b/doc/source/api_plugin/scripts.rst @@ -5,24 +5,18 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 - scripts.citation_extractor - scripts.config_generator - scripts.configurator_tests - scripts.dawn_runner - scripts.log_evaluation - -Submodules ----------- - -.. toctree:: - - scripts.dawn_compatible_test + scripts.citation_extractor + scripts.config_generator + scripts.configurator_tests + scripts.dawn_runner + scripts.log_evaluation Module contents --------------- .. automodule:: scripts - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/api_plugin/setup.rst b/doc/source/api_plugin/setup.rst index c616b74fc..e1f29a513 100644 --- a/doc/source/api_plugin/setup.rst +++ b/doc/source/api_plugin/setup.rst @@ -2,6 +2,6 @@ setup module ============ .. automodule:: setup - :members: - :undoc-members: - :noindex: + :members: + :undoc-members: + :noindex: diff --git a/doc/source/conf.py b/doc/source/conf.py index 7732f3897..c99a9600e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -25,7 +25,7 @@ sys.path.insert(0, os.path.abspath('../../')) sys.path.insert(0, os.path.abspath('../../savu')) -print sys.path +print(sys.path) # -- General configuration ----------------------------------------------------- keep_warnings=True @@ -90,8 +90,8 @@ master_doc = 'index' # General information about the project. -project = u'Savu' -copyright = u'2014, Mark Basham' +project = 'Savu' +copyright = '2014, Mark Basham' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -240,8 +240,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Savu.tex', u'Savu Documentation', - u'Mark Basham', 'manual'), + ('index', 'Savu.tex', 'Savu Documentation', + 'Mark Basham', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -270,8 +270,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'savu', u'Savu Documentation', - [u'Mark Basham'], 1) + ('index', 'savu', 'Savu Documentation', + ['Mark Basham'], 1) ] # If true, show URL addresses after external links. @@ -284,8 +284,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Savu', u'Savu Documentation', - u'Mark Basham', 'Savu', 'One line description of project.', + ('index', 'Savu', 'Savu Documentation', + 'Mark Basham', 'Savu', 'One line description of project.', 'Miscellaneous'), ] diff --git a/doc/source/dls_installer.rst b/doc/source/dls_installer.rst deleted file mode 100644 index eb4919a4b..000000000 --- a/doc/source/dls_installer.rst +++ /dev/null @@ -1,16 +0,0 @@ -Installing Savu -=============== - -Requirements: - - An MPI implementation (tested with openmpi 3.1.4) - - fftw (tested with 3.3.7) - - cuda (tested with 9.2) - -1. Download the latest version of :download:`savu <../../install/2_4_install/savu_v2.4.tar.gz>` and extract. - -2. Run the following command and follow the installation instructions: - - >>> bash savu_v2.4/savu_installer.sh - -3. Check the log file /tmp//savu_error_log.txt for installation errors (correct log file path printed to screen during installation process). - diff --git a/doc/source/framework_autosummary.rst b/doc/source/framework_autosummary.rst index bde529fdf..1d2f2b9a0 100644 --- a/doc/source/framework_autosummary.rst +++ b/doc/source/framework_autosummary.rst @@ -37,8 +37,8 @@ savu.data .. toctree:: api/savu.data.chunking api/savu.data.experiment_collection - api/savu.data.plugin_list api/savu.data.framework_citations + api/savu.data.plugin_list api/savu.data.meta_data diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 02fe88825..017b8887b 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -7,4 +7,4 @@ Table of Contents .. toctree:: :maxdepth: 2 - dls_installer + savu_hpc diff --git a/doc/source/oldconf.py b/doc/source/oldconf.py index 494c0bfcd..9c114c4b9 100644 --- a/doc/source/oldconf.py +++ b/doc/source/oldconf.py @@ -44,7 +44,7 @@ sys.path.insert(0, os.path.abspath('../../savu/plugins/loaders/multi_modal_loaders')) sys.path.insert(0, os.path.abspath('../../savu/plugins/savers')) -print sys.path +print(sys.path) # -- General configuration ----------------------------------------------------- keep_warnings=True @@ -107,8 +107,8 @@ master_doc = 'index' # General information about the project. -project = u'Savu' -copyright = u'2014, Mark Basham' +project = 'Savu' +copyright = '2014, Mark Basham' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -253,8 +253,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Savu.tex', u'Savu Documentation', - u'Mark Basham', 'manual'), + ('index', 'Savu.tex', 'Savu Documentation', + 'Mark Basham', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -283,8 +283,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'savu', u'Savu Documentation', - [u'Mark Basham'], 1) + ('index', 'savu', 'Savu Documentation', + ['Mark Basham'], 1) ] # If true, show URL addresses after external links. @@ -297,8 +297,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Savu', u'Savu Documentation', - u'Mark Basham', 'Savu', 'One line description of project.', + ('index', 'Savu', 'Savu Documentation', + 'Mark Basham', 'Savu', 'One line description of project.', 'Miscellaneous'), ] diff --git a/doc/source/plugin_autosummary.rst b/doc/source/plugin_autosummary.rst index 97f4a6708..a376a8df9 100644 --- a/doc/source/plugin_autosummary.rst +++ b/doc/source/plugin_autosummary.rst @@ -37,8 +37,8 @@ savu.data .. toctree:: api_plugin/savu.data.chunking api_plugin/savu.data.experiment_collection - api_plugin/savu.data.plugin_list api_plugin/savu.data.framework_citations + api_plugin/savu.data.plugin_list api_plugin/savu.data.meta_data @@ -123,8 +123,8 @@ savu.plugins.azimuthal_integrators .. toctree:: api_plugin/savu.plugins.azimuthal_integrators.base_azimuthal_integrator - api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator + api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_with_bragg_filter api_plugin/savu.plugins.azimuthal_integrators.pyfai_azimuthal_integrator_separate @@ -136,7 +136,11 @@ savu.plugins.basic_operations api_plugin/savu.plugins.basic_operations.no_process_plugin api_plugin/savu.plugins.basic_operations.arithmetic_operations api_plugin/savu.plugins.basic_operations.data_rescale + api_plugin/savu.plugins.basic_operations.data_threshold api_plugin/savu.plugins.basic_operations.get_data_statistics + api_plugin/savu.plugins.basic_operations.value_mask_replacement + api_plugin/savu.plugins.basic_operations.test_plugin + api_plugin/savu.plugins.basic_operations.elementwise_arrays_arithmetics savu.plugins.centering @@ -145,7 +149,6 @@ savu.plugins.centering .. toctree:: api_plugin/savu.plugins.centering.vo_centering api_plugin/savu.plugins.centering.vo_centering_iterative - api_plugin/savu.plugins.centering.vo_centering_gpu savu.plugins.component_analysis @@ -164,16 +167,16 @@ savu.plugins.corrections api_plugin/savu.plugins.corrections.base_correction api_plugin/savu.plugins.corrections.dark_flat_field_correction api_plugin/savu.plugins.corrections.monitor_correction - api_plugin/savu.plugins.corrections.convert_360_180_sinogram api_plugin/savu.plugins.corrections.time_based_correction api_plugin/savu.plugins.corrections.camera_rot_correction + api_plugin/savu.plugins.corrections.convert_360_180_sinogram api_plugin/savu.plugins.corrections.distortion_correction + api_plugin/savu.plugins.corrections.mtf_deconvolution api_plugin/savu.plugins.corrections.monitor_correction_nd + api_plugin/savu.plugins.corrections.xrd_absorption_approximation api_plugin/savu.plugins.corrections.subpixel_shift api_plugin/savu.plugins.corrections.time_based_plus_drift_correction api_plugin/savu.plugins.corrections.timeseries_field_corrections - api_plugin/savu.plugins.corrections.xrd_absorption_approximation - api_plugin/savu.plugins.corrections.distortion_correction_deprecated savu.plugins.developing @@ -187,63 +190,72 @@ savu.plugins.driver ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.driver.all_cpus_plugin api_plugin/savu.plugins.driver.cpu_plugin api_plugin/savu.plugins.driver.gpu_plugin + api_plugin/savu.plugins.driver.all_cpus_plugin + api_plugin/savu.plugins.driver.multi_threaded_plugin api_plugin/savu.plugins.driver.plugin_driver api_plugin/savu.plugins.driver.base_driver api_plugin/savu.plugins.driver.basic_driver - api_plugin/savu.plugins.driver.multi_threaded_plugin api_plugin/savu.plugins.driver.iterative_plugin - api_plugin/savu.plugins.driver.single_node_multi_threaded_plugin savu.plugins.filters ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.filters.denoise_bregman_filter + api_plugin/savu.plugins.filters.pymca api_plugin/savu.plugins.filters.band_pass api_plugin/savu.plugins.filters.base_filter api_plugin/savu.plugins.filters.paganin_filter - api_plugin/savu.plugins.filters.ccpi_denoising_cpu - api_plugin/savu.plugins.filters.ccpi_denoising_gpu + api_plugin/savu.plugins.filters.dezinger + api_plugin/savu.plugins.filters.fresnel_filter api_plugin/savu.plugins.filters.list_to_projections + api_plugin/savu.plugins.filters.hilbert_filter + api_plugin/savu.plugins.filters.poly_background_estimator api_plugin/savu.plugins.filters.dials_find_spots + api_plugin/savu.plugins.filters.image_interpolation api_plugin/savu.plugins.filters.find_peaks - api_plugin/savu.plugins.filters.median_filter - api_plugin/savu.plugins.filters.dezinger - api_plugin/savu.plugins.filters.poly_background_estimator - api_plugin/savu.plugins.filters.dezinger_simple - api_plugin/savu.plugins.filters.dezinger_sinogram - api_plugin/savu.plugins.filters.pymca + api_plugin/savu.plugins.filters.strip_background + api_plugin/savu.plugins.filters.umpa + api_plugin/savu.plugins.filters.dezinger_deprecated api_plugin/savu.plugins.filters.quantisation_filter api_plugin/savu.plugins.filters.spectrum_crop - api_plugin/savu.plugins.filters.strip_background api_plugin/savu.plugins.filters.threshold_filter - api_plugin/savu.plugins.filters.hilbert_filter - api_plugin/savu.plugins.filters.image_interpolation - api_plugin/savu.plugins.filters.umpa - api_plugin/savu.plugins.filters.fresnel_filter -savu.plugins.fitters +savu.plugins.filters.dezingers ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.fitters.base_fitter - api_plugin/savu.plugins.fitters.ral_fit - api_plugin/savu.plugins.fitters.reproduce_fit - api_plugin/savu.plugins.fitters.simple_fit + api_plugin/savu.plugins.filters.dezingers.dezinger_gpu + api_plugin/savu.plugins.filters.dezingers.dezinger_simple_deprecated + api_plugin/savu.plugins.filters.dezingers.dezinger_sinogram_deprecated + api_plugin/savu.plugins.filters.dezingers.dezinger -savu.plugins.fluo_fitters +savu.plugins.filters.denoising ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.fluo_fitters.base_fluo_fitter - api_plugin/savu.plugins.fluo_fitters.fastxrf_fitting - api_plugin/savu.plugins.fluo_fitters.simple_fit_xrf + api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu + api_plugin/savu.plugins.filters.denoising.ccpi_denoising_cpu_3D + api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu + api_plugin/savu.plugins.filters.denoising.ccpi_denoising_gpu_3D + api_plugin/savu.plugins.filters.denoising.denoise_bregman_filter + api_plugin/savu.plugins.filters.denoising.median_filter_deprecated + api_plugin/savu.plugins.filters.denoising.median_filter + api_plugin/savu.plugins.filters.denoising.median_filter_gpu + + +savu.plugins.fitters +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.fitters.base_fitter + api_plugin/savu.plugins.fitters.ral_fit + api_plugin/savu.plugins.fitters.reproduce_fit + api_plugin/savu.plugins.fitters.simple_fit savu.plugins.kinematics @@ -258,10 +270,9 @@ savu.plugins.loaders .. toctree:: api_plugin/savu.plugins.loaders.base_loader + api_plugin/savu.plugins.loaders.multi_savu_loader api_plugin/savu.plugins.loaders.random_hdf5_loader api_plugin/savu.plugins.loaders.hdf5_template_loader - api_plugin/savu.plugins.loaders.stitch_data_template_loader - api_plugin/savu.plugins.loaders.multi_savu_loader api_plugin/savu.plugins.loaders.image_template_loader api_plugin/savu.plugins.loaders.savu_nexus_loader api_plugin/savu.plugins.loaders.yaml_converter @@ -272,11 +283,11 @@ savu.plugins.loaders.full_field_loaders .. toctree:: api_plugin/savu.plugins.loaders.full_field_loaders.image_loader - api_plugin/savu.plugins.loaders.full_field_loaders.fake_nxtomo_loader - api_plugin/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader api_plugin/savu.plugins.loaders.full_field_loaders.mrc_loader + api_plugin/savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader api_plugin/savu.plugins.loaders.full_field_loaders.nxtomo_loader api_plugin/savu.plugins.loaders.full_field_loaders.dxchange_loader + api_plugin/savu.plugins.loaders.full_field_loaders.lfov_loader api_plugin/savu.plugins.loaders.full_field_loaders.random_3d_tomo_loader @@ -291,8 +302,8 @@ savu.plugins.loaders.mapping_loaders api_plugin/savu.plugins.loaders.mapping_loaders.nxptycho_loader api_plugin/savu.plugins.loaders.mapping_loaders.nxstxm_loader api_plugin/savu.plugins.loaders.mapping_loaders.nxxrd_loader - api_plugin/savu.plugins.loaders.mapping_loaders.txm_loader api_plugin/savu.plugins.loaders.mapping_loaders.p2r_fly_scan_detector_loader + api_plugin/savu.plugins.loaders.mapping_loaders.txm_loader savu.plugins.loaders.mapping_loaders.i08_loaders @@ -309,9 +320,9 @@ savu.plugins.loaders.mapping_loaders.i13_loaders api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_monitor_loader api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_fluo_loader api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_ptycho_loader - api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_loader api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_stxm_xrf_loader + api_plugin/savu.plugins.loaders.mapping_loaders.i13_loaders.i13_speckle_loader savu.plugins.loaders.mapping_loaders.i14_loaders @@ -321,26 +332,20 @@ savu.plugins.loaders.mapping_loaders.i14_loaders api_plugin/savu.plugins.loaders.mapping_loaders.i14_loaders.i14_fluo_loader -savu.plugins.loaders.mapping_loaders.i18_loaders +savu.plugins.loaders.mapping_loaders.i22_loaders ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.base_i18_multi_modal_loader - api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_xrd_loader - api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_fluo_loader - api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_mm_loader - api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_monitor_loader - api_plugin/savu.plugins.loaders.mapping_loaders.i18_loaders.i18_stxm_loader + api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader -savu.plugins.loaders.mapping_loaders.i22_loaders +savu.plugins.loaders.templates ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.loaders.mapping_loaders.i22_loaders.i22_tomo_loader -savu.plugins.loaders.templates +savu.plugins.loaders.templates.malcolm_templates ------------------------------------------------------------ .. toctree:: @@ -352,13 +357,13 @@ savu.plugins.loaders.templates.i18_templates .. toctree:: -savu.plugins.loaders.templates.malcolm_templates +savu.plugins.loaders.templates.nexus_templates ------------------------------------------------------------ .. toctree:: -savu.plugins.loaders.templates.nexus_templates +savu.plugins.loaders.templates.tomo_templates ------------------------------------------------------------ .. toctree:: @@ -369,7 +374,6 @@ savu.plugins.loaders.utils .. toctree:: api_plugin/savu.plugins.loaders.utils.yaml_utils - api_plugin/savu.plugins.loaders.utils.mrc_header savu.plugins.missing_data @@ -394,14 +398,10 @@ savu.plugins.reconstructions .. toctree:: api_plugin/savu.plugins.reconstructions.tomopy_recon api_plugin/savu.plugins.reconstructions.base_recon - api_plugin/savu.plugins.reconstructions.ccpi_cgls_recon - api_plugin/savu.plugins.reconstructions.scikitimage_filter_back_projection api_plugin/savu.plugins.reconstructions.scikitimage_sart api_plugin/savu.plugins.reconstructions.simple_recon + api_plugin/savu.plugins.reconstructions.scikitimage_filter_back_projection api_plugin/savu.plugins.reconstructions.visual_hulls_recon - api_plugin/savu.plugins.reconstructions.tomobar_recon_cpu - api_plugin/savu.plugins.reconstructions.tomobar_recon - api_plugin/savu.plugins.reconstructions.tomobar_recon_3D savu.plugins.reconstructions.astra_recons @@ -411,6 +411,16 @@ savu.plugins.reconstructions.astra_recons api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_cpu api_plugin/savu.plugins.reconstructions.astra_recons.astra_recon_gpu api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_recon + api_plugin/savu.plugins.reconstructions.astra_recons.base_astra_vector_recon + + +savu.plugins.reconstructions.tomobar +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon + api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_3D + api_plugin/savu.plugins.reconstructions.tomobar.tomobar_recon_cpu savu.plugins.reshape @@ -420,6 +430,7 @@ savu.plugins.reshape api_plugin/savu.plugins.reshape.data_removal api_plugin/savu.plugins.reshape.downsample_filter api_plugin/savu.plugins.reshape.mipmap + api_plugin/savu.plugins.reshape.image_stitching savu.plugins.ring_removal @@ -430,13 +441,14 @@ savu.plugins.ring_removal api_plugin/savu.plugins.ring_removal.raven_filter api_plugin/savu.plugins.ring_removal.remove_all_rings api_plugin/savu.plugins.ring_removal.remove_large_rings - api_plugin/savu.plugins.ring_removal.ring_removal_normalization - api_plugin/savu.plugins.ring_removal.ring_removal_regularization + api_plugin/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings api_plugin/savu.plugins.ring_removal.ring_removal_filtering - api_plugin/savu.plugins.ring_removal.ring_removal_waveletfft api_plugin/savu.plugins.ring_removal.ring_removal_fitting + api_plugin/savu.plugins.ring_removal.ring_removal_normalization + api_plugin/savu.plugins.ring_removal.ring_removal_regularization api_plugin/savu.plugins.ring_removal.ring_removal_sorting - api_plugin/savu.plugins.ring_removal.remove_unresponsive_and_fluctuating_rings + api_plugin/savu.plugins.ring_removal.ring_removal_waveletfft + api_plugin/savu.plugins.ring_removal.ring_removal_interpolation savu.plugins.savers @@ -463,22 +475,12 @@ savu.plugins.segmentation ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.segmentation.gmm_segment3D - api_plugin/savu.plugins.segmentation.geo_distance - api_plugin/savu.plugins.segmentation.mask_evolve - api_plugin/savu.plugins.segmentation.mask_initialiser - api_plugin/savu.plugins.segmentation.morph_snakes - api_plugin/savu.plugins.segmentation.morph_snakes3D - api_plugin/savu.plugins.segmentation.thresh_segm savu.plugins.segmentation.i23segmentation ------------------------------------------------------------ .. toctree:: - api_plugin/savu.plugins.segmentation.i23segmentation.final_segment_i23 - api_plugin/savu.plugins.segmentation.i23segmentation.i23_segment - api_plugin/savu.plugins.segmentation.i23segmentation.i23_segment3D savu.plugins.segmentation.morphological_operations @@ -486,6 +488,48 @@ savu.plugins.segmentation.morphological_operations .. toctree:: api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc + api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line + api_plugin/savu.plugins.segmentation.morphological_operations.morph_proc_line3D + api_plugin/savu.plugins.segmentation.morphological_operations.morph_remove_objects + + +savu.plugins.segmentation.evolving_contours +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes + api_plugin/savu.plugins.segmentation.evolving_contours.morph_snakes3D + api_plugin/savu.plugins.segmentation.evolving_contours.region_grow + api_plugin/savu.plugins.segmentation.evolving_contours.region_grow3D + + +savu.plugins.segmentation.gaussian_mixtures +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.segmentation.gaussian_mixtures.gmm_segment3D + + +savu.plugins.segmentation.geo_distance +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.segmentation.geo_distance.geo_distance + api_plugin/savu.plugins.segmentation.geo_distance.geo_distance3D + + +savu.plugins.segmentation.masks_initialise +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.segmentation.masks_initialise.mask_initialiser + + +savu.plugins.segmentation.thresholding +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.segmentation.thresholding.thresh_segm savu.plugins.visualisation @@ -502,3 +546,38 @@ savu.plugins.stats api_plugin/savu.plugins.stats.min_and_max +savu.plugins.unregistered +------------------------------------------------------------ + +.. toctree:: + + +savu.plugins.unregistered.fluo_fitters +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.unregistered.fluo_fitters.base_fluo_fitter + api_plugin/savu.plugins.unregistered.fluo_fitters.fastxrf_fitting + api_plugin/savu.plugins.unregistered.fluo_fitters.simple_fit_xrf + + +savu.plugins.unregistered.i18_loaders +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.unregistered.i18_loaders.base_i18_multi_modal_loader + api_plugin/savu.plugins.unregistered.i18_loaders.i18_fluo_loader + api_plugin/savu.plugins.unregistered.i18_loaders.i18_xrd_loader + api_plugin/savu.plugins.unregistered.i18_loaders.i18_mm_loader + api_plugin/savu.plugins.unregistered.i18_loaders.i18_monitor_loader + api_plugin/savu.plugins.unregistered.i18_loaders.i18_stxm_loader + + +savu.plugins.simulation +------------------------------------------------------------ + +.. toctree:: + api_plugin/savu.plugins.simulation.tomo_phantom + api_plugin/savu.plugins.simulation.tomo_phantom_quantification + + diff --git a/doc/source/savu_hpc.rst b/doc/source/savu_hpc.rst new file mode 100644 index 000000000..e21c21a19 --- /dev/null +++ b/doc/source/savu_hpc.rst @@ -0,0 +1,21 @@ +Installing Savu for a HPC cluster +================================= + +Savu is designed to run on a High Performance Computing cluster. For optimum +performance, we recommend a fast network interconnect, such as infiniBand, and +a high performance parallel filesystem, such as GPFS or Lustre. + + +Requirements: + - An MPI implementation (tested with openmpi 3.1.4) + +Installation: + +1. Download the latest version of :download:`savu <../../install/savu_hpc/savu_installer.tar.gz>` and extract. + +2. Run the following command and follow the installation instructions: + + >>> bash savu_installer/savu_installer.sh + +3. Check the log file /tmp//savu_error_log.txt for installation errors (correct log file path printed to screen during installation process). + diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 7ad29481f..000000000 --- a/environment.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: test-environment -channels: - - astra-toolbox/label/dev - - conda-forge - - dkazanc - - ccpi -dependencies: - - python=2.7 - - numpy - - pip - - scipy - - pytest - - h5py - - pep8 - - mpi4py - - scikit-image - - scikit-learn - - astra-toolbox - - xraylib - - opencv=4.1.1 - - tomopy - - mock - - fabio - - pytest-cov - - coveralls - - pyfai - - pyfftw - - colorama - - pymca=5.5.2 - - ccpi-regulariser - - tomobar - - tomophantom - - larix - - yamllint - - mrcfile - - pip: - - nvidia-ml-py - - peakutils - - gnureadline - - pmacparser diff --git a/install/1_2_install/conda-recipes/astra/astra.pth b/install/1_2_install/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/1_2_install/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/1_2_install/conda-recipes/astra/build.sh b/install/1_2_install/conda-recipes/astra/build.sh deleted file mode 100644 index 45fbe000a..000000000 --- a/install/1_2_install/conda-recipes/astra/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -ana_path=`command -v anaconda` -prefix=${ana_path%/bin/anaconda}/lib/python2.7/site-packages/astra - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/1_2_install/conda-recipes/astra/meta.yaml b/install/1_2_install/conda-recipes/astra/meta.yaml deleted file mode 100644 index fb90ce74f..000000000 --- a/install/1_2_install/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.6" %} - -package: - name: astra-toolbox - version: 1.6 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: e4dfb782cf2e547264947dd89f8c280b3aa63b7f40010abe6270949577b573d3 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/1_2_install/conda-recipes/future_recipes/h5py/build.sh b/install/1_2_install/conda-recipes/future_recipes/h5py/build.sh deleted file mode 100644 index 4197defcb..000000000 --- a/install/1_2_install/conda-recipes/future_recipes/h5py/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` - -# set anaconda distribution -ana_path=$(command -v anaconda) -ana_path=${ana_path%/bin/anaconda} -hdf5_version=1.10.0 -hdf5_build_no=100 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --hdf5=$ana_path -$PYTHON setup.py configure --hdf5-version=$hdf5_version -$PYTHON setup.py configure --mpi -$PYTHON setup.py build -$PYTHON setup.py install - diff --git a/install/1_2_install/conda-recipes/future_recipes/h5py/meta.yaml b/install/1_2_install/conda-recipes/future_recipes/h5py/meta.yaml deleted file mode 100644 index f05af4843..000000000 --- a/install/1_2_install/conda-recipes/future_recipes/h5py/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "2.6.0" %} # change this - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz -requirements: - build: - - python - - numpy - - hdf5 - - cython - - pkgconfig - - six - -build: - number: 100 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) - diff --git a/install/1_2_install/conda-recipes/future_recipes/hdf5/build.sh b/install/1_2_install/conda-recipes/future_recipes/hdf5/build.sh deleted file mode 100644 index 0ce28f9b3..000000000 --- a/install/1_2_install/conda-recipes/future_recipes/hdf5/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH - -# check anaconda distribution -ana_path=$(command -v anaconda) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples - diff --git a/install/1_2_install/conda-recipes/future_recipes/hdf5/meta.yaml b/install/1_2_install/conda-recipes/future_recipes/hdf5/meta.yaml deleted file mode 100644 index d5e8ff2f5..000000000 --- a/install/1_2_install/conda-recipes/future_recipes/hdf5/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "1.10.0" %} -{% set release = "hdf5-1.10" %} -{% set patch = "hdf5-1.10.0-patch1" %} -#{% set filename = "hdf5-1.8.15" %} # change this - -package: - name: hdf5 - version: {{ version }} - -source: - fn: {{ patch }}.tar.bz2 - #fn: hdf5-{{ version }}.tar.bz2 - #url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ filename }}-patch1/src/{{ filename }}-patch1.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ release }}/{{ patch }}/src/{{ patch }}.tar.bz2 - #md5: b060bb137d6bd8accf8f0c4c59d2746d - -build: - number: 100 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) - diff --git a/install/1_2_install/conda-recipes/h5py/bld.bat b/install/1_2_install/conda-recipes/h5py/bld.bat deleted file mode 100644 index 5b1c5f2ae..000000000 --- a/install/1_2_install/conda-recipes/h5py/bld.bat +++ /dev/null @@ -1,10 +0,0 @@ -REM h5py expects hdf5dll18.lib, so make a copy of the hdf5 .lib -copy %LIBRARY_LIB%\hdf5.lib %PREFIX%\libs\hdf5dll18.lib -copy %LIBRARY_LIB%\hdf5_hl.lib %PREFIX%\libs\hdf5_hldll.lib - -set HDF5_DIR=%LIBRARY_PREFIX% - -python setup.py install -if errorlevel 1 exit 1 - -del %PREFIX%\libs\hdf5* diff --git a/install/1_2_install/conda-recipes/h5py/build.sh b/install/1_2_install/conda-recipes/h5py/build.sh deleted file mode 100644 index 3c10a434d..000000000 --- a/install/1_2_install/conda-recipes/h5py/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` - -# set anaconda distribution -ana_path=$(command -v anaconda) -ana_path=${ana_path%/bin/anaconda} -hdf5_version=1.8.15.1 -hdf5_version_short=1.8.15 -hdf5_build_no=100 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --hdf5=$ana_path -$PYTHON setup.py configure --hdf5-version=$hdf5_version_short -$PYTHON setup.py configure --mpi -$PYTHON setup.py build -$PYTHON setup.py install diff --git a/install/1_2_install/conda-recipes/h5py/meta.yaml b/install/1_2_install/conda-recipes/h5py/meta.yaml deleted file mode 100644 index 48f88f33a..000000000 --- a/install/1_2_install/conda-recipes/h5py/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "2.5.0" %} - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz - -requirements: - build: - - python - - numpy - - hdf5 - - cython - - pkgconfig - - six - -build: - number: 100 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) diff --git a/install/1_2_install/conda-recipes/hdf5/bld.bat b/install/1_2_install/conda-recipes/hdf5/bld.bat deleted file mode 100644 index e9752a74e..000000000 --- a/install/1_2_install/conda-recipes/hdf5/bld.bat +++ /dev/null @@ -1,15 +0,0 @@ -mkdir build -cd build - -REM Configure step -set CMAKE_CUSTOM= -cmake -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DHDF5_BUILD_HL_LIB=ON -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% %CMAKE_CUSTOM% %SRC_DIR% -if errorlevel 1 exit 1 - -REM Build step -devenv HDF5.sln /Build "%RELEASE_TARGET%" -if errorlevel 1 exit 1 - -REM Install step -devenv HDF5.sln /Build "%RELEASE_TARGET%" /Project INSTALL -if errorlevel 1 exit 1 diff --git a/install/1_2_install/conda-recipes/hdf5/build.sh b/install/1_2_install/conda-recipes/hdf5/build.sh deleted file mode 100644 index d37cf201b..000000000 --- a/install/1_2_install/conda-recipes/hdf5/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH - -# check anaconda distribution -ana_path=$(command -v anaconda) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples diff --git a/install/1_2_install/conda-recipes/hdf5/meta.yaml b/install/1_2_install/conda-recipes/hdf5/meta.yaml deleted file mode 100644 index d7831541c..000000000 --- a/install/1_2_install/conda-recipes/hdf5/meta.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{% set version = "1.8.15.1" %} -{% set filename = "hdf5-1.8.15" %} - -package: - name: hdf5 - version: {{ version }} - -source: - fn: hdf5-{{ version }}.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ filename }}-patch1/src/{{ filename }}-patch1.tar.bz2 - #md5: b060bb137d6bd8accf8f0c4c59d2746d - -build: - number: 100 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) diff --git a/install/1_2_install/conda-recipes/savu/build.sh b/install/1_2_install/conda-recipes/savu/build.sh deleted file mode 100644 index cd21a4031..000000000 --- a/install/1_2_install/conda-recipes/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility temp # Python command to install the script. - diff --git a/install/1_2_install/conda-recipes/savu/meta.yaml b/install/1_2_install/conda-recipes/savu/meta.yaml deleted file mode 100644 index facd1e6ba..000000000 --- a/install/1_2_install/conda-recipes/savu/meta.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{% set version = "1.2" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/1_2_install/conda-recipes/savu_test/build.sh b/install/1_2_install/conda-recipes/savu_test/build.sh deleted file mode 100644 index cd21a4031..000000000 --- a/install/1_2_install/conda-recipes/savu_test/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility temp # Python command to install the script. - diff --git a/install/1_2_install/conda-recipes/savu_test/meta.yaml b/install/1_2_install/conda-recipes/savu_test/meta.yaml deleted file mode 100644 index 43cae5a63..000000000 --- a/install/1_2_install/conda-recipes/savu_test/meta.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/1_2_install/conda-recipes/xraylib/build.sh b/install/1_2_install/conda-recipes/xraylib/build.sh deleted file mode 100644 index 8f0acd316..000000000 --- a/install/1_2_install/conda-recipes/xraylib/build.sh +++ /dev/null @@ -1,7 +0,0 @@ - -./configure --enable-python --disable-perl --disable-java \ - --disable-fortran2003 --disable-lua --prefix=$PREFIX -make -make check -make install - diff --git a/install/1_2_install/conda-recipes/xraylib/meta.yaml b/install/1_2_install/conda-recipes/xraylib/meta.yaml deleted file mode 100644 index 78ceb3a71..000000000 --- a/install/1_2_install/conda-recipes/xraylib/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "3.2.0" %} - -package: - name: xraylib - version: {{ version }} - -source: - fn: xraylib-{{ version }}.tar.gz - url: https://xraylib.tomschoonjans.eu/xraylib-{{ version }}.tar.gz - sha256: a734a0ea7b8224918f4e2105a4cf6c63664f257c1940a4c633beedf470d1576b - -build: - number: 0 - -requirements: - build: - - python - - setuptools - - numpy - - scipy >=0.7.0 - - cython - - swig - - autoconf - - libtool - - automake - diff --git a/install/1_2_install/dls_installer.txt b/install/1_2_install/dls_installer.txt deleted file mode 100644 index 5a6d1a32b..000000000 --- a/install/1_2_install/dls_installer.txt +++ /dev/null @@ -1,55 +0,0 @@ -# Notes for installing Savu at Diamond -====================================== - -(1) Install Python Anaconda for Python 2.7 version (https://www.continuum.io/downloads). Then: - >> export PATH=/path/to/anaconda/bin:$PATH - -(2) >> conda install conda-build - -# These library versions have been tested but any versions can be tried. -(3) >> module load openmpi/1.6.5 # potentially any MPI library - >> module load cuda/7.0 - >> module load fftw - -(4)(a) To install a stable version of Savu: - # replace 1.2 with newest version - >> conda install -c savu savu=1.2 - (b) To install from the savu_test recipe (which installs from the master repository): - >> conda build savu_test - >> savubuild=`conda build savu_test --output` - >> conda install --use-local $savubuild - -================================================================================== -NB: Case of (4)(b): If changes are required to conda recipes and they have not -been pushed to the master repository then, before running step (5), do ->> export RECIPES=/path/to/folder/containing/recipes -================================================================================== - -(5) >> savu_installer.sh dls - -# Savu should now be installed! -# Test the installation. -(6) Copy the Savu module template at /dls/science/groups/das/savu/savu_module_template - to your local module folder (/home/username/privatemodules), changing the name if - you prefer, and update the relevant paths inside the file. Then - >> module load your_savu_module - -(7) Update launcher scripts, to module load your_savu_module. - (just type 'which savu_launcher.sh' to find the location). - (a) savu_launcher.sh and savu_mpijob.sh if you will run across the cluster - (b) savu_mpijob_local.sh if you will run locally in mpi mode. - -(8) From a fresh terminal: - >> source savu_setup.sh - - # single-threaded tests - >> savu_quick_tests - >> savu_full_tests - - # local mpi tests - >> mpi_cpu_local_test.sh - >> mpi_gpu_local_test.sh - - # cluster mpi tests - >> mpi_cpu_cluster_test.sh /path/to/output/folder - >> mpi_gpu_cluster_test.sh /path/to/output/folder diff --git a/install/1_2_install/dls_release_and_install.txt b/install/1_2_install/dls_release_and_install.txt deleted file mode 100644 index f178b5a22..000000000 --- a/install/1_2_install/dls_release_and_install.txt +++ /dev/null @@ -1,48 +0,0 @@ -# Notes for creating a new release and installing at Diamond - -new_env=$1 : environment is no longer required. -new_version=1.2 : version number is imported from version.py module - -# create module file for new Savu version with old Savu env -# amend launcher scripts to module load the new version -# update Savu version in setup.py -# update Savu version in conda recipe -# update other conda recipe versions - -module load savu/$new_version -source deactivate -conda create -n $new_env -source activate $new_env -conda install python=2.7 anaconda - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -recipes=$DIR/conda-recipes - -conda build $recipes/savu_test -savu_build=`conda build $recipes/savu_test --output` - -anaconda login -anaconda upload $savu_build --label test - -conda install -c savu/label/test savu -savu_installer.sh dls - -# update tomopy source code to not use multiprocessing - -savu_quick_tests -savu_full_tests -source savu_setup.sh -mpi_cpu_test.sh /dls/tmp/qmm55171 -mpi_gpu_test.sh /dls/tmp/qmm55171 - -# push changes to Git -# create new release on Github -# create conda build of Savu and upload to anaconda cloud -# remove savu test install and install new version of Savu into new conda env -# re-copy launcher scripts to /ana/path/bin -# re-run tests -# update module file to source new environment -# copy savu_launcher_preview.sh to conda_env/bin? -# update Savu default module load -# create a branch for the new release - diff --git a/install/1_2_install/find_launcher_scripts.sh b/install/1_2_install/find_launcher_scripts.sh deleted file mode 100644 index e5544dedd..000000000 --- a/install/1_2_install/find_launcher_scripts.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -facility=$1 - -# check anaconda distribution -ana_path=$(command -v anaconda) -if ! [ "$ana_path" ]; then - echo "ERROR: I require anaconda but I can't find it. Check /path/to/anaconda/bin is in your PATH." - return -else - ana_path=$(python -c "import sys; print sys.prefix") - echo "Using anaconda:" $ana_path -fi - -# get savu path through python import - -# if facility doesn't exist - # print a list of all the possible facilities - # return -# else -# output the path to the launcher scripts - diff --git a/install/1_2_install/install.txt b/install/1_2_install/install.txt deleted file mode 100644 index ee1398be7..000000000 --- a/install/1_2_install/install.txt +++ /dev/null @@ -1,31 +0,0 @@ -==================================================================================================== - -Requirements: -============= - -MPI: Required for framework. Savu has been tested against openMPI 1.6.5. Ensure /path/to/mpi_implementation/$version/$architecture/bin is in PATH and /path/to/mpi_implementation/$version/$architecture/lib is in LD_LIBRARY_PATH. -CUDA: Required for plugins (optional). Savu has been tested against cuda 7.0. Set cuda_path $env(softwaredir)/cuda/$version PATH $cuda_path/bin LD_LIBRARY_PATH $cuda_path/lib64 -FFTW: Required for plugins (optional). Savu has been tested against version 3.3.3. Ensure /path/to/fftw/$version/$architecture/5/lib is in LD_LIBRARY_PATH. - - -==================================================================================================== - -Installation instructions -========================= - -1. export FACILITY=YOUR_FACILITY_NAME (e.g dls). This is the name of the folder that will contain the scripts to launch your mpi jobs. - -1. A separate install of the Anaconda Python distribution is required for Savu. Download and install this from https://www.continuum.io/downloads and ensure /path/to/anaconda/bin is in your PATH. - -2. Install Savu - >> conda install -c savu savu=1.1 - -3. Create the mpi job launcher scripts in ... Savu requires exclusivity on a node. - -==================================================================================================== - -Test -==== - -*** Run a script to set a path for the test data $TESTDATA/data - diff --git a/install/1_2_install/install_notes_markdown b/install/1_2_install/install_notes_markdown deleted file mode 100644 index 9ab7de2ef..000000000 --- a/install/1_2_install/install_notes_markdown +++ /dev/null @@ -1,60 +0,0 @@ -### Requirements: - -(1) ANACONDA: -Required for framework. -A separate install of the Anaconda Python distribution is required for Savu. -Download and install this from https://www.continuum.io/downloads and ensure /path/to/anaconda/bin is in your PATH. - -(2) MPI: -Required for framework. -Savu has been tested against openMPI 1.6.5. -Ensure /path/to/mpi\_implementation/bin is in PATH and /path/to/mpi\_implementation/lib is in LD\_LIBRARY\_PATH. - -(3) CUDA: -Required for plugins (optional). -Savu has been tested against cuda 7.0. -Ensure /path/to/cuda/bin is in PATH and /path/to/cuda/lib64 is in LD\_LIBRARY\_PATH -If CUDA is not in your path, Savu GPU plugins will be unavailable. For example, astra-toolbox GPU algorithms will be available (and they are much faster!). - -(4) FFTW: -Required for plugins (optional). Savu has been tested against version 3.3.3. Ensure /path/to/fftw/lib is in LD\_LIBRARY\_PATH. -A number of plugins use pyfftw, which calls the fftw libraries. - - -==================================================================================================== - -### Installation instructions - -(1) `conda install -c savu savu=1.2` - -(2) `savu_installer.sh` - -(3) Update the template cluster submission scripts `savu_launcher.sh` and `savu_mpijob.sh`. - E.g. Type `which savu_launcher.sh` to get the path. - -==================================================================================================== - -### Test the installation - -(1) `savu_quick_tests` - -(2) `savu_full_tests` - -(3) `source savu_setup.sh` - -(4) `mpi_cpu_test.sh /path/to/output` - -(5) `mpi_gpu_test.sh /path/to/output` - -==================================================================================================== - -### Use Savu - -There are small test datasets and example process lists available with the Savu installation. Run `source savu_setup.sh` to set the $TESTDATA environment variable to point to the root test data directory. Example data is available in $TESTDATA/data, example process lists are available in $TESTDATA/test\_process\_lists and $TESTDATA/process\_lists. - -(1) Run Savu in serial mode on your PC. For example, - `savu $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/test.nxs /path/to/output` - -(2) Run Savu in parallel across a cluster. For example, - `savu_launcher.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/test.nxs /path/to/output` - diff --git a/install/1_2_install/local_mpi_cpu_test.sh b/install/1_2_install/local_mpi_cpu_test.sh deleted file mode 100644 index 9a70dd260..000000000 --- a/install/1_2_install/local_mpi_cpu_test.sh +++ /dev/null @@ -1,12 +0,0 @@ -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. savu_setup.sh - -echo "Running the mpi cpu test..." -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/1_2_install/local_mpi_gpu_test.sh b/install/1_2_install/local_mpi_gpu_test.sh deleted file mode 100644 index c560538a5..000000000 --- a/install/1_2_install/local_mpi_gpu_test.sh +++ /dev/null @@ -1,12 +0,0 @@ -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. savu_setup.sh - -echo "Running the mpi cpu test..." -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/1_2_install/mpi_cpu_test.sh b/install/1_2_install/mpi_cpu_test.sh deleted file mode 100644 index 55de02976..000000000 --- a/install/1_2_install/mpi_cpu_test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. savu_setup.sh - -echo "Running the mpi cpu test..." -savu_launcher.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/1_2_install/mpi_gpu_test.sh b/install/1_2_install/mpi_gpu_test.sh deleted file mode 100644 index f2d9c96dc..000000000 --- a/install/1_2_install/mpi_gpu_test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. savu_setup.sh - -echo "Running the mpi gpu test..." -savu_launcher.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/1_2_install/pip_install_package_list.txt b/install/1_2_install/pip_install_package_list.txt deleted file mode 100644 index 8a7b63b25..000000000 --- a/install/1_2_install/pip_install_package_list.txt +++ /dev/null @@ -1,8 +0,0 @@ -pyfftw -pyfai -lmfit -fabio -peakutils -nvidia-ml-py -pymca - diff --git a/install/1_2_install/savu_installer.sh b/install/1_2_install/savu_installer.sh deleted file mode 100644 index b603cdc11..000000000 --- a/install/1_2_install/savu_installer.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/bash -ex - -# error log to screen and file -error_log=/tmp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -facility=$1 -savu_env=$2 - -mpi4py_version=1.3.1 - -path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") -DIR=${path%/savu/__init__.pyc} - -if [[ ! -z "${RECIPES}" ]]; then - recipes=`echo $RECIPES` -else - recipes=$DIR'/install/conda-recipes' -fi - -launcher_path=`command -v savu_launcher.sh` -launcher_path=${launcher_path%/savu_launcher.sh} -if [ "$facility" ]; then - cp $DIR/mpi/$facility/savu_launcher.sh $launcher_path - cp $DIR/mpi/$facility/savu_mpijob.sh $launcher_path -fi - -#=========================library checking============================== - -echo -e "\n=============================================================" - -# set compiler wrapper -mpicc=$(command -v mpicc) -if ! [ "$mpicc" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $mpicc -fi - -# check anaconda distribution -ana_path=$(command -v anaconda) -if ! [ "$ana_path" ]; then - echo "ERROR: I require anaconda but I can't find it. Check /path/to/anaconda/bin is in your PATH." - exit 1 -else - ana_path=$(python -c "import sys; print sys.prefix") - echo "Using anaconda:" $ana_path -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - fftwdir=${file_path%/lib/libfftw?.so} - CFLAGS="$fftwdir/include" - LDFLAGS="$fftwdir/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $fftwdir -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} -if [ "$cuda" ]; then - echo "Using cuda: " $cuda -else - echo "cuda has not been found." -fi - -echo -e "=============================================================\n" - -read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input -if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" -elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 1 -else - echo -e "\nYour input was unknown.\n" - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input -fi -#=====================installing other packages========================== - -echo "Uninstalling packages..." -conda remove mpi4py -conda remove h5py -conda remove hdf5 -pip uninstall mpi4py astra-toolbox xraylib -pip uninstall -r $package_list - -echo "Installing mpi4py..." -env MPICC=$mpicc pip install mpi4py==$mpi4py_version - -echo "Building hdf5..." -conda build $recipes/hdf5 -hdf5build=`conda build $recipes/hdf5 --output` - -echo "Installing hdf5..." -conda install --use-local $hdf5build - -echo "Building h5py..." -conda build $recipes/h5py --no-test -h5pybuild=`conda build $recipes/h5py --output` - -echo "Installing h5py..." -conda install --use-local $h5pybuild - -echo "Building astra toolbox..." -conda build $recipes/astra -astrabuild=`conda build $recipes/astra --output` - -echo "Installing astra toolbox..." -conda install --use-local $astrabuild - -site_path=$(python -c "import site; print site.getsitepackages()[0]") -cp $recipes/astra/astra.pth $site_path -astra_lib_path=$site_path/astra/lib - -echo "Building xraylib..." -conda build $recipes/xraylib -xraylibbuild=`conda build $recipes/xraylib --output` - -echo "Installing xraylib..." -conda install --use-local $xraylibbuild - -echo "Installing tomopy..." -conda install -c dgursoy tomopy -# revert back to MPI versions of HDF5 and h5py -conda install --use-local $hdf5build -conda install --use-local $h5pybuild - -package_list=$recipes'/../pip_install_package_list.txt' -echo "Installing extra packages through pip..." -pip install -r $package_list - -echo -echo "*********************************" -echo "* package installation complete *" -echo "*********************************" -echo -echo "Check the log file $error_log for any installation errors\n". -echo -e "\nNow please add $astra_lib_path to LD_LIBRARY_PATH\n" - diff --git a/install/1_2_install/savu_setup.sh b/install/1_2_install/savu_setup.sh deleted file mode 100644 index 90a35b203..000000000 --- a/install/1_2_install/savu_setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -savu_path=$(python -c "import savu; import os; print os.path.abspath(os.path.dirname(savu.__file__))") -test_path=$savu_path'/../test_data' -export TESTDATA=$test_path -echo '$TESTDATA points to the Savu test data folder at' $TESTDATA - diff --git a/install/1_2_install/savu_setup_files/bash_scripts/1.2 b/install/1_2_install/savu_setup_files/bash_scripts/1.2 deleted file mode 100755 index 610c19986..000000000 --- a/install/1_2_install/savu_setup_files/bash_scripts/1.2 +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash - -savu_version=1.2 -conda_env=savu_v1.2 -redhatrelease=[eval exec "cat /etc/redhat-release"] -mach=$tcl_platform(machine) -pymajorversion=2.7 -ana_version=4.2.13 -openmpi_version=1.6.5 -cuda_version=7.0 -fftw_version=3.3.3 -PROMPT={[\u@\h \W]\$ } -astra_lib=lib/python2.7/site-packages/astra/lib - -echo "Setting up Savu version $savu_version" - -# set cluster related paths -module load global/cluster - - - - -if { [module-info mode load] } { - puts stderr "\tLoading $arch-bit Anaconda Python, version $ana_version" - - # load the default directories - if { ! [is-loaded global/directories] } { - module load global/directories - } - - - - # load FFTW shared libraries - if { ! [is-loaded fftw/$fftw_version] } { - if { [is-loaded fftw] } { - module unload fftw - } - module load fftw/$fftw_version - } - - # load CUDA shared libraries - if { ! [is-loaded cuda/$cuda_version] } { - if { [is-loaded cuda] } { - module unload cuda - } - module load cuda/$cuda_version - } - - # load openmpi shared libraries - if { ! [is-loaded openmpi/$openmpi_version] } { - if { [is-loaded openmpi] } { - module unload openmpi - } - module load openmpi/$openmpi_version - } - - # load the default directories - if { ! [is-loaded global/directories] } { - module load global/directories - } -} else { - puts stderr "Unloading $arch-bit Anaconda Python, version $ana_version" - puts stdout "source deactivate;" - - # unload default directories - if { [is-loaded global/directories] } { - module unload global/directories - } - - # unload FFTW shared libraries - if { [is-loaded fftw/$fftw_version] } { - module unload fftw/$fftw_version - } - - # unload CUDA shared libraries - if { [is-loaded cuda/$cuda_version] } { - module unload cuda/$cuda_version - } - - # unload openmpi shared libraries - if { [is-loaded openmpi/$openmpi_version] } { - module unload openmpi/$openmpi_version - } - unsetenv CONDA_DEFAULT_ENV - unsetenv CONDA_PREFIX - unsetenv CONDA_PS1_BACKUP - unsetenv PS1 $PROMPT -} - -set PYTHON_HOME $env(softwaredir)/savu/anaconda/envs/$conda_env -setenv pythonmajorversion $pymajorversion -prepend-path PATH $PYTHON_HOME/bin -setenv PYTHONNOUSERSITE True -puts stdout "source $PYTHON_HOME/bin/activate $conda_env;" -setenv CONDA_PATH_BACKUP $env(PATH) -prepend-path PATH $PYTHON_HOME/bin -prepend-path LD_LIBRARY_PATH $PYTHON_HOME/$astra_lib - -module add fastxrf -#module add ptypy - -if { [info exists env(SAVUHOME)] } { - puts stderr "\n\tSAVUHOME is set to $env(SAVUHOME)\n" - prepend-path PATH $env(SAVUHOME) - prepend-path PYTHONPATH $env(SAVUHOME) - set-alias "savu_mpi_dev" "$env(SAVUHOME)/mpi/dls/savu_launcher_dev.sh" - set-alias "savu_mpi" "savu_launcher.sh" - set-alias "savu_config" "python $env(SAVUHOME)/scripts/config_generator/savu_config.py" - set-alias "savu" "python $env(SAVUHOME)/savu/tomo_recon.py" -} else { - set-alias "savu_mpi" "savu_launcher.sh" - set-alias "savu_mpi_preview" "savu_launcher_preview.sh" - set-alias "savu" "savu -s cs04r-sc-serv-14" -} - diff --git a/install/1_2_install/savu_setup_files/module_files/1.2 b/install/1_2_install/savu_setup_files/module_files/1.2 deleted file mode 100644 index ec9f68445..000000000 --- a/install/1_2_install/savu_setup_files/module_files/1.2 +++ /dev/null @@ -1,137 +0,0 @@ -#%Module1.0##################################################################### -## -## Savu modulefile -## -proc ModulesHelp { } { - global version - - puts stderr "\tLoads version $version of Savu" - puts stderr "\n\tSavu is a pipeline for running tomography " - puts stderr "\treconstruction routines on the cluster at diamond " -} - -module-whatis "loads Savu developer version" - -set version 1.2 -set conda_env savu_test_env3 -set redhatrelease [eval exec "cat /etc/redhat-release"] -set mach $tcl_platform(machine) -set pymajorversion 2.7 -set version 4.2.12 -set openmpi_version 1.6.5 -set cuda_version 7.0 -set fftw_version 3.3.3 -set PROMPT {[\u@\h \W]\$ } - -module load global/cluster - -set mach $tcl_platform(machine) -if { [string compare $mach "x86_64"] != 0} { - puts stderr "Cannot load/unload: this is for 64-bit machines only!" - return 1 -} -set arch 64 - - -if { [module-info mode load] } { - puts stderr "\tLoading $arch-bit Anaconda Python, version $version" - - # load the default directories - if { ! [is-loaded global/directories] } { - module load global/directories - } - - # check to see if python is already loaded - if { [is-loaded python] } { - if { [is-loaded savu/dev] } { - puts stderr "\tAlready loaded!" - exit 0 - } - if { [is-loaded scipy] } { - puts stderr "\tUnloading scipy" - module unload scipy - } - if { [is-loaded numpy] } { - puts stderr "\tUnloading numpy" - module unload numpy - } - puts stderr "\tUnloading python" - module unload python - } - - # load FFTW shared libraries - if { ! [is-loaded fftw/$fftw_version] } { - if { [is-loaded fftw] } { - module unload fftw - } - module load fftw/$fftw_version - } - - # load CUDA shared libraries - if { ! [is-loaded cuda/$cuda_version] } { - if { [is-loaded cuda] } { - module unload cuda - } - module load cuda/$cuda_version - } - - # load openmpi shared libraries - if { ! [is-loaded openmpi/$openmpi_version] } { - if { [is-loaded openmpi] } { - module unload openmpi - } - module load openmpi/$openmpi_version - } - - # load the default directories - if { ! [is-loaded global/directories] } { - module load global/directories - } -} else { - puts stderr "Unloading $arch-bit Anaconda Python, version $version" - puts stdout "source deactivate;" - - # unload default directories - if { [is-loaded global/directories] } { - module unload global/directories - } - - # unload FFTW shared libraries - if { [is-loaded fftw/$fftw_version] } { - module unload fftw/$fftw_version - } - - # unload CUDA shared libraries - if { [is-loaded cuda/$cuda_version] } { - module unload cuda/$cuda_version - } - - # unload openmpi shared libraries - if { [is-loaded openmpi/$openmpi_version] } { - module unload openmpi/$openmpi_version - } - unsetenv CONDA_DEFAULT_ENV - unsetenv CONDA_PREFIX - unsetenv CONDA_PS1_BACKUP - unsetenv PS1 $PROMPT -} - -set PYTHON_HOME $env(softwaredir)/savu/anaconda -setenv pythonmajorversion $pymajorversion -prepend-path PATH $PYTHON_HOME/bin -setenv PYTHONNOUSERSITE True -puts stdout "source $PYTHON_HOME/bin/activate $conda_env;" -setenv CONDA_PATH_BACKUP $env(PATH) -prepend-path PATH $PYTHON_HOME/envs/$conda_env/bin - -if { [info exists env(SAVUHOME)] } { - puts stderr "\n\tSAVUHOME is set to $env(SAVUHOME)\n" - prepend-path PATH $env(SAVUHOME) - prepend-path PYTHONPATH $env(SAVUHOME) - set-alias "savu_mpi_dev" "$env(SAVUHOME)/mpi/dls/savu_launcher_dev.sh" - set-alias "savu_mpi" "savu_launcher.sh" -} else { - set-alias "savu_mpi" "savu_launcher.sh -s cs04r-sc-serv-14" - set-alias "savu" "savu -s cs04r-sc-serv-14" -} - diff --git a/install/2_0_install/conda-recipes/astra/astra.pth b/install/2_0_install/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/2_0_install/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/2_0_install/conda-recipes/astra/build.sh b/install/2_0_install/conda-recipes/astra/build.sh deleted file mode 100644 index b9eb6a09a..000000000 --- a/install/2_0_install/conda-recipes/astra/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -ana_path=`command -v savu` -prefix=${ana_path%/bin/savu}/lib/python2.7/site-packages/astra - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/2_0_install/conda-recipes/astra/meta.yaml b/install/2_0_install/conda-recipes/astra/meta.yaml deleted file mode 100644 index 57b1ba261..000000000 --- a/install/2_0_install/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.8" %} - -package: - name: astra-toolbox - version: 1.8 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: e4dfb782cf2e547264947dd89f8c280b3aa63b7f40010abe6270949577b573d3 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/2_0_install/conda-recipes/h5py/build.sh b/install/2_0_install/conda-recipes/h5py/build.sh deleted file mode 100644 index 4034f7672..000000000 --- a/install/2_0_install/conda-recipes/h5py/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` - -# set anaconda distribution -ana_path=$(command -v savu) -ana_path=${ana_path%/bin/savu} -hdf5_version=1.10.0 -hdf5_build_no=100 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --hdf5=$ana_path -$PYTHON setup.py configure --hdf5-version=$hdf5_version -$PYTHON setup.py configure --mpi -$PYTHON setup.py build -$PYTHON setup.py install - diff --git a/install/2_0_install/conda-recipes/h5py/meta.yaml b/install/2_0_install/conda-recipes/h5py/meta.yaml deleted file mode 100644 index f3d1d1802..000000000 --- a/install/2_0_install/conda-recipes/h5py/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "2.7.0" %} # change this - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz -requirements: - build: - - python - - numpy - - hdf5 - - cython - - pkgconfig - - six - -build: - number: 100 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) - diff --git a/install/2_0_install/conda-recipes/hdf5/build.sh b/install/2_0_install/conda-recipes/hdf5/build.sh deleted file mode 100644 index add607820..000000000 --- a/install/2_0_install/conda-recipes/hdf5/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH - -# check anaconda distribution -ana_path=$(command -v savu) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples - diff --git a/install/2_0_install/conda-recipes/hdf5/meta.yaml b/install/2_0_install/conda-recipes/hdf5/meta.yaml deleted file mode 100644 index d5e8ff2f5..000000000 --- a/install/2_0_install/conda-recipes/hdf5/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "1.10.0" %} -{% set release = "hdf5-1.10" %} -{% set patch = "hdf5-1.10.0-patch1" %} -#{% set filename = "hdf5-1.8.15" %} # change this - -package: - name: hdf5 - version: {{ version }} - -source: - fn: {{ patch }}.tar.bz2 - #fn: hdf5-{{ version }}.tar.bz2 - #url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ filename }}-patch1/src/{{ filename }}-patch1.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ release }}/{{ patch }}/src/{{ patch }}.tar.bz2 - #md5: b060bb137d6bd8accf8f0c4c59d2746d - -build: - number: 100 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) - diff --git a/install/2_0_install/conda-recipes/mpi4py/version.txt b/install/2_0_install/conda-recipes/mpi4py/version.txt deleted file mode 100644 index 1527a8de2..000000000 --- a/install/2_0_install/conda-recipes/mpi4py/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -1.3.1 - diff --git a/install/2_0_install/conda-recipes/xraylib/build.sh b/install/2_0_install/conda-recipes/xraylib/build.sh deleted file mode 100644 index 8f0acd316..000000000 --- a/install/2_0_install/conda-recipes/xraylib/build.sh +++ /dev/null @@ -1,7 +0,0 @@ - -./configure --enable-python --disable-perl --disable-java \ - --disable-fortran2003 --disable-lua --prefix=$PREFIX -make -make check -make install - diff --git a/install/2_0_install/conda-recipes/xraylib/meta.yaml b/install/2_0_install/conda-recipes/xraylib/meta.yaml deleted file mode 100644 index 78ceb3a71..000000000 --- a/install/2_0_install/conda-recipes/xraylib/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "3.2.0" %} - -package: - name: xraylib - version: {{ version }} - -source: - fn: xraylib-{{ version }}.tar.gz - url: https://xraylib.tomschoonjans.eu/xraylib-{{ version }}.tar.gz - sha256: a734a0ea7b8224918f4e2105a4cf6c63664f257c1940a4c633beedf470d1576b - -build: - number: 0 - -requirements: - build: - - python - - setuptools - - numpy - - scipy >=0.7.0 - - cython - - swig - - autoconf - - libtool - - automake - diff --git a/install/2_0_install/savu_v2.0.tar.gz b/install/2_0_install/savu_v2.0.tar.gz deleted file mode 100644 index 6755b3be6..000000000 Binary files a/install/2_0_install/savu_v2.0.tar.gz and /dev/null differ diff --git a/install/2_0_install/savu_v2.0/environment.yml b/install/2_0_install/savu_v2.0/environment.yml deleted file mode 100644 index 10219ebaa..000000000 --- a/install/2_0_install/savu_v2.0/environment.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: root -channels: -- defaults -dependencies: -- conda-build -- numpy -- scipy -- colorama -- cython -- ipython -- jinja2 -- mock -- pandas -- pep8 -- pillow -- pip -- pyqt -- scikit-image -- scikit-learn -- setuptools -- sphinx -- spyder -- sympy -- wheel -- pywavelets -- pytest -- pip: - - pyreadline - - appdirs - - bleach - - fabio - - lmfit - - mako - - nvidia-ml-py - - peakutils - - prompt-toolkit - - pyfftw - - pyfai - - pymca - - pymca5 - - pytools - - restview - - simpleitk - - sphinx-rtd-theme - - webencodings -prefix: /dls_sw/apps/savu/savu_1.2_openmpi_2.0.1_anaconda/anaconda - diff --git a/install/2_0_install/savu_v2.0/savu_installer.sh b/install/2_0_install/savu_v2.0/savu_installer.sh deleted file mode 100644 index 76dfd5186..000000000 --- a/install/2_0_install/savu_v2.0/savu_installer.sh +++ /dev/null @@ -1,334 +0,0 @@ -#!/bin/bash -ex - -# error log to screen and file -error_log=/tmp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX=$HOME -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 3 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -echo -e "\n=============================================================" -echo -e " ......Thank you for running the Savu installer......\n" - -echo -e "Performing a library check..." -echo -e "\nNB: An MPI implementation is required to build Savu." -echo -e "fftw and cuda are desirable for a full range of plugins." - -echo -e "\n=============================================================" - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -echo -e "=============================================================\n" - -read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input -if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" -elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 1 -else - echo -e "\nYour input was unknown.\n" - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input -fi -#=====================installing other packages========================== - - -echo -e "\nInstalling Savu in" $PREFIX -read -p ">>> Press ENTER to continue or input a different path: " input - -if [ "$input" != "" ]; then - PREFIX=$input -fi - -while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input -done - -if [ -d "$PREFIX" ]; then - echo - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 1 - else - echo -e "\nYour input was unknown.\n\n" - read -n 1 -p -e "The folder" $PREFIX "already exists. Continue? [y/n]" input - fi -else - # create the folder - mkdir -p $PREFIX -fi - -echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - -echo $PREFIX - -wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $PREFIX/miniconda.sh; -bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda -PYTHONHOME=$PREFIX/miniconda/bin -export PATH="$PYTHONHOME:$PATH" - -echo -conda info | grep 'root environment' -echo - -conda env update -n root -f $DIR/environment.yml - -echo "Building Savu..." -conda build $DIR/$savu_recipe -savubuild=`conda build $DIR/$savu_recipe --output` -echo "Installing Savu..." -conda install --use-local $savubuild - -path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") -savu_path=${path%/savu/__init__.pyc} - -# get the savu version -install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") -recipes=$savu_path/$install_path/conda-recipes - -launcher_path=`command -v savu_launcher.sh` -launcher_path=${launcher_path%/savu_launcher.sh} -if [ "$facility" ]; then - cp $savu_path/mpi/$facility/savu_launcher.sh $launcher_path - cp $savu_path/mpi/$facility/savu_mpijob.sh $launcher_path -fi - -mpi4py_version=`cat $recipes/mpi4py/version.txt` -mpi4py_version=1.3.1 - -echo $mpi4py_version - -echo "Installing mpi4py..." -env MPICC=$MPICC pip install mpi4py==$mpi4py_version - -echo "Building hdf5..." -conda build $recipes/hdf5 -hdf5build=`conda build $recipes/hdf5 --output` - -echo "Installing hdf5..." -conda install --use-local $hdf5build - -echo "Building h5py..." -conda build $recipes/h5py --no-test -h5pybuild=`conda build $recipes/h5py --output` - -echo "Installing h5py..." -conda install --use-local $h5pybuild - -echo "Building astra toolbox..." -conda build $recipes/astra -astrabuild=`conda build $recipes/astra --output` - -echo "Installing astra toolbox..." -conda install --use-local $astrabuild - -site_path=$(python -c "import site; print site.getsitepackages()[0]") -cp $recipes/astra/astra.pth $site_path -astra_lib_path=$site_path/astra/lib - - -echo "Building xraylib..." -conda build $recipes/xraylib -xraylibbuild=`conda build $recipes/xraylib --output` - -echo "Installing xraylib..." -conda install --use-local $xraylibbuild - -echo "Installing tomopy..." -conda install -c dgursoy tomopy - -echo "Installing pyfai..." -pip install pyfai - -# revert back to newer version of numpy -conda install numpy=1.13.0 - -echo "Installing ccpi-reconstruction..." -conda install -c ccpi ccpi-reconstruction -c conda-forge - -# revert back to MPI versions of HDF5 and h5py -conda install --use-local $hdf5build -conda install --use-local $h5pybuild - -# pycuda not working add this later? -#if [ "$CUDAHOME" ] ; then -# pip install pycuda -#fi - -# update to pyqt5? - -echo -e "\n\t***************************************************" -echo -e "\t* Package installation complete *" -echo -e "\t* Check $error_log for errors *" -echo -e "\t***************************************************\n" - -# automatically run the tests -source test_setup.sh > /dev/null # not available yet - -setup_script=$PREFIX'savu_setup.sh' -echo -e "\nCreating a Savu setup script" $setup_script -( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 -MPIHOME="$(dirname "$(dirname $MPICC)")" -echo "#!bin/bash" > $setup_script -echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script -echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script -echo ""export PYTHONUSERSITE True"" >> $setup_script -echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script -echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script -echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script -if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script -fi -if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script -fi - -echo $(python -c "import savu; savu.__file__") -nGPUs=$(python -c "import savu.core.utils as cu; p, count = cu.get_available_gpus(); print count") - -source $setup_script - -echo -e "\n***** Testing Savu setup *****\n" -savu_quick_tests - -echo -e "\n*****Running Savu single-threaded local tests *****\n" -savu_full_tests - -echo -e "\n************** Single-threaded local tests complete ******************\n" - -echo -e "\n***** Running Savu MPI local CPU tests *****\n" -local_mpi_cpu_test.sh - -if [ $nGPUs -gt 0 ]; then - echo -e "\n***** Running Savu MPI local GPU tests *****\n" - local_mpi_gpu_test.sh -else - echo -e "\n***** Skipping Savu MPI local GPU tests (no GPUs found) *****\n" -fi - -echo -e "\n************** MPI local tests complete ******************\n" - -exit 1 - -#while true -#do -# read -n 1 -p "Are you installing Savu for cluster use? (y/n): " input -# if [ "$input" = "y" ]; then -# echo -e "To run Savu across a cluster you will need to update the savu laucher scripts:" -# echo -e "savu_launcher.sh" -# echo -e "savu_mpijob.sh" -# break -# elif [ "$input" = "n" ]; then -# echo -e "\nYour input was unknown.\n" -# continue -# fi -#done - - -# what about an example module file? OR source savu_setup instead (adding the paths from savu_setup). -echo -e "\nTo run Savu type 'source $savu_setup' to set relevant paths every time you open a new terminal." -echo -e "Alternatively, if you are using the Modules system, see $DIR/module_template for an example module file." - -echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" -echo -e " ......Thank you for running the Savu installer......\n" -echo -e "=============================================================\n" - -# have a look at .... for the list of instructions above. (inside the downloaded folder). -# Create a README.txt inside Savu/install/savu_install/README.txt - diff --git a/install/2_0_install/savu_v2.0/savu_setup.sh b/install/2_0_install/savu_v2.0/savu_setup.sh deleted file mode 100644 index f38615065..000000000 --- a/install/2_0_install/savu_v2.0/savu_setup.sh +++ /dev/null @@ -1,10 +0,0 @@ -export PATH=./bin:$PATH -export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH -export PYTHONUSERSITE True -export PATH=/dls_sw/apps/savu/nics_test_install/Savu_1.2//miniconda/bin/bin:$PATH -export LD_LIBRARY_PATH=/dls_sw/apps/savu/nics_test_install/Savu_1.2//miniconda/bin/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/dls_sw/apps/savu/nics_test_install/Savu_1.2//miniconda/lib/python2.7/site-packages/astra/lib:$LD_LIBRARY_PATH -export PATH=/dls_sw/apps/cuda/bin:$PATH -export LD_LIBRARY_PATH=/dls_sw/apps/cuda/lib:$LD_LIBRARY_PATH -export FFTWDIR=/dls_sw/apps/fftw/3.3.3/64/5 -export LD_LIBRARY_PATH=/dls_sw/apps/fftw/3.3.3/64/5/lib:$LD_LIBRARY_PATH diff --git a/install/2_0_install/savu_v2.0/version.txt b/install/2_0_install/savu_v2.0/version.txt deleted file mode 100644 index 0d71c0841..000000000 --- a/install/2_0_install/savu_v2.0/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.0 - diff --git a/install/2_0_install/tests/local_mpi_cpu_test.sh b/install/2_0_install/tests/local_mpi_cpu_test.sh deleted file mode 100644 index bd24e05d0..000000000 --- a/install/2_0_install/tests/local_mpi_cpu_test.sh +++ /dev/null @@ -1,12 +0,0 @@ -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/2_0_install/tests/local_mpi_gpu_test.sh b/install/2_0_install/tests/local_mpi_gpu_test.sh deleted file mode 100644 index 93be250dc..000000000 --- a/install/2_0_install/tests/local_mpi_gpu_test.sh +++ /dev/null @@ -1,12 +0,0 @@ -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/2_0_install/tests/mpi_cpu_test.sh b/install/2_0_install/tests/mpi_cpu_test.sh deleted file mode 100644 index 953c07d45..000000000 --- a/install/2_0_install/tests/mpi_cpu_test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." -savu_launcher.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/2_0_install/tests/mpi_gpu_test.sh b/install/2_0_install/tests/mpi_gpu_test.sh deleted file mode 100644 index a6e3386fb..000000000 --- a/install/2_0_install/tests/mpi_gpu_test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." -savu_launcher.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/2_1_install/conda-recipes/__init__.py b/install/2_1_install/conda-recipes/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/2_1_install/conda-recipes/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/2_1_install/conda-recipes/astra.tar.gz b/install/2_1_install/conda-recipes/astra.tar.gz deleted file mode 100644 index 4b1cb984d..000000000 Binary files a/install/2_1_install/conda-recipes/astra.tar.gz and /dev/null differ diff --git a/install/2_1_install/conda-recipes/astra/astra.pth b/install/2_1_install/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/2_1_install/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/2_1_install/conda-recipes/astra/build.sh b/install/2_1_install/conda-recipes/astra/build.sh deleted file mode 100644 index acd72a6d6..000000000 --- a/install/2_1_install/conda-recipes/astra/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -savu_path=`command -v savu` -ana_path=${savu_path%/savu} -prefix=${ana_path%/bin}/lib/python2.7/site-packages/astra -export PATH=$ana_path:$PATH - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/2_1_install/conda-recipes/astra/meta.yaml b/install/2_1_install/conda-recipes/astra/meta.yaml deleted file mode 100644 index 4a04c0bc4..000000000 --- a/install/2_1_install/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.8" %} - -package: - name: astra-toolbox - version: 1.8 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: 44602e0eb0789a557622eae959fc0a067d81396bcb79ec315cb39b59d52322e7 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/2_1_install/conda-recipes/h5py/build.sh b/install/2_1_install/conda-recipes/h5py/build.sh deleted file mode 100644 index 055293a33..000000000 --- a/install/2_1_install/conda-recipes/h5py/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` - -# set anaconda distribution -ana_path=$(command -v savu) -ana_path=${ana_path%/bin/savu} -hdf5_version=1.10.1 -hdf5_build_no=1 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --hdf5=$ana_path -$PYTHON setup.py configure --hdf5-version=$hdf5_version -$PYTHON setup.py configure --mpi -$PYTHON setup.py build -$PYTHON setup.py install - diff --git a/install/2_1_install/conda-recipes/hdf5/build.sh b/install/2_1_install/conda-recipes/hdf5/build.sh deleted file mode 100644 index add607820..000000000 --- a/install/2_1_install/conda-recipes/hdf5/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH - -# check anaconda distribution -ana_path=$(command -v savu) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples - diff --git a/install/2_1_install/conda-recipes/hdf5/meta.yaml b/install/2_1_install/conda-recipes/hdf5/meta.yaml deleted file mode 100644 index a12ea27a8..000000000 --- a/install/2_1_install/conda-recipes/hdf5/meta.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{% set version = "1.10.1" %} -{% set release = "hdf5-1.10" %} -{% set patch = "hdf5-1.10.1" %} - -package: - name: hdf5 - version: {{ version }} - -source: - fn: {{ patch }}.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ release }}/{{ patch }}/src/{{ patch }}.tar.bz2 - md5: d89893c05ee7ea8611b51bb39450d64e - -build: - number: 1 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) - diff --git a/install/2_1_install/conda-recipes/mpi4py/version.txt b/install/2_1_install/conda-recipes/mpi4py/version.txt deleted file mode 100644 index 6e1f4db18..000000000 --- a/install/2_1_install/conda-recipes/mpi4py/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.0.0 - diff --git a/install/2_1_install/conda-recipes/xdesign/build.sh b/install/2_1_install/conda-recipes/xdesign/build.sh deleted file mode 100644 index b161f631b..000000000 --- a/install/2_1_install/conda-recipes/xdesign/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install - diff --git a/install/2_1_install/conda-recipes/xdesign/meta.yaml b/install/2_1_install/conda-recipes/xdesign/meta.yaml deleted file mode 100644 index 68693b427..000000000 --- a/install/2_1_install/conda-recipes/xdesign/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -package: - name: xdesign - version: '0.3.0' - -source: - git_url: https://github.com/tomography/xdesign.git - -build: - number: 0 - -requirements: - build: - - python - - setuptools - -about: - home: http://xdesign.readthedocs.io - license: BSD-3 - summary: 'Benchmarking and optimization tools for tomography.' - -# See -# http://docs.continuum.io/conda/build.html for -# more information about meta.yaml - diff --git a/install/2_1_install/conda-recipes/xraylib/build.sh b/install/2_1_install/conda-recipes/xraylib/build.sh deleted file mode 100644 index 8f0acd316..000000000 --- a/install/2_1_install/conda-recipes/xraylib/build.sh +++ /dev/null @@ -1,7 +0,0 @@ - -./configure --enable-python --disable-perl --disable-java \ - --disable-fortran2003 --disable-lua --prefix=$PREFIX -make -make check -make install - diff --git a/install/2_1_install/conda-recipes/xraylib/meta.yaml b/install/2_1_install/conda-recipes/xraylib/meta.yaml deleted file mode 100644 index f924056e2..000000000 --- a/install/2_1_install/conda-recipes/xraylib/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "3.3.0" %} - -package: - name: xraylib - version: {{ version }} - -source: - fn: xraylib-{{ version }}.tar.gz - url: https://xraylib.tomschoonjans.eu/xraylib-{{ version }}.tar.gz - sha256: a22a73b8d90eb752b034bab1a4cf6abdd81b8c7dc5020bcb22132d2ee7aacd42 - -build: - number: 0 - -requirements: - build: - - python - - setuptools - - numpy - - scipy >=0.7.0 - - cython - - swig - - autoconf - - libtool - - automake - diff --git a/install/2_1_install/savu_v2.1.1.tar.gz b/install/2_1_install/savu_v2.1.1.tar.gz deleted file mode 100644 index 6a553106a..000000000 Binary files a/install/2_1_install/savu_v2.1.1.tar.gz and /dev/null differ diff --git a/install/2_1_install/savu_v2.1.1/environment.yml b/install/2_1_install/savu_v2.1.1/environment.yml deleted file mode 100644 index 9aa3bcf15..000000000 --- a/install/2_1_install/savu_v2.1.1/environment.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: root -channels: -- ccpi -- local -- dgursoy -- conda-forge -- defaults -dependencies: -- boost-cpp=1.64.0=0 -- ccpi-reconstruction=0.1=py27_0 -- boost=1.64.0=np113py27_2 -- bzip2=1.0.6=1 -- cairo=1.14.6=4 -- fontconfig=2.12.1=4 -- freetype=2.7=1 -- gettext=0.19.7=1 -- glib=2.51.4=0 -- icu=58.1=1 -- libnetcdf=4.4.1.1=5 -- libpng=1.6.28=0 -- matplotlib=2.0.2=np113py27_0 -- netcdf4=1.2.9=np113py27_0 -- pillow=4.1.1=py27_0 -- qt=5.6.2=3 -- alabaster=0.7.10=py27_0 -- asn1crypto=0.22.0=py27_0 -- astroid=1.4.9=py27_0 -- babel=2.4.0=py27_0 -- backports=1.0=py27_0 -- backports_abc=0.5=py27_0 -- beautifulsoup4=4.6.0=py27_0 -- bleach=1.5.0=py27_0 -- cffi=1.10.0=py27_0 -- chardet=3.0.4=py27_0 -- colorama=0.3.9=py27_0 -- conda=4.3.22=py27_0 -- conda-build=3.0.6=py27_0 -- conda-env=2.6.0=0 -- conda-verify=2.0.0=py27_0 -- configparser=3.5.0=py27_0 -- contextlib2=0.5.5=py27_0 -- cryptography=1.8.1=py27_0 -- curl=7.49.0=1 -- cycler=0.10.0=py27_0 -- cython=0.25.2=py27_0 -- dbus=1.10.10=0 -- decorator=4.0.11=py27_0 -- docutils=0.13.1=py27_0 -- entrypoints=0.2.2=py27_1 -- enum34=1.1.6=py27_0 -- expat=2.1.0=0 -- filelock=2.0.7=py27_0 -- funcsigs=1.0.2=py27_0 -- functools32=3.2.3.2=py27_0 -- futures=3.1.1=py27_0 -- get_terminal_size=1.0.0=py27_0 -- glob2=0.5=py27_0 -- gst-plugins-base=1.8.0=0 -- gstreamer=1.8.0=0 -- hdf4=4.2.12=1 -- html5lib=0.999=py27_0 -- idna=2.5=py27_0 -- imagesize=0.7.1=py27_0 -- ipaddress=1.0.18=py27_0 -- ipykernel=4.6.1=py27_0 -- ipython=5.3.0=py27_0 -- ipython_genutils=0.2.0=py27_0 -- isort=4.2.14=py27_0 -- jbig=2.1=0 -- jedi=0.10.2=py27_2 -- jinja2=2.9.6=py27_0 -- jpeg=9b=0 -- jsonschema=2.6.0=py27_0 -- jupyter_client=5.0.1=py27_0 -- jupyter_core=4.3.0=py27_0 -- lazy-object-proxy=1.2.2=py27_0 -- libffi=3.2.1=1 -- libgcc=5.2.0=0 -- libgfortran=3.0.0=1 -- libiconv=1.14=0 -- libsodium=1.0.10=0 -- libtiff=4.0.6=3 -- libxcb=1.12=1 -- libxml2=2.9.4=0 -- markupsafe=0.23=py27_2 -- mistune=0.7.4=py27_0 -- mkl=2017.0.1=0 -- mock=2.0.0=py27_0 -- mpmath=0.19=py27_1 -- nbconvert=5.2.1=py27_0 -- nbformat=4.3.0=py27_0 -- networkx=1.11=py27_0 -- numexpr=2.6.2=np113py27_0 -- numpy=1.13.0=py27_0 -- numpydoc=0.6.0=py27_0 -- olefile=0.44=py27_0 -- openssl=1.0.2l=0 -- packaging=16.8=py27_0 -- pandas=0.20.2=np113py27_0 -- pandocfilters=1.4.1=py27_0 -- patchelf=0.9=0 -- path.py=10.3.1=py27_0 -- pathlib2=2.2.1=py27_0 -- pbr=1.10.0=py27_0 -- pcre=8.39=1 -- pep8=1.7.0=py27_0 -- pexpect=4.2.1=py27_0 -- pickleshare=0.7.4=py27_0 -- pip=9.0.1=py27_1 -- pixman=0.34.0=0 -- pkginfo=1.4.1=py27_0 -- prompt_toolkit=1.0.14=py27_0 -- psutil=5.2.2=py27_0 -- ptyprocess=0.5.1=py27_0 -- py=1.4.34=py27_0 -- pycairo=1.10.0=py27_0 -- pycosat=0.6.2=py27_0 -- pycparser=2.17=py27_0 -- pycrypto=2.6.1=py27_6 -- pyflakes=1.5.0=py27_0 -- pygments=2.2.0=py27_0 -- pylint=1.6.4=py27_1 -- pyopenssl=17.0.0=py27_0 -- pyparsing=2.1.4=py27_0 -- pyqt=5.6.0=py27_2 -- pytest=3.1.2=py27_0 -- python=2.7.13=0 -- python-dateutil=2.6.0=py27_0 -- pytz=2017.2=py27_0 -- pyyaml=3.12=py27_0 -- pyzmq=16.0.2=py27_0 -- qtawesome=0.4.4=py27_0 -- qtconsole=4.3.0=py27_0 -- qtpy=1.2.1=py27_0 -- readline=6.2=2 -- requests=2.14.2=py27_0 -- rope=0.9.4=py27_1 -- ruamel_yaml=0.11.14=py27_1 -- scandir=1.5=py27_0 -- scikit-image=0.13.0=np113py27_0 -- scikit-learn=0.18.1=np113py27_1 -- scipy=0.19.0=np113py27_0 -- setuptools=27.2.0=py27_0 -- simplegeneric=0.8.1=py27_1 -- singledispatch=3.4.0.3=py27_0 -- sip=4.18=py27_0 -- six=1.10.0=py27_0 -- snowballstemmer=1.2.1=py27_0 -- sphinx=1.6.2=py27_0 -- sphinxcontrib=1.0=py27_0 -- sphinxcontrib-websupport=1.0.1=py27_0 -- spyder=3.1.4=py27_0 -- sqlite=3.13.0=0 -- ssl_match_hostname=3.4.0.2=py27_1 -- subprocess32=3.2.7=py27_0 -- sympy=1.0=py27_0 -- testpath=0.3.1=py27_0 -- tk=8.5.18=0 -- tornado=4.5.1=py27_0 -- traitlets=4.3.2=py27_0 -- typing=3.6.1=py27_0 -- wcwidth=0.1.7=py27_0 -- wheel=0.29.0=py27_0 -- wrapt=1.10.10=py27_0 -- xz=5.2.2=1 -- yaml=0.1.6=0 -- zeromq=4.1.5=0 -- zlib=1.2.8=3 -- dxchange=0.1.1=py27_0 -- dxfile=0.4=py27_0 -- edffile=1.6=py27_0 -- fftw=3.3.4=0 -- pyfftw=0.9.2=py27_0 -- pywavelets=0.4.0=py27_0 -- spefile=1.6=py27_0 -- tifffile=0.7.0=py27_0 -- tomopy=1.0.1=py27_0 -- pip: - - appdirs==1.4.3 - - backports-abc==0.5 - - backports.shutil-get-terminal-size==1.0.0 - - backports.ssl-match-hostname==3.4.0.2 - - cached-property==1.3.0 - - fabio==0.4.0 - - fisx==1.1.2 - - ipython-genutils==0.2.0 - - ipywidgets==6.0.0 - - jupyter==1.0.0 - - jupyter-client==5.0.1 - - jupyter-console==5.1.0 - - jupyter-core==4.3.0 - - lmfit==0.9.7 - - mako==1.0.6 - - mrcfile==1.0.0 - - notebook==5.0.0 - - nvidia-ml-py==375.53 - - peakutils==1.1.0 - - phasepack==1.5 - - polytope==0.2.0 - - prompt-toolkit==1.0.14 - - pymca==5.1.4 - - pymca5==5.1.4 - - pyreadline==2.1 - - pytools==2017.3 - - readme-renderer==17.2 - - restview==2.7.0 - - simpleitk==1.0.0 - - sphinx-rtd-theme==0.2.4 - - terminado==0.6 - - webencodings==0.5.1 - - widgetsnbextension==2.0.0 - diff --git a/install/2_1_install/savu_v2.1.1/environment_no_deps.yml b/install/2_1_install/savu_v2.1.1/environment_no_deps.yml deleted file mode 100644 index 25a3ea693..000000000 --- a/install/2_1_install/savu_v2.1.1/environment_no_deps.yml +++ /dev/null @@ -1,209 +0,0 @@ -name: savu_2.1 -channels: -- ccpi -- local -- conda-forge -- dgursoy -- defaults -dependencies: -- boost-cpp -- boost -- bzip2 -- cairo -- fontconfig -- freetype -- gettext -- glib -- icu -- libnetcdf -- libpng -- matplotlib -- netcdf4 -- pillow -- qt -- alabaster -- asn1crypto -- astroid -- babel -- backports -- backports_abc -- beautifulsoup4 -- bleach -- cffi -- chardet -- colorama -- conda-verify -- configparser -- contextlib2 -- cryptography -- curl -- cycler -- cython -- dbus -- decorator -- docutils -- entrypoints -- enum34 -- expat -- filelock -- funcsigs -- functools32 -- futures -- get_terminal_size -- glob2 -- gst-plugins-base -- gstreamer -- hdf4 -- html5lib -- idna -- imagesize -- ipaddress -- ipykernel -- ipython -- ipython_genutils -- isort -- jbig -- jedi -- jinja2 -- jpeg -- jsonschema -- jupyter_client -- jupyter_core -- lazy-object-proxy -- libffi -- libgcc -- libgfortran -- libiconv -- libsodium -- libtiff -- libxcb -- libxml2 -- markupsafe -- mistune -- mkl -- mock -- mpmath -- nbconvert -- nbformat -- networkx -- numexpr -- numpy -- numpydoc -- olefile -- openssl -- packaging -- pandas -- pandocfilters -- patchelf -- path.py -- pathlib2 -- pbr -- pcre -- pep8 -- pexpect -- pickleshare -- pip -- pixman -- pkginfo -- prompt_toolkit -- psutil -- ptyprocess -- py -- pycairo -- pycosat -- pycparser -- pycrypto -- pyflakes -- pygments -- pylint -- pyopenssl -- pyparsing -- pyqt -- pytest -- python -- python-dateutil -- pytz -- pyyaml -- pyzmq -- qtawesome -- qtconsole -- qtpy -- readline -- requests -- rope -- ruamel_yaml -- scandir -- scikit-image -- scikit-learn -- scipy -- setuptools -- simplegeneric -- singledispatch -- sip -- six -- snowballstemmer -- sphinx -- sphinxcontrib -- sphinxcontrib-websupport -- spyder -- sqlite -- ssl_match_hostname -- subprocess32 -- sympy -- testpath -- tk -- tornado -- traitlets -- typing -- wcwidth -- wheel -- wrapt -- xz -- yaml -- zeromq -- zlib -- dxchange -- dxfile -- edffile -- fftw -- pyfftw -- pywavelets -- spefile -- tifffile -- pip: - - appdirs - - backports-abc - - backports.shutil-get-terminal-size - - backports.ssl-match-hostname - - cached-property - - fabio - - fisx - - ipython-genutils - - ipywidgets - - jupyter - - jupyter-client - - jupyter-console - - jupyter-core - - lmfit - - mako - - mrcfile - - notebook - - nvidia-ml-py - - peakutils - - phasepack - - polytope - - prompt-toolkit - - pyfai - - pymca - - pymca5 - - pyreadline - - pytools - - readme-renderer - - restview - - simpleitk - - sphinx-rtd-theme - - terminado - - webencodings - - widgetsnbextension - - diff --git a/install/2_1_install/savu_v2.1.1/savu/build.sh b/install/2_1_install/savu_v2.1.1/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_1_install/savu_v2.1.1/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_1_install/savu_v2.1.1/savu/meta.yaml b/install/2_1_install/savu_v2.1.1/savu/meta.yaml deleted file mode 100644 index c5a494b0e..000000000 --- a/install/2_1_install/savu_v2.1.1/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.1.1" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_1_install/savu_v2.1.1/savu_installer.sh b/install/2_1_install/savu_v2.1.1/savu_installer.sh deleted file mode 100644 index e8d48cfb7..000000000 --- a/install/2_1_install/savu_v2.1.1/savu_installer.sh +++ /dev/null @@ -1,465 +0,0 @@ -#!/bin/bash -ex - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX=$HOME -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - -wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $PREFIX/miniconda.sh; -bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda -PYTHONHOME=$PREFIX/miniconda/bin -export PATH="$PYTHONHOME:$PATH" - -conda install -y -q conda-build - -echo -conda info | grep 'root environment' -echo - -conda env update -n root -f $DIR/environment.yml - -echo "Building Savu..." -conda build $DIR/$savu_recipe -savubuild=`conda build $DIR/$savu_recipe --output` -echo "Installing Savu..." -conda install -y -q --use-local $savubuild - -path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") -savu_path=${path%/savu/__init__.pyc} - -# get the savu version -install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") -recipes=$savu_path/$install_path/conda-recipes - -launcher_path=`command -v savu_launcher.sh` -launcher_path=${launcher_path%/savu_launcher.sh} -if [ "$facility" ]; then - cp $savu_path/mpi/$facility/savu_launcher.sh $launcher_path - cp $savu_path/mpi/$facility/savu_mpijob.sh $launcher_path -fi - -#----------------------------------------------------------------- -echo "Installing pyfai..." -pip install pyfai -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Installing mpi4py..." -mpi4py_version=`cat $recipes/mpi4py/version.txt` -env MPICC=$MPICC pip install mpi4py==$mpi4py_version -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building hdf5..." -conda uninstall -y -q hdf5 -conda build $recipes/hdf5 -hdf5build=`conda build $recipes/hdf5 --output` - -echo "Installing hdf5..." -conda install -y -q --use-local $hdf5build --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building h5py..." -conda uninstall -y -q h5py -conda build $recipes/h5py --no-test -h5pybuild=`conda build $recipes/h5py --output` - -echo "Installing h5py..." -conda install -y -q --use-local $h5pybuild --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building astra toolbox..." -conda build $recipes/astra -astrabuild=`conda build $recipes/astra --output` - -echo "Installing astra toolbox..." -conda install -y -q --use-local $astrabuild --no-deps - -site_path=$(python -c "import site; print site.getsitepackages()[0]") -cp $recipes/astra/astra.pth $site_path -astra_lib_path=$site_path/astra/lib -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building xraylib..." -conda build $recipes/xraylib -xraylibbuild=`conda build $recipes/xraylib --output` - -echo "Installing xraylib..." -conda install -y -q --use-local $xraylibbuild --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Installing tomopy..." -# these packages were missing in copied environment -conda install -y -q -c dgursoy tomopy --no-deps -conda install -y -q -c dgursoy dxchange --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -#echo "Building xdesign" -#conda build $recipes/xdesign -#xdesignbuild=`conda build $recipes/xdesign --output` - -#echo "Installing xdesign" -#conda install -y -q --use-local $xdesignbuild --no-deps -#----------------------------------------------------------------- - -echo -e "\n\t***************************************************" -echo -e "\t Package installation complete" -echo -e "\t Check $error_log for errors" -echo -e "\t***************************************************\n" - - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(python -c "import savu.core.utils as cu; p, count = cu.get_available_gpus(); print count") - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - echo "tmp file is" $tmpfile - - echo -e "\n***** Running Savu MPI local CPU tests *****\n" - - local_mpi_cpu_test.sh $test_dir -r $tmpfile - - result=$(grep -i "Processing Complete" $tmpfile) - if [ ! $result ] ; then - echo -e "\n****The tests have errored: See $tmpfile for more details****\n" - else - echo -e "\n***Test successfully completed!***\n" - fi - - - if [ $nGPUs -gt 0 ]; then - echo -e "\n***** Running Savu MPI local GPU tests *****\n" - local_mpi_gpu_test.sh $test_dir - else - echo -e "\n***** Skipping Savu MPI local GPU tests (no GPUs found) *****\n" - fi - - rm -r $test_dir - - echo -e "\n************** MPI local tests complete ******************\n" - - while true ; do - read -n 1 -p "Are you installing Savu for cluster use? (y/n): " input - if [ "$input" = "y" ]; then - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICE=================================" - echo -e "To run Savu across a cluster you will need to update the savu laucher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "Once these are update, run the cluster MPI tests:\n\t >>> mpi_cpu_test.sh " - echo -e "\t >>> mpi_gpu_test.sh ." - echo -e "================================================================================\n" - while true ; do - read -n 1 -p "Continue? (y): " input - if [ "$input" = "y" ]; then - break - else - echo - fi - done - echo - break - elif [ "$input" = "n" ]; then - break - else - echo -e "\nYour input was unknown.\n" - fi - done -fi - -if [ ! $test_flag ] ; then - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you open a new terminal." - echo -e "Alternatively, if you are using the Modules system, see $DIR/module_template for an example module file." - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_1_install/savu_v2.1.1/savu_master/build.sh b/install/2_1_install/savu_v2.1.1/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_1_install/savu_v2.1.1/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_1_install/savu_v2.1.1/savu_master/meta.yaml b/install/2_1_install/savu_v2.1.1/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_1_install/savu_v2.1.1/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_1_install/savu_v2.1.1/version.txt b/install/2_1_install/savu_v2.1.1/version.txt deleted file mode 100644 index c212a7fe4..000000000 --- a/install/2_1_install/savu_v2.1.1/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.1.1 - diff --git a/install/2_1_install/savu_v2.1.tar.gz b/install/2_1_install/savu_v2.1.tar.gz deleted file mode 100644 index 0dc3aa414..000000000 Binary files a/install/2_1_install/savu_v2.1.tar.gz and /dev/null differ diff --git a/install/2_1_install/savu_v2.2.1.tar.gz b/install/2_1_install/savu_v2.2.1.tar.gz deleted file mode 100644 index 13877bf67..000000000 Binary files a/install/2_1_install/savu_v2.2.1.tar.gz and /dev/null differ diff --git a/install/2_1_install/savu_v2.2.1/environment.yml b/install/2_1_install/savu_v2.2.1/environment.yml deleted file mode 100644 index 816ed85d7..000000000 --- a/install/2_1_install/savu_v2.2.1/environment.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: root -channels: -- ccpi -- local -- dgursoy -- conda-forge -- defaults -dependencies: -- boost-cpp=1.64.0=0 -- ccpi-reconstruction=0.1=py27_0 -- boost=1.64.0=np113py27_2 -- bzip2=1.0.6=1 -- cairo=1.14.6=4 -- fontconfig=2.12.1=4 -- freetype=2.7=1 -- gettext=0.19.7=1 -- glib=2.51.4=0 -- icu=58.1=1 -- libnetcdf=4.4.1.1=7 -- libpng=1.6.28=0 -- matplotlib=2.0.2=np113py27_0 -- netcdf4=1.2.9=np113py27_0 -- pillow=4.1.1=py27_0 -- qt=5.6.2=3 -- alabaster=0.7.10=py27_0 -- asn1crypto=0.22.0=py27_0 -- astroid=1.4.9=py27_0 -- babel=2.4.0=py27_0 -- backports=1.0=py27_0 -- backports_abc=0.5=py27_0 -- beautifulsoup4=4.6.0=py27_0 -- bleach=1.5.0=py27_0 -- cffi=1.10.0=py27_0 -- chardet=3.0.4=py27_0 -- colorama=0.3.9=py27_0 -- conda=4.3.22=py27_0 -- conda-build=3.0.6=py27_0 -- conda-env=2.6.0=0 -- conda-verify=2.0.0=py27_0 -- configparser=3.5.0=py27_0 -- contextlib2=0.5.5=py27_0 -- cryptography=1.8.1=py27_0 -- curl=7.49.0=1 -- cycler=0.10.0=py27_0 -- cython=0.25.2=py27_0 -- dbus=1.10.10=0 -- decorator=4.0.11=py27_0 -- docutils=0.13.1=py27_0 -- entrypoints=0.2.2=py27_1 -- enum34=1.1.6=py27_0 -- expat=2.1.0=0 -- filelock=2.0.7=py27_0 -- funcsigs=1.0.2=py27_0 -- functools32=3.2.3.2=py27_0 -- futures=3.1.1=py27_0 -- get_terminal_size=1.0.0=py27_0 -- glob2=0.5=py27_0 -- gst-plugins-base=1.8.0=0 -- gstreamer=1.8.0=0 -- hdf4=4.2.12=1 -- html5lib=0.999=py27_0 -- idna=2.5=py27_0 -- imagesize=0.7.1=py27_0 -- ipaddress=1.0.18=py27_0 -- ipykernel=4.6.1=py27_0 -- ipython=5.3.0=py27_0 -- ipython_genutils=0.2.0=py27_0 -- isort=4.2.14=py27_0 -- jbig=2.1=0 -- jedi=0.10.2=py27_2 -- jinja2=2.9.6=py27_0 -- jpeg=9b=0 -- jsonschema=2.6.0=py27_0 -- jupyter_client=5.0.1=py27_0 -- jupyter_core=4.3.0=py27_0 -- lazy-object-proxy=1.2.2=py27_0 -- libffi=3.2.1=1 -- libgcc=5.2.0=0 -- libgfortran=3.0.0=1 -- libiconv=1.14=0 -- libsodium=1.0.10=0 -- libtiff=4.0.6=3 -- libxcb=1.12=1 -- libxml2=2.9.4=0 -- markupsafe=0.23=py27_2 -- mistune=0.7.4=py27_0 -- mkl=2017.0.1=0 -- mock=2.0.0=py27_0 -- mpmath=0.19=py27_1 -- nbconvert=5.2.1=py27_0 -- nbformat=4.3.0=py27_0 -- networkx=1.11=py27_0 -- numexpr=2.6.2=np113py27_0 -- numpy=1.13.0=py27_0 -- numpydoc=0.6.0=py27_0 -- olefile=0.44=py27_0 -- openssl=1.0.2l=0 -- packaging=16.8=py27_0 -- pandas=0.20.2=np113py27_0 -- pandocfilters=1.4.1=py27_0 -- patchelf=0.9=0 -- path.py=10.3.1=py27_0 -- pathlib2=2.2.1=py27_0 -- pbr=1.10.0=py27_0 -- pcre=8.39=1 -- pep8=1.7.0=py27_0 -- pexpect=4.2.1=py27_0 -- pickleshare=0.7.4=py27_0 -- pip=9.0.1=py27_1 -- pixman=0.34.0=0 -- pkginfo=1.4.1=py27_0 -- prompt_toolkit=1.0.14=py27_0 -- psutil=5.2.2=py27_0 -- ptyprocess=0.5.1=py27_0 -- py=1.4.34=py27_0 -- pycairo=1.10.0=py27_0 -- pycosat=0.6.2=py27_0 -- pycparser=2.17=py27_0 -- pycrypto=2.6.1=py27_6 -- pyflakes=1.5.0=py27_0 -- pygments=2.2.0=py27_0 -- pylint=1.6.4=py27_1 -- pyopenssl=17.0.0=py27_0 -- pyparsing=2.1.4=py27_0 -- pyqt=5.6.0=py27_2 -- pytest=3.1.2=py27_0 -- python=2.7.13=0 -- python-dateutil=2.6.0=py27_0 -- pytz=2017.2=py27_0 -- pyyaml=3.12=py27_0 -- pyzmq=16.0.2=py27_0 -- qtawesome=0.4.4=py27_0 -- qtconsole=4.3.0=py27_0 -- qtpy=1.2.1=py27_0 -- readline=6.2=2 -- requests=2.14.2=py27_0 -- rope=0.9.4=py27_1 -- ruamel_yaml=0.11.14=py27_1 -- scandir=1.5=py27_0 -- scikit-image=0.13.0=np113py27_0 -- scikit-learn=0.18.1=np113py27_1 -- scipy=0.19.0=np113py27_0 -- setuptools=27.2.0=py27_0 -- simplegeneric=0.8.1=py27_1 -- singledispatch=3.4.0.3=py27_0 -- sip=4.18=py27_0 -- six=1.10.0=py27_0 -- snowballstemmer=1.2.1=py27_0 -- sphinx=1.6.2=py27_0 -- sphinxcontrib=1.0=py27_0 -- sphinxcontrib-websupport=1.0.1=py27_0 -- spyder=3.1.4=py27_0 -- sqlite=3.13.0=0 -- ssl_match_hostname=3.4.0.2=py27_1 -- subprocess32=3.2.7=py27_0 -- sympy=1.0=py27_0 -- testpath=0.3.1=py27_0 -- tk=8.5.18=0 -- tornado=4.5.1=py27_0 -- traitlets=4.3.2=py27_0 -- typing=3.6.1=py27_0 -- wcwidth=0.1.7=py27_0 -- wheel=0.29.0=py27_0 -- wrapt=1.10.10=py27_0 -- xz=5.2.2=1 -- yaml=0.1.6=0 -- zeromq=4.1.5=0 -- zlib=1.2.8=3 -- dxchange=0.1.1=py27_0 -- dxfile=0.4=py27_0 -- edffile=1.6=py27_0 -- fftw=3.3.4=0 -- pyfftw=0.9.2=py27_0 -- pywavelets=0.4.0=py27_0 -- spefile=1.6=py27_0 -- tifffile=0.7.0=py27_0 -- tomopy=1.0.1=py27_0 -- pip: - - appdirs==1.4.3 - - backports-abc==0.5 - - backports.shutil-get-terminal-size==1.0.0 - - backports.ssl-match-hostname==3.4.0.2 - - cached-property==1.3.0 - - fabio==0.4.0 - - fisx==1.1.2 - - ipython-genutils==0.2.0 - - ipywidgets==6.0.0 - - jupyter==1.0.0 - - jupyter-client==5.0.1 - - jupyter-console==5.1.0 - - jupyter-core==4.3.0 - - lmfit==0.9.7 - - mako==1.0.6 - - mrcfile==1.0.0 - - notebook==5.0.0 - - nvidia-ml-py==375.53 - - peakutils==1.1.0 - - phasepack==1.5 - - polytope==0.2.0 - - prompt-toolkit==1.0.14 - - pymca==5.1.4 - - pymca5==5.1.4 - - pyreadline==2.1 - - pytools==2017.3 - - readme-renderer==17.2 - - restview==2.7.0 - - simpleitk==1.0.0 - - sphinx-rtd-theme==0.2.4 - - terminado==0.6 - - webencodings==0.5.1 - - widgetsnbextension==2.0.0 - diff --git a/install/2_1_install/savu_v2.2.1/savu/meta.yaml b/install/2_1_install/savu_v2.2.1/savu/meta.yaml deleted file mode 100644 index 1b4299e92..000000000 --- a/install/2_1_install/savu_v2.2.1/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.2.1" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_1_install/savu_v2.2.1/savu_installer.sh b/install/2_1_install/savu_v2.2.1/savu_installer.sh deleted file mode 100644 index d852aa6d2..000000000 --- a/install/2_1_install/savu_v2.2.1/savu_installer.sh +++ /dev/null @@ -1,462 +0,0 @@ -#!/bin/bash -ex - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX="${PREFIX:-$HOME}" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - -wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $PREFIX/miniconda.sh; -bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda -PYTHONHOME=$PREFIX/miniconda/bin -export PATH="$PYTHONHOME:$PATH" - -conda install -y -q conda-build conda-env - -conda env update -n root -f $DIR/environment.yml - -echo "Building Savu..." -conda build $DIR/$savu_recipe -savubuild=`conda build $DIR/$savu_recipe --output` -echo "Installing Savu..." -conda install -y -q --use-local $savubuild - -path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") -savu_path=${path%/savu/__init__.pyc} - -# get the savu version -install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") -recipes=$savu_path/$install_path/conda-recipes - -launcher_path=`command -v savu_launcher.sh` -launcher_path=${launcher_path%/savu_launcher.sh} -if [ "$facility" ]; then - cp $savu_path/mpi/$facility/savu_launcher.sh $launcher_path - cp $savu_path/mpi/$facility/savu_mpijob.sh $launcher_path -fi - -#----------------------------------------------------------------- -echo "Installing pyfai..." -pip install pyfai -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Installing mpi4py..." -mpi4py_version=`cat $recipes/mpi4py/version.txt` -env MPICC=$MPICC pip install mpi4py==$mpi4py_version -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building hdf5..." -conda uninstall -y -q hdf5 || true -conda build $recipes/hdf5 -hdf5build=`conda build $recipes/hdf5 --output` - -echo "Installing hdf5..." -conda install -y -q --use-local $hdf5build --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building h5py..." -conda uninstall -y -q h5py || true -conda build $recipes/h5py --no-test -h5pybuild=`conda build $recipes/h5py --output` - -echo "Installing h5py..." -conda install -y -q --use-local $h5pybuild --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building astra toolbox..." -conda build $recipes/astra -astrabuild=`conda build $recipes/astra --output` - -echo "Installing astra toolbox..." -conda install -y -q --use-local $astrabuild --no-deps - -site_path=$(python -c "import site; print site.getsitepackages()[0]") -cp $recipes/astra/astra.pth $site_path -astra_lib_path=$site_path/astra/lib -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building xraylib..." -conda build $recipes/xraylib -xraylibbuild=`conda build $recipes/xraylib --output` - -echo "Installing xraylib..." -conda install -y -q --use-local $xraylibbuild --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Installing tomopy..." -# these packages were missing in copied environment -conda install -y -q -c dgursoy tomopy --no-deps -conda install -y -q -c dgursoy dxchange --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -#echo "Building xdesign" -#conda build $recipes/xdesign -#xdesignbuild=`conda build $recipes/xdesign --output` - -#echo "Installing xdesign" -#conda install -y -q --use-local $xdesignbuild --no-deps -#----------------------------------------------------------------- - -echo -e "\n\t***************************************************" -echo -e "\t Package installation complete" -echo -e "\t Check $error_log for errors" -echo -e "\t***************************************************\n" - - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(python -c "import savu.core.utils as cu; p, count = cu.get_available_gpus(); print count") - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - echo "tmp file is" $tmpfile - - echo -e "\n***** Running Savu MPI local CPU tests *****\n" - - local_mpi_cpu_test.sh $test_dir -r $tmpfile - - result=$(grep -i "Processing Complete" $tmpfile) - if [ ! $result ] ; then - echo -e "\n****The tests have errored: See $tmpfile for more details****\n" - else - echo -e "\n***Test successfully completed!***\n" - fi - - - if [ $nGPUs -gt 0 ]; then - echo -e "\n***** Running Savu MPI local GPU tests *****\n" - local_mpi_gpu_test.sh $test_dir - else - echo -e "\n***** Skipping Savu MPI local GPU tests (no GPUs found) *****\n" - fi - - rm -r $test_dir - - echo -e "\n************** MPI local tests complete ******************\n" - - while true ; do - read -n 1 -p "Are you installing Savu for cluster use? (y/n): " input - if [ "$input" = "y" ]; then - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICE=================================" - echo -e "To run Savu across a cluster you will need to update the savu laucher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "Once these are update, run the cluster MPI tests:\n\t >>> mpi_cpu_test.sh " - echo -e "\t >>> mpi_gpu_test.sh ." - echo -e "================================================================================\n" - while true ; do - read -n 1 -p "Continue? (y): " input - if [ "$input" = "y" ]; then - break - else - echo - fi - done - echo - break - elif [ "$input" = "n" ]; then - break - else - echo -e "\nYour input was unknown.\n" - fi - done -fi - -if [ ! $test_flag ] ; then - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you open a new terminal." - echo -e "Alternatively, if you are using the Modules system, see $DIR/module_template for an example module file." - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_1_install/savu_v2.2.1/savu_master/build.sh b/install/2_1_install/savu_v2.2.1/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_1_install/savu_v2.2.1/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_1_install/savu_v2.2.1/savu_master/meta.yaml b/install/2_1_install/savu_v2.2.1/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_1_install/savu_v2.2.1/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_1_install/savu_v2.2.1/version.txt b/install/2_1_install/savu_v2.2.1/version.txt deleted file mode 100644 index 20710135a..000000000 --- a/install/2_1_install/savu_v2.2.1/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.2.1 - diff --git a/install/2_1_install/savu_v2.2.tar.gz b/install/2_1_install/savu_v2.2.tar.gz deleted file mode 100644 index 5f7b1d0f8..000000000 Binary files a/install/2_1_install/savu_v2.2.tar.gz and /dev/null differ diff --git a/install/2_1_install/savu_v2.2/environment.yml b/install/2_1_install/savu_v2.2/environment.yml deleted file mode 100644 index 816ed85d7..000000000 --- a/install/2_1_install/savu_v2.2/environment.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: root -channels: -- ccpi -- local -- dgursoy -- conda-forge -- defaults -dependencies: -- boost-cpp=1.64.0=0 -- ccpi-reconstruction=0.1=py27_0 -- boost=1.64.0=np113py27_2 -- bzip2=1.0.6=1 -- cairo=1.14.6=4 -- fontconfig=2.12.1=4 -- freetype=2.7=1 -- gettext=0.19.7=1 -- glib=2.51.4=0 -- icu=58.1=1 -- libnetcdf=4.4.1.1=7 -- libpng=1.6.28=0 -- matplotlib=2.0.2=np113py27_0 -- netcdf4=1.2.9=np113py27_0 -- pillow=4.1.1=py27_0 -- qt=5.6.2=3 -- alabaster=0.7.10=py27_0 -- asn1crypto=0.22.0=py27_0 -- astroid=1.4.9=py27_0 -- babel=2.4.0=py27_0 -- backports=1.0=py27_0 -- backports_abc=0.5=py27_0 -- beautifulsoup4=4.6.0=py27_0 -- bleach=1.5.0=py27_0 -- cffi=1.10.0=py27_0 -- chardet=3.0.4=py27_0 -- colorama=0.3.9=py27_0 -- conda=4.3.22=py27_0 -- conda-build=3.0.6=py27_0 -- conda-env=2.6.0=0 -- conda-verify=2.0.0=py27_0 -- configparser=3.5.0=py27_0 -- contextlib2=0.5.5=py27_0 -- cryptography=1.8.1=py27_0 -- curl=7.49.0=1 -- cycler=0.10.0=py27_0 -- cython=0.25.2=py27_0 -- dbus=1.10.10=0 -- decorator=4.0.11=py27_0 -- docutils=0.13.1=py27_0 -- entrypoints=0.2.2=py27_1 -- enum34=1.1.6=py27_0 -- expat=2.1.0=0 -- filelock=2.0.7=py27_0 -- funcsigs=1.0.2=py27_0 -- functools32=3.2.3.2=py27_0 -- futures=3.1.1=py27_0 -- get_terminal_size=1.0.0=py27_0 -- glob2=0.5=py27_0 -- gst-plugins-base=1.8.0=0 -- gstreamer=1.8.0=0 -- hdf4=4.2.12=1 -- html5lib=0.999=py27_0 -- idna=2.5=py27_0 -- imagesize=0.7.1=py27_0 -- ipaddress=1.0.18=py27_0 -- ipykernel=4.6.1=py27_0 -- ipython=5.3.0=py27_0 -- ipython_genutils=0.2.0=py27_0 -- isort=4.2.14=py27_0 -- jbig=2.1=0 -- jedi=0.10.2=py27_2 -- jinja2=2.9.6=py27_0 -- jpeg=9b=0 -- jsonschema=2.6.0=py27_0 -- jupyter_client=5.0.1=py27_0 -- jupyter_core=4.3.0=py27_0 -- lazy-object-proxy=1.2.2=py27_0 -- libffi=3.2.1=1 -- libgcc=5.2.0=0 -- libgfortran=3.0.0=1 -- libiconv=1.14=0 -- libsodium=1.0.10=0 -- libtiff=4.0.6=3 -- libxcb=1.12=1 -- libxml2=2.9.4=0 -- markupsafe=0.23=py27_2 -- mistune=0.7.4=py27_0 -- mkl=2017.0.1=0 -- mock=2.0.0=py27_0 -- mpmath=0.19=py27_1 -- nbconvert=5.2.1=py27_0 -- nbformat=4.3.0=py27_0 -- networkx=1.11=py27_0 -- numexpr=2.6.2=np113py27_0 -- numpy=1.13.0=py27_0 -- numpydoc=0.6.0=py27_0 -- olefile=0.44=py27_0 -- openssl=1.0.2l=0 -- packaging=16.8=py27_0 -- pandas=0.20.2=np113py27_0 -- pandocfilters=1.4.1=py27_0 -- patchelf=0.9=0 -- path.py=10.3.1=py27_0 -- pathlib2=2.2.1=py27_0 -- pbr=1.10.0=py27_0 -- pcre=8.39=1 -- pep8=1.7.0=py27_0 -- pexpect=4.2.1=py27_0 -- pickleshare=0.7.4=py27_0 -- pip=9.0.1=py27_1 -- pixman=0.34.0=0 -- pkginfo=1.4.1=py27_0 -- prompt_toolkit=1.0.14=py27_0 -- psutil=5.2.2=py27_0 -- ptyprocess=0.5.1=py27_0 -- py=1.4.34=py27_0 -- pycairo=1.10.0=py27_0 -- pycosat=0.6.2=py27_0 -- pycparser=2.17=py27_0 -- pycrypto=2.6.1=py27_6 -- pyflakes=1.5.0=py27_0 -- pygments=2.2.0=py27_0 -- pylint=1.6.4=py27_1 -- pyopenssl=17.0.0=py27_0 -- pyparsing=2.1.4=py27_0 -- pyqt=5.6.0=py27_2 -- pytest=3.1.2=py27_0 -- python=2.7.13=0 -- python-dateutil=2.6.0=py27_0 -- pytz=2017.2=py27_0 -- pyyaml=3.12=py27_0 -- pyzmq=16.0.2=py27_0 -- qtawesome=0.4.4=py27_0 -- qtconsole=4.3.0=py27_0 -- qtpy=1.2.1=py27_0 -- readline=6.2=2 -- requests=2.14.2=py27_0 -- rope=0.9.4=py27_1 -- ruamel_yaml=0.11.14=py27_1 -- scandir=1.5=py27_0 -- scikit-image=0.13.0=np113py27_0 -- scikit-learn=0.18.1=np113py27_1 -- scipy=0.19.0=np113py27_0 -- setuptools=27.2.0=py27_0 -- simplegeneric=0.8.1=py27_1 -- singledispatch=3.4.0.3=py27_0 -- sip=4.18=py27_0 -- six=1.10.0=py27_0 -- snowballstemmer=1.2.1=py27_0 -- sphinx=1.6.2=py27_0 -- sphinxcontrib=1.0=py27_0 -- sphinxcontrib-websupport=1.0.1=py27_0 -- spyder=3.1.4=py27_0 -- sqlite=3.13.0=0 -- ssl_match_hostname=3.4.0.2=py27_1 -- subprocess32=3.2.7=py27_0 -- sympy=1.0=py27_0 -- testpath=0.3.1=py27_0 -- tk=8.5.18=0 -- tornado=4.5.1=py27_0 -- traitlets=4.3.2=py27_0 -- typing=3.6.1=py27_0 -- wcwidth=0.1.7=py27_0 -- wheel=0.29.0=py27_0 -- wrapt=1.10.10=py27_0 -- xz=5.2.2=1 -- yaml=0.1.6=0 -- zeromq=4.1.5=0 -- zlib=1.2.8=3 -- dxchange=0.1.1=py27_0 -- dxfile=0.4=py27_0 -- edffile=1.6=py27_0 -- fftw=3.3.4=0 -- pyfftw=0.9.2=py27_0 -- pywavelets=0.4.0=py27_0 -- spefile=1.6=py27_0 -- tifffile=0.7.0=py27_0 -- tomopy=1.0.1=py27_0 -- pip: - - appdirs==1.4.3 - - backports-abc==0.5 - - backports.shutil-get-terminal-size==1.0.0 - - backports.ssl-match-hostname==3.4.0.2 - - cached-property==1.3.0 - - fabio==0.4.0 - - fisx==1.1.2 - - ipython-genutils==0.2.0 - - ipywidgets==6.0.0 - - jupyter==1.0.0 - - jupyter-client==5.0.1 - - jupyter-console==5.1.0 - - jupyter-core==4.3.0 - - lmfit==0.9.7 - - mako==1.0.6 - - mrcfile==1.0.0 - - notebook==5.0.0 - - nvidia-ml-py==375.53 - - peakutils==1.1.0 - - phasepack==1.5 - - polytope==0.2.0 - - prompt-toolkit==1.0.14 - - pymca==5.1.4 - - pymca5==5.1.4 - - pyreadline==2.1 - - pytools==2017.3 - - readme-renderer==17.2 - - restview==2.7.0 - - simpleitk==1.0.0 - - sphinx-rtd-theme==0.2.4 - - terminado==0.6 - - webencodings==0.5.1 - - widgetsnbextension==2.0.0 - diff --git a/install/2_1_install/savu_v2.2/savu/build.sh b/install/2_1_install/savu_v2.2/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_1_install/savu_v2.2/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_1_install/savu_v2.2/savu/meta.yaml b/install/2_1_install/savu_v2.2/savu/meta.yaml deleted file mode 100644 index c8cc17064..000000000 --- a/install/2_1_install/savu_v2.2/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.2" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_1_install/savu_v2.2/savu_installer.sh b/install/2_1_install/savu_v2.2/savu_installer.sh deleted file mode 100644 index c16f630df..000000000 --- a/install/2_1_install/savu_v2.2/savu_installer.sh +++ /dev/null @@ -1,461 +0,0 @@ -#!/bin/bash -ex - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX=$HOME -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - -wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $PREFIX/miniconda.sh; -bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda -PYTHONHOME=$PREFIX/miniconda/bin -export PATH="$PYTHONHOME:$PATH" - -conda install -y -q conda-build conda-env - -conda env update -n root -f $DIR/environment.yml - -echo "Building Savu..." -conda build $DIR/$savu_recipe -savubuild=`conda build $DIR/$savu_recipe --output` -echo "Installing Savu..." -conda install -y -q --use-local $savubuild - -path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") -savu_path=${path%/savu/__init__.pyc} - -# get the savu version -install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") -recipes=$savu_path/$install_path/conda-recipes - -launcher_path=`command -v savu_launcher.sh` -launcher_path=${launcher_path%/savu_launcher.sh} -if [ "$facility" ]; then - cp $savu_path/mpi/$facility/savu_launcher.sh $launcher_path - cp $savu_path/mpi/$facility/savu_mpijob.sh $launcher_path -fi - -#----------------------------------------------------------------- -echo "Installing pyfai..." -pip install pyfai -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Installing mpi4py..." -mpi4py_version=`cat $recipes/mpi4py/version.txt` -env MPICC=$MPICC pip install mpi4py==$mpi4py_version -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building hdf5..." -conda uninstall -y -q hdf5 || true -conda build $recipes/hdf5 -hdf5build=`conda build $recipes/hdf5 --output` - -echo "Installing hdf5..." -conda install -y -q --use-local $hdf5build --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building h5py..." -conda uninstall -y -q h5py || true -conda build $recipes/h5py --no-test -h5pybuild=`conda build $recipes/h5py --output` - -echo "Installing h5py..." -conda install -y -q --use-local $h5pybuild --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building astra toolbox..." -conda build $recipes/astra -astrabuild=`conda build $recipes/astra --output` - -echo "Installing astra toolbox..." -conda install -y -q --use-local $astrabuild --no-deps - -site_path=$(python -c "import site; print site.getsitepackages()[0]") -cp $recipes/astra/astra.pth $site_path -astra_lib_path=$site_path/astra/lib -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Building xraylib..." -conda build $recipes/xraylib -xraylibbuild=`conda build $recipes/xraylib --output` - -echo "Installing xraylib..." -conda install -y -q --use-local $xraylibbuild --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -echo "Installing tomopy..." -# these packages were missing in copied environment -conda install -y -q -c dgursoy tomopy --no-deps -conda install -y -q -c dgursoy dxchange --no-deps -#----------------------------------------------------------------- - -#----------------------------------------------------------------- -#echo "Building xdesign" -#conda build $recipes/xdesign -#xdesignbuild=`conda build $recipes/xdesign --output` - -#echo "Installing xdesign" -#conda install -y -q --use-local $xdesignbuild --no-deps -#----------------------------------------------------------------- - -echo -e "\n\t***************************************************" -echo -e "\t Package installation complete" -echo -e "\t Check $error_log for errors" -echo -e "\t***************************************************\n" - - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(python -c "import savu.core.utils as cu; p, count = cu.get_available_gpus(); print count") - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - echo "tmp file is" $tmpfile - - echo -e "\n***** Running Savu MPI local CPU tests *****\n" - - local_mpi_cpu_test.sh $test_dir -r $tmpfile - - result=$(grep -i "Processing Complete" $tmpfile) - if [ ! $result ] ; then - echo -e "\n****The tests have errored: See $tmpfile for more details****\n" - else - echo -e "\n***Test successfully completed!***\n" - fi - - - if [ $nGPUs -gt 0 ]; then - echo -e "\n***** Running Savu MPI local GPU tests *****\n" - local_mpi_gpu_test.sh $test_dir - else - echo -e "\n***** Skipping Savu MPI local GPU tests (no GPUs found) *****\n" - fi - - rm -r $test_dir - - echo -e "\n************** MPI local tests complete ******************\n" - - while true ; do - read -n 1 -p "Are you installing Savu for cluster use? (y/n): " input - if [ "$input" = "y" ]; then - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICE=================================" - echo -e "To run Savu across a cluster you will need to update the savu laucher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "Once these are update, run the cluster MPI tests:\n\t >>> mpi_cpu_test.sh " - echo -e "\t >>> mpi_gpu_test.sh ." - echo -e "================================================================================\n" - while true ; do - read -n 1 -p "Continue? (y): " input - if [ "$input" = "y" ]; then - break - else - echo - fi - done - echo - break - elif [ "$input" = "n" ]; then - break - else - echo -e "\nYour input was unknown.\n" - fi - done -fi - -if [ ! $test_flag ] ; then - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you open a new terminal." - echo -e "Alternatively, if you are using the Modules system, see $DIR/module_template for an example module file." - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_1_install/savu_v2.2/savu_master/build.sh b/install/2_1_install/savu_v2.2/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_1_install/savu_v2.2/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_1_install/savu_v2.2/savu_master/meta.yaml b/install/2_1_install/savu_v2.2/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_1_install/savu_v2.2/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_1_install/savu_v2.2/version.txt b/install/2_1_install/savu_v2.2/version.txt deleted file mode 100644 index 5b634ca8e..000000000 --- a/install/2_1_install/savu_v2.2/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.2 - diff --git a/install/2_1_install/tests/test_setup.sh b/install/2_1_install/tests/test_setup.sh deleted file mode 100644 index 90a35b203..000000000 --- a/install/2_1_install/tests/test_setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -savu_path=$(python -c "import savu; import os; print os.path.abspath(os.path.dirname(savu.__file__))") -test_path=$savu_path'/../test_data' -export TESTDATA=$test_path -echo '$TESTDATA points to the Savu test data folder at' $TESTDATA - diff --git a/install/2_3_1_install/__init__.py b/install/2_3_1_install/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/2_3_1_install/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/2_3_1_install/conda-recipes/astra/astra.pth b/install/2_3_1_install/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/2_3_1_install/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/2_3_1_install/conda-recipes/astra/build.sh b/install/2_3_1_install/conda-recipes/astra/build.sh deleted file mode 100644 index acd72a6d6..000000000 --- a/install/2_3_1_install/conda-recipes/astra/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -savu_path=`command -v savu` -ana_path=${savu_path%/savu} -prefix=${ana_path%/bin}/lib/python2.7/site-packages/astra -export PATH=$ana_path:$PATH - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/2_3_1_install/conda-recipes/astra/meta.yaml b/install/2_3_1_install/conda-recipes/astra/meta.yaml deleted file mode 100644 index 4a04c0bc4..000000000 --- a/install/2_3_1_install/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.8" %} - -package: - name: astra-toolbox - version: 1.8 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: 44602e0eb0789a557622eae959fc0a067d81396bcb79ec315cb39b59d52322e7 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/2_3_1_install/conda-recipes/h5py/build.sh b/install/2_3_1_install/conda-recipes/h5py/build.sh deleted file mode 100644 index 055293a33..000000000 --- a/install/2_3_1_install/conda-recipes/h5py/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` - -# set anaconda distribution -ana_path=$(command -v savu) -ana_path=${ana_path%/bin/savu} -hdf5_version=1.10.1 -hdf5_build_no=1 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --hdf5=$ana_path -$PYTHON setup.py configure --hdf5-version=$hdf5_version -$PYTHON setup.py configure --mpi -$PYTHON setup.py build -$PYTHON setup.py install - diff --git a/install/2_3_1_install/conda-recipes/h5py/meta.yaml b/install/2_3_1_install/conda-recipes/h5py/meta.yaml deleted file mode 100644 index 0778446ae..000000000 --- a/install/2_3_1_install/conda-recipes/h5py/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "2.7.1" %} # change this - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz -requirements: - build: - - python - - numpy - - hdf5 - - cython - - pkgconfig - - six - -build: - number: 1 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) - diff --git a/install/2_3_1_install/conda-recipes/hdf5/meta.yaml b/install/2_3_1_install/conda-recipes/hdf5/meta.yaml deleted file mode 100644 index a12ea27a8..000000000 --- a/install/2_3_1_install/conda-recipes/hdf5/meta.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{% set version = "1.10.1" %} -{% set release = "hdf5-1.10" %} -{% set patch = "hdf5-1.10.1" %} - -package: - name: hdf5 - version: {{ version }} - -source: - fn: {{ patch }}.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ release }}/{{ patch }}/src/{{ patch }}.tar.bz2 - md5: d89893c05ee7ea8611b51bb39450d64e - -build: - number: 1 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) - diff --git a/install/2_3_1_install/conda-recipes/xdesign/build.sh b/install/2_3_1_install/conda-recipes/xdesign/build.sh deleted file mode 100644 index b161f631b..000000000 --- a/install/2_3_1_install/conda-recipes/xdesign/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install - diff --git a/install/2_3_1_install/conda-recipes/xdesign/meta.yaml b/install/2_3_1_install/conda-recipes/xdesign/meta.yaml deleted file mode 100644 index 68693b427..000000000 --- a/install/2_3_1_install/conda-recipes/xdesign/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -package: - name: xdesign - version: '0.3.0' - -source: - git_url: https://github.com/tomography/xdesign.git - -build: - number: 0 - -requirements: - build: - - python - - setuptools - -about: - home: http://xdesign.readthedocs.io - license: BSD-3 - summary: 'Benchmarking and optimization tools for tomography.' - -# See -# http://docs.continuum.io/conda/build.html for -# more information about meta.yaml - diff --git a/install/2_3_1_install/conda-recipes/xraylib/build.sh b/install/2_3_1_install/conda-recipes/xraylib/build.sh deleted file mode 100644 index 8f0acd316..000000000 --- a/install/2_3_1_install/conda-recipes/xraylib/build.sh +++ /dev/null @@ -1,7 +0,0 @@ - -./configure --enable-python --disable-perl --disable-java \ - --disable-fortran2003 --disable-lua --prefix=$PREFIX -make -make check -make install - diff --git a/install/2_3_1_install/conda-recipes/xraylib/meta.yaml b/install/2_3_1_install/conda-recipes/xraylib/meta.yaml deleted file mode 100644 index f924056e2..000000000 --- a/install/2_3_1_install/conda-recipes/xraylib/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "3.3.0" %} - -package: - name: xraylib - version: {{ version }} - -source: - fn: xraylib-{{ version }}.tar.gz - url: https://xraylib.tomschoonjans.eu/xraylib-{{ version }}.tar.gz - sha256: a22a73b8d90eb752b034bab1a4cf6abdd81b8c7dc5020bcb22132d2ee7aacd42 - -build: - number: 0 - -requirements: - build: - - python - - setuptools - - numpy - - scipy >=0.7.0 - - cython - - swig - - autoconf - - libtool - - automake - diff --git a/install/2_3_1_install/savu_v2.3.1.tar.gz b/install/2_3_1_install/savu_v2.3.1.tar.gz deleted file mode 100644 index 3868a0591..000000000 Binary files a/install/2_3_1_install/savu_v2.3.1.tar.gz and /dev/null differ diff --git a/install/2_3_1_install/savu_v2.3.1/environment.yml b/install/2_3_1_install/savu_v2.3.1/environment.yml deleted file mode 100644 index 79d658ca9..000000000 --- a/install/2_3_1_install/savu_v2.3.1/environment.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: root -channels: -- defaults -dependencies: -- scipy==1.1.0 -- colorama==0.3.9 -- setuptools==39.2.0 -- jinja2==2.10 -- numpy==1.14.5 -- pandas==0.23.3 -- mock==2.0.0 -- PyWavelets==0.5.2 -- scikit-image==0.14.0 -- scikit-learn==0.19.1 -- pytest==3.6.2 -- spyder==3.3.0 -- ipython==5.7.0 -- cython==0.28.3 -- boost==1.67.0 -- pip: - - fabio==0.4.0 - - pyfftw==0.10.4 - - nvidia-ml-py==7.352.0 - - PeakUtils==1.1.1 - - pymca==5.3.1 - - tifffile==0.4.0 - - pyreadline==2.1 - - gnureadline==6.3.8 - - sphinx_rtd_theme==0.4.1 - diff --git a/install/2_3_1_install/savu_v2.3.1/savu/build.sh b/install/2_3_1_install/savu_v2.3.1/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_3_1_install/savu_v2.3.1/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_3_1_install/savu_v2.3.1/savu/meta.yaml b/install/2_3_1_install/savu_v2.3.1/savu/meta.yaml deleted file mode 100644 index 131389903..000000000 --- a/install/2_3_1_install/savu_v2.3.1/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.3.1" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_3_1_install/savu_v2.3.1/savu_installer.sh b/install/2_3_1_install/savu_v2.3.1/savu_installer.sh deleted file mode 100644 index 3953bd62f..000000000 --- a/install/2_3_1_install/savu_v2.3.1/savu_installer.sh +++ /dev/null @@ -1,446 +0,0 @@ -#!/bin/bash -ex - -# change to 'latest' for the latest version -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -versions_file=$DIR/versions_file.txt - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX="${PREFIX:-$HOME}" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -# If no FFTWHOME provided search LD_LIBRARY_PATH for the static library -if [ -z ${FFTWHOME+x} ]; then - IFS=: - file_base=libfftw?.so - for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - break - fi - done -fi -# If a valid FFTWHOME was found or provided then use it -if [ ${FFTWHOME} ]; then - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" -fi - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -if [ ! $test_flag ] ; then - - echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - - unset IFS - string=`awk '/^miniconda/' $versions_file` - miniconda_version=`echo $string | cut -d " " -f 2` - wget https://repo.continuum.io/miniconda/Miniconda2-$miniconda_version-Linux-x86_64.sh -O $PREFIX/miniconda.sh; - bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda - PYTHONHOME=$PREFIX/miniconda/bin - export PATH="$PYTHONHOME:$PATH" - - conda install -y -q conda-build conda-env - conda install -y -q conda-verify - conda env update -n root -f $DIR/environment.yml - - echo "Building Savu..." - conda build $DIR/$savu_recipe - savubuild=`conda build $DIR/$savu_recipe --output` - echo "Installing Savu..." - conda install -y -q --use-local $savubuild - - path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") - savu_path=${path%/savu/__init__.pyc} - - # get the savu version - install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") - recipes=$savu_path/$install_path/conda-recipes - - launcher_path=`command -v savu_launcher.sh` - launcher_path=${launcher_path%/savu_launcher.sh} - if [ "$facility" ]; then - cp $savu_path/system_files/$facility/mpi/savu_launcher.sh $launcher_path - cp $savu_path/system_files/$facility/mpi/savu_mpijob.sh $launcher_path - fi - - - - #----------------------------------------------------------------- - echo "Building astra toolbox..." - conda build $recipes/astra - astrabuild=`conda build $recipes/astra --output` - - echo "Installing astra toolbox..." - conda install -y -q --use-local $astrabuild - - site_path=$(python -c "import site; print site.getsitepackages()[0]") - cp $recipes/astra/astra.pth $site_path - astra_lib_path=$site_path/astra/lib - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building xraylib..." - conda build $recipes/xraylib - xraylibbuild=`conda build $recipes/xraylib --output` - - echo "Installing xraylib..." - conda install -y -q --use-local $xraylibbuild --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing tomopy..." - # these packages were missing in copied environment - string=`awk '/^tomopy/' $versions_file` - tomopy_version=`echo $string | cut -d " " -f 2` - string=`awk '/^dxchange/' $versions_file` - dxchange_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c dgursoy tomopy==$tomopy_version --no-deps - conda install -y -q -c dgursoy dxchange==$dxchange_version --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing ccpi-reconstruction" - string=`awk '/^ccpi/' $versions_file` - ccpi_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c ccpi ccpi-reconstruction==$ccpi_version -c conda-forge --no-deps - conda install -y -q -c ccpi cil_reconstruction==$ccpi_version -c conda-forge --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing pyfai" - string=`awk '/^pyfai/' $versions_file` - pyfai_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c conda-forge pyfai==$pyfai_version --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing mpi4py..." - pip uninstall -y -q mpi4py || true - string=`awk '/^mpi4py/' $versions_file` - mpi4py_version=`echo $string | cut -d " " -f 2` - env MPICC=$MPICC pip install mpi4py==$mpi4py_version - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building hdf5..." - conda uninstall -y -q hdf5 || true - conda build $recipes/hdf5 - hdf5build=`conda build $recipes/hdf5 --output` - - echo "Installing hdf5..." - conda install -y -q --use-local $hdf5build - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building h5py..." - conda uninstall -y -q h5py || true - conda build $recipes/h5py --no-test - h5pybuild=`conda build $recipes/h5py --output` - - echo "Installing h5py..." - conda install -y -q --use-local $h5pybuild - #----------------------------------------------------------------- - - - echo -e "\n\t***************************************************" - echo -e "\t Package installation complete" - echo -e "\t Check $error_log for errors" - echo -e "\t***************************************************\n" - -fi - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(nvidia-smi -L | wc -l) - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - -fi - -if [ ! $test_flag ] ; then - - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICES================================" - echo -e "If you are installing Savu for cluster use, you will need to update the savu " - echo -e "launcher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you" - echo -e "open a new terminal. Alternatively, if you are using the Modules system, see" - echo -e "$DIR/module_template for an example module file." - echo -e "================================================================================\n" - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_3_1_install/savu_v2.3.1/savu_master/build.sh b/install/2_3_1_install/savu_v2.3.1/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_3_1_install/savu_v2.3.1/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_3_1_install/savu_v2.3.1/savu_master/meta.yaml b/install/2_3_1_install/savu_v2.3.1/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_3_1_install/savu_v2.3.1/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_3_1_install/savu_v2.3.1/version.txt b/install/2_3_1_install/savu_v2.3.1/version.txt deleted file mode 100644 index 090c0b654..000000000 --- a/install/2_3_1_install/savu_v2.3.1/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.3.1 - diff --git a/install/2_3_1_install/savu_v2.3.1/versions_file.txt b/install/2_3_1_install/savu_v2.3.1/versions_file.txt deleted file mode 100644 index 116a12c1a..000000000 --- a/install/2_3_1_install/savu_v2.3.1/versions_file.txt +++ /dev/null @@ -1,7 +0,0 @@ -miniconda 4.5.4 # change this to 'latest' for latest version -mpi4py 3.0.0 -tomopy 1.0.1 -dxchange 0.1.1 -ccpi 0.10.0 -pyfai 0.15.0 - diff --git a/install/2_3_1_install/tests/local_mpi_cpu_test.sh b/install/2_3_1_install/tests/local_mpi_cpu_test.sh deleted file mode 100644 index 586af6a0b..000000000 --- a/install/2_3_1_install/tests/local_mpi_cpu_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 1 ]] ; do - if [ $1 == $flag ] ; then - eval "$return"=$2 - fi - shift - done -} - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." - - -arg_parse "-r" redirect "$@" -if [ $redirect ] ; then - exec 4<&2 - exec 5<&1 - exec &> $redirect -fi - -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - -if [ $redirect ] ; then - exec 2<&4 - exec 1<&5 -fi - diff --git a/install/2_3_1_install/tests/local_mpi_gpu_test.sh b/install/2_3_1_install/tests/local_mpi_gpu_test.sh deleted file mode 100644 index 44cf9bbfd..000000000 --- a/install/2_3_1_install/tests/local_mpi_gpu_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 1 ]] ; do - if [ $1 == $flag ] ; then - eval "$return"=$2 - fi - shift - done -} - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." - - -arg_parse "-r" redirect "$@" -if [ $redirect ] ; then - exec 4<&2 - exec 5<&1 - exec &> $redirect -fi - -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - -if [ $redirect ] ; then - exec 2<&4 - exec 1<&5 -fi - diff --git a/install/2_3_1_install/tests/mpi_cpu_test.sh b/install/2_3_1_install/tests/mpi_cpu_test.sh deleted file mode 100644 index 105afebcd..000000000 --- a/install/2_3_1_install/tests/mpi_cpu_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# get the loaded module version of savu -IN=$LOADEDMODULES -while IFS=':' read -ra ADDR; do - for i in "${ADDR[@]}"; do - if [[ $i == *"savu"* ]]; then - version=`echo "$i" | awk -F/ '{print $NF}'` - fi - done -done <<< "$IN" - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." -savu_launcher.sh $version $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/2_3_1_install/tests/mpi_gpu_test.sh b/install/2_3_1_install/tests/mpi_gpu_test.sh deleted file mode 100644 index fa07b4653..000000000 --- a/install/2_3_1_install/tests/mpi_gpu_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# get the loaded module version of savu -IN=$LOADEDMODULES -while IFS=':' read -ra ADDR; do - for i in "${ADDR[@]}"; do - if [[ $i == *"savu"* ]]; then - version=`echo "$i" | awk -F/ '{print $NF}'` - fi - done -done <<< "$IN" - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." -savu_launcher.sh $version $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/2_3_1_install/tests/test_setup.sh b/install/2_3_1_install/tests/test_setup.sh deleted file mode 100644 index 90a35b203..000000000 --- a/install/2_3_1_install/tests/test_setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -savu_path=$(python -c "import savu; import os; print os.path.abspath(os.path.dirname(savu.__file__))") -test_path=$savu_path'/../test_data' -export TESTDATA=$test_path -echo '$TESTDATA points to the Savu test data folder at' $TESTDATA - diff --git a/install/2_3_install/__init__.py b/install/2_3_install/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/2_3_install/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/2_3_install/conda-recipes/__init__.py b/install/2_3_install/conda-recipes/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/2_3_install/conda-recipes/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/2_3_install/conda-recipes/astra/astra.pth b/install/2_3_install/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/2_3_install/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/2_3_install/conda-recipes/astra/build.sh b/install/2_3_install/conda-recipes/astra/build.sh deleted file mode 100644 index acd72a6d6..000000000 --- a/install/2_3_install/conda-recipes/astra/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -savu_path=`command -v savu` -ana_path=${savu_path%/savu} -prefix=${ana_path%/bin}/lib/python2.7/site-packages/astra -export PATH=$ana_path:$PATH - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/2_3_install/conda-recipes/astra/meta.yaml b/install/2_3_install/conda-recipes/astra/meta.yaml deleted file mode 100644 index 4a04c0bc4..000000000 --- a/install/2_3_install/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.8" %} - -package: - name: astra-toolbox - version: 1.8 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: 44602e0eb0789a557622eae959fc0a067d81396bcb79ec315cb39b59d52322e7 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/2_3_install/conda-recipes/h5py/build.sh b/install/2_3_install/conda-recipes/h5py/build.sh deleted file mode 100644 index 055293a33..000000000 --- a/install/2_3_install/conda-recipes/h5py/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` - -# set anaconda distribution -ana_path=$(command -v savu) -ana_path=${ana_path%/bin/savu} -hdf5_version=1.10.1 -hdf5_build_no=1 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --hdf5=$ana_path -$PYTHON setup.py configure --hdf5-version=$hdf5_version -$PYTHON setup.py configure --mpi -$PYTHON setup.py build -$PYTHON setup.py install - diff --git a/install/2_3_install/conda-recipes/h5py/meta.yaml b/install/2_3_install/conda-recipes/h5py/meta.yaml deleted file mode 100644 index 72a4fd80d..000000000 --- a/install/2_3_install/conda-recipes/h5py/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "2.7.0" %} # change this - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz -requirements: - build: - - python - - numpy - - hdf5 - - cython - - pkgconfig - - six - -build: - number: 1 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) - diff --git a/install/2_3_install/conda-recipes/hdf5/build.sh b/install/2_3_install/conda-recipes/hdf5/build.sh deleted file mode 100644 index add607820..000000000 --- a/install/2_3_install/conda-recipes/hdf5/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH - -# check anaconda distribution -ana_path=$(command -v savu) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples - diff --git a/install/2_3_install/conda-recipes/hdf5/meta.yaml b/install/2_3_install/conda-recipes/hdf5/meta.yaml deleted file mode 100644 index a12ea27a8..000000000 --- a/install/2_3_install/conda-recipes/hdf5/meta.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{% set version = "1.10.1" %} -{% set release = "hdf5-1.10" %} -{% set patch = "hdf5-1.10.1" %} - -package: - name: hdf5 - version: {{ version }} - -source: - fn: {{ patch }}.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ release }}/{{ patch }}/src/{{ patch }}.tar.bz2 - md5: d89893c05ee7ea8611b51bb39450d64e - -build: - number: 1 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) - diff --git a/install/2_3_install/conda-recipes/mpi4py/version.txt b/install/2_3_install/conda-recipes/mpi4py/version.txt deleted file mode 100644 index 6e1f4db18..000000000 --- a/install/2_3_install/conda-recipes/mpi4py/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.0.0 - diff --git a/install/2_3_install/conda-recipes/versions_file.txt b/install/2_3_install/conda-recipes/versions_file.txt deleted file mode 100644 index c19069226..000000000 --- a/install/2_3_install/conda-recipes/versions_file.txt +++ /dev/null @@ -1,6 +0,0 @@ -miniconda 4.3.30 # change this to 'latest' for latest version -mpi4py 2.0.0 -pyfai 0.13.1 -tomopy 1.0.1 -dxchange 0.1.1 - diff --git a/install/2_3_install/conda-recipes/xdesign/build.sh b/install/2_3_install/conda-recipes/xdesign/build.sh deleted file mode 100644 index b161f631b..000000000 --- a/install/2_3_install/conda-recipes/xdesign/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install - diff --git a/install/2_3_install/conda-recipes/xdesign/meta.yaml b/install/2_3_install/conda-recipes/xdesign/meta.yaml deleted file mode 100644 index 68693b427..000000000 --- a/install/2_3_install/conda-recipes/xdesign/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -package: - name: xdesign - version: '0.3.0' - -source: - git_url: https://github.com/tomography/xdesign.git - -build: - number: 0 - -requirements: - build: - - python - - setuptools - -about: - home: http://xdesign.readthedocs.io - license: BSD-3 - summary: 'Benchmarking and optimization tools for tomography.' - -# See -# http://docs.continuum.io/conda/build.html for -# more information about meta.yaml - diff --git a/install/2_3_install/conda-recipes/xraylib/build.sh b/install/2_3_install/conda-recipes/xraylib/build.sh deleted file mode 100644 index 8f0acd316..000000000 --- a/install/2_3_install/conda-recipes/xraylib/build.sh +++ /dev/null @@ -1,7 +0,0 @@ - -./configure --enable-python --disable-perl --disable-java \ - --disable-fortran2003 --disable-lua --prefix=$PREFIX -make -make check -make install - diff --git a/install/2_3_install/conda-recipes/xraylib/meta.yaml b/install/2_3_install/conda-recipes/xraylib/meta.yaml deleted file mode 100644 index f924056e2..000000000 --- a/install/2_3_install/conda-recipes/xraylib/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "3.3.0" %} - -package: - name: xraylib - version: {{ version }} - -source: - fn: xraylib-{{ version }}.tar.gz - url: https://xraylib.tomschoonjans.eu/xraylib-{{ version }}.tar.gz - sha256: a22a73b8d90eb752b034bab1a4cf6abdd81b8c7dc5020bcb22132d2ee7aacd42 - -build: - number: 0 - -requirements: - build: - - python - - setuptools - - numpy - - scipy >=0.7.0 - - cython - - swig - - autoconf - - libtool - - automake - diff --git a/install/2_3_install/savu_v2.3.1/environment.yml b/install/2_3_install/savu_v2.3.1/environment.yml deleted file mode 100644 index 6424d0694..000000000 --- a/install/2_3_install/savu_v2.3.1/environment.yml +++ /dev/null @@ -1,213 +0,0 @@ -name: root -channels: -- ccpi -- local -- dgursoy -- conda-forge -- defaults -dependencies: -- boost-cpp=1.64.0=0 -- ccpi-reconstruction=0.1=py27_0 -- boost=1.64.0=np113py27_2 -- bzip2=1.0.6=1 -- cairo=1.14.6=4 -- fontconfig=2.12.1=4 -- freetype=2.7=1 -- gettext=0.19.7=1 -- glib=2.51.4=0 -- icu=58.1=1 -- libnetcdf=4.4.1.1=7 -- libpng=1.6.28=0 -- matplotlib=2.0.2=np113py27_0 -- netcdf4=1.2.9=np113py27_0 -- pillow=4.1.1=py27_0 -- qt=5.6.2=3 -- alabaster=0.7.10=py27_0 -- asn1crypto=0.22.0=py27_0 -- astroid=1.4.9=py27_0 -- babel=2.4.0=py27_0 -- backports=1.0=py27_0 -- backports_abc=0.5=py27_0 -- beautifulsoup4=4.6.0=py27_0 -- bleach=1.5.0=py27_0 -- cffi=1.10.0=py27_0 -- chardet=3.0.4=py27_0 -- colorama=0.3.9=py27_0 -- conda=4.3.22=py27_0 -- conda-build=3.0.6=py27_0 -- conda-env=2.6.0=0 -- conda-verify=2.0.0=py27_0 -- configparser=3.5.0=py27_0 -- contextlib2=0.5.5=py27_0 -- cryptography=1.8.1=py27_0 -- curl=7.49.0=1 -- cycler=0.10.0=py27_0 -- cython=0.25.2=py27_0 -- dbus=1.10.10=0 -- decorator=4.0.11=py27_0 -- docutils=0.13.1=py27_0 -- entrypoints=0.2.2=py27_1 -- enum34=1.1.6=py27_0 -- expat=2.1.0=0 -- filelock=2.0.7=py27_0 -- funcsigs=1.0.2=py27_0 -- functools32=3.2.3.2=py27_0 -- futures=3.1.1=py27_0 -- get_terminal_size=1.0.0=py27_0 -- glob2=0.5=py27_0 -- gst-plugins-base=1.8.0=0 -- gstreamer=1.8.0=0 -- hdf4=4.2.12=1 -- html5lib=0.999=py27_0 -- idna=2.5=py27_0 -- imagesize=0.7.1=py27_0 -- ipaddress=1.0.18=py27_0 -- ipykernel=4.6.1=py27_0 -- ipython=5.3.0=py27_0 -- ipython_genutils=0.2.0=py27_0 -- isort=4.2.14=py27_0 -- jbig=2.1=0 -- jedi=0.10.2=py27_2 -- jinja2=2.9.6=py27_0 -- jpeg=9b=0 -- jsonschema=2.6.0=py27_0 -- jupyter_client=5.0.1=py27_0 -- jupyter_core=4.3.0=py27_0 -- lazy-object-proxy=1.2.2=py27_0 -- libffi=3.2.1=1 -- libgcc=5.2.0=0 -- libgfortran=3.0.0=1 -- libiconv=1.14=0 -- libsodium=1.0.10=0 -- libtiff=4.0.6=3 -- libxcb=1.12=1 -- libxml2=2.9.4=0 -- markupsafe=0.23=py27_2 -- mistune=0.7.4=py27_0 -- mkl=2017.0.1=0 -- mock=2.0.0=py27_0 -- mpmath=0.19=py27_1 -- nbconvert=5.2.1=py27_0 -- nbformat=4.3.0=py27_0 -- networkx=1.11=py27_0 -- numexpr=2.6.2=np113py27_0 -- numpy=1.13.0=py27_0 -- numpydoc=0.6.0=py27_0 -- olefile=0.44=py27_0 -- openssl=1.0.2l=0 -- packaging=16.8=py27_0 -- pandas=0.20.2=np113py27_0 -- pandocfilters=1.4.1=py27_0 -- patchelf=0.9=0 -- path.py=10.3.1=py27_0 -- pathlib2=2.2.1=py27_0 -- pbr=1.10.0=py27_0 -- pcre=8.39=1 -- pep8=1.7.0=py27_0 -- pexpect=4.2.1=py27_0 -- pickleshare=0.7.4=py27_0 -- pip=9.0.1=py27_1 -- pixman=0.34.0=0 -- pkginfo=1.4.1=py27_0 -- prompt_toolkit=1.0.14=py27_0 -- psutil=5.2.2=py27_0 -- ptyprocess=0.5.1=py27_0 -- py=1.4.34=py27_0 -- pycairo=1.10.0=py27_0 -- pycosat=0.6.2=py27_0 -- pycparser=2.17=py27_0 -- pycrypto=2.6.1=py27_6 -- pyflakes=1.5.0=py27_0 -- pygments=2.2.0=py27_0 -- pylint=1.6.4=py27_1 -- pyopenssl=17.0.0=py27_0 -- pyparsing=2.1.4=py27_0 -- pyqt=5.6.0=py27_2 -- pytest=3.1.2=py27_0 -- python=2.7.13=0 -- python-dateutil=2.6.0=py27_0 -- pytz=2017.2=py27_0 -- pyyaml=3.12=py27_0 -- pyzmq=16.0.2=py27_0 -- qtawesome=0.4.4=py27_0 -- qtconsole=4.3.0=py27_0 -- qtpy=1.2.1=py27_0 -- readline=6.2=2 -- requests=2.14.2=py27_0 -- rope=0.9.4=py27_1 -- ruamel_yaml=0.11.14=py27_1 -- scandir=1.5=py27_0 -- scikit-image=0.13.0=np113py27_0 -- scikit-learn=0.18.1=np113py27_1 -- scipy=0.19.0=np113py27_0 -- setuptools=27.2.0=py27_0 -- simplegeneric=0.8.1=py27_1 -- singledispatch=3.4.0.3=py27_0 -- sip=4.18=py27_0 -- six=1.10.0=py27_0 -- snowballstemmer=1.2.1=py27_0 -- sphinx=1.6.2=py27_0 -- sphinxcontrib=1.0=py27_0 -- sphinxcontrib-websupport=1.0.1=py27_0 -- spyder=3.1.4=py27_0 -- sqlite=3.13.0=0 -- ssl_match_hostname=3.4.0.2=py27_1 -- subprocess32=3.2.7=py27_0 -- sympy=1.0=py27_0 -- testpath=0.3.1=py27_0 -- tk=8.5.18=0 -- tornado=4.5.1=py27_0 -- traitlets=4.3.2=py27_0 -- typing=3.6.1=py27_0 -- wcwidth=0.1.7=py27_0 -- wheel=0.29.0=py27_0 -- wrapt=1.10.10=py27_0 -- xz=5.2.2=1 -- yaml=0.1.6=0 -- zeromq=4.1.5=0 -- zlib=1.2.8=3 -- dxchange=0.1.1=py27_0 -- dxfile=0.4=py27_0 -- edffile=1.6=py27_0 -- fftw=3.3.4=0 -- pyfftw=0.9.2=py27_0 -- pywavelets=0.4.0=py27_0 -- spefile=1.6=py27_0 -- tifffile=0.7.0=py27_0 -- tomopy=1.0.1=py27_0 -- pip: - - appdirs==1.4.3 - - backports-abc==0.5 - - backports.shutil-get-terminal-size==1.0.0 - - backports.ssl-match-hostname==3.4.0.2 - - cached-property==1.3.0 - - fabio==0.4.0 - - fisx==1.1.2 - - ipython-genutils==0.2.0 - - ipywidgets==6.0.0 - - jupyter==1.0.0 - - jupyter-client==5.0.1 - - jupyter-console==5.1.0 - - jupyter-core==4.3.0 - - lmfit==0.9.7 - - mako==1.0.6 - - mrcfile==1.0.0 - - notebook==5.0.0 - - nvidia-ml-py==375.53 - - peakutils==1.1.0 - - phasepack==1.5 - - polytope==0.2.0 - - prompt-toolkit==1.0.14 - - pymca==5.2.1 - - pymca5==5.2.2 - - gnureadline==6.3.8 - - pyreadline==2.1 - - pytools==2017.3 - - readme-renderer==17.2 - - restview==2.7.0 - - simpleitk==1.0.0 - - sphinx-rtd-theme==0.2.4 - - terminado==0.6 - - webencodings==0.5.1 - - widgetsnbextension==2.0.0 - diff --git a/install/2_3_install/savu_v2.3.1/savu/build.sh b/install/2_3_install/savu_v2.3.1/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_3_install/savu_v2.3.1/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_3_install/savu_v2.3.1/savu/meta.yaml b/install/2_3_install/savu_v2.3.1/savu/meta.yaml deleted file mode 100644 index 131389903..000000000 --- a/install/2_3_install/savu_v2.3.1/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.3.1" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_3_install/savu_v2.3.1/savu_installer.sh b/install/2_3_install/savu_v2.3.1/savu_installer.sh deleted file mode 100644 index 71f5178d8..000000000 --- a/install/2_3_install/savu_v2.3.1/savu_installer.sh +++ /dev/null @@ -1,437 +0,0 @@ -#!/bin/bash -ex - -# change to 'latest' for the latest version -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -versions_file=$DIR/../conda-recipes/versions_file.txt - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX="${PREFIX:-$HOME}" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -if [ ! $test_flag ] ; then - - echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - - unset IFS - string=`awk '/^miniconda/' $versions_file` - miniconda_version=`echo $string | cut -d " " -f 2` - wget https://repo.continuum.io/miniconda/Miniconda2-$miniconda_version-Linux-x86_64.sh -O $PREFIX/miniconda.sh; - bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda - PYTHONHOME=$PREFIX/miniconda/bin - export PATH="$PYTHONHOME:$PATH" - - conda install -y -q conda-build conda-env - - conda env update -n root -f $DIR/environment.yml - - echo "Building Savu..." - conda build $DIR/$savu_recipe - savubuild=`conda build $DIR/$savu_recipe --output` - echo "Installing Savu..." - conda install -y -q --use-local $savubuild - - path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") - savu_path=${path%/savu/__init__.pyc} - - # get the savu version - install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") - recipes=$savu_path/$install_path/conda-recipes - - launcher_path=`command -v savu_launcher.sh` - launcher_path=${launcher_path%/savu_launcher.sh} - if [ "$facility" ]; then - cp $savu_path/system_files/$facility/mpi/savu_launcher.sh $launcher_path - cp $savu_path/system_files/$facility/mpi/savu_mpijob.sh $launcher_path - fi - - #----------------------------------------------------------------- - echo "Installing pyfai..." - string=`awk '/^pyfai/' $versions_file` - pyfai_version=`echo $string | cut -d " " -f 2` - pip install pyfai==$pyfai_version - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing mpi4py..." - string=`awk '/^mpi4py/' $versions_file` - mpi4py_version=`echo $string | cut -d " " -f 2` - env MPICC=$MPICC pip install mpi4py==$mpi4py_version - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building hdf5..." - conda uninstall -y -q hdf5 || true - conda build $recipes/hdf5 - hdf5build=`conda build $recipes/hdf5 --output` - - echo "Installing hdf5..." - conda install -y -q --use-local $hdf5build --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building h5py..." - conda uninstall -y -q h5py || true - conda build $recipes/h5py --no-test - h5pybuild=`conda build $recipes/h5py --output` - - echo "Installing h5py..." - conda install -y -q --use-local $h5pybuild --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building astra toolbox..." - conda build $recipes/astra - astrabuild=`conda build $recipes/astra --output` - - echo "Installing astra toolbox..." - conda install -y -q --use-local $astrabuild --no-deps - - site_path=$(python -c "import site; print site.getsitepackages()[0]") - cp $recipes/astra/astra.pth $site_path - astra_lib_path=$site_path/astra/lib - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building xraylib..." - conda build $recipes/xraylib - xraylibbuild=`conda build $recipes/xraylib --output` - - echo "Installing xraylib..." - conda install -y -q --use-local $xraylibbuild --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing tomopy..." - # these packages were missing in copied environment - string=`awk '/^tomopy/' $versions_file` - tomopy_version=`echo $string | cut -d " " -f 2` - string=`awk '/^dxchange/' $versions_file` - dxchange_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c dgursoy tomopy==$tomopy_version --no-deps - conda install -y -q -c dgursoy dxchange==$dxchange_version --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - #echo "Building xdesign" - #conda build $recipes/xdesign - #xdesignbuild=`conda build $recipes/xdesign --output` - - #echo "Installing xdesign" - #conda install -y -q --use-local $xdesignbuild --no-deps - #----------------------------------------------------------------- - - echo -e "\n\t***************************************************" - echo -e "\t Package installation complete" - echo -e "\t Check $error_log for errors" - echo -e "\t***************************************************\n" - -fi - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(nvidia-smi -L | wc -l) - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - -fi - -if [ ! $test_flag ] ; then - - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICES================================" - echo -e "If you are installing Savu for cluster use, you will need to update the savu " - echo -e "launcher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you" - echo -e "open a new terminal. Alternatively, if you are using the Modules system, see" - echo -e "$DIR/module_template for an example module file." - echo -e "================================================================================\n" - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_3_install/savu_v2.3.1/savu_master/build.sh b/install/2_3_install/savu_v2.3.1/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_3_install/savu_v2.3.1/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_3_install/savu_v2.3.1/savu_master/meta.yaml b/install/2_3_install/savu_v2.3.1/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_3_install/savu_v2.3.1/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_3_install/savu_v2.3.1/version.txt b/install/2_3_install/savu_v2.3.1/version.txt deleted file mode 100644 index 2bf1c1ccf..000000000 --- a/install/2_3_install/savu_v2.3.1/version.txt +++ /dev/null @@ -1 +0,0 @@ -2.3.1 diff --git a/install/2_3_install/savu_v2.3.tar.gz b/install/2_3_install/savu_v2.3.tar.gz deleted file mode 100644 index 66288b4db..000000000 Binary files a/install/2_3_install/savu_v2.3.tar.gz and /dev/null differ diff --git a/install/2_3_install/savu_v2.3/environment.yml b/install/2_3_install/savu_v2.3/environment.yml deleted file mode 100644 index 095f74dcf..000000000 --- a/install/2_3_install/savu_v2.3/environment.yml +++ /dev/null @@ -1,253 +0,0 @@ -name: root -channels: - - ccpi - - tom.schoonjans - - local - - conda-forge - - defaults -dependencies: - - boost-cpp=1.64.0=1 - - ccpi-reconstruction=0.9=py27_0 - - alabaster=0.7.10=py27_1 - - asn1crypto=0.24.0=py27_0 - - astroid=1.6.3=py27_0 - - attrs=18.1.0=py_0 - - babel=2.5.3=py27_0 - - backports=1.0=py27_1 - - backports.functools_lru_cache=1.5=py27_0 - - backports.lzma=0.0.10=py27_0 - - backports.shutil_get_terminal_size=1.0.0=py_3 - - backports_abc=0.5=py27_0 - - beautifulsoup4=4.6.0=py27_0 - - bleach=2.1.3=py_0 - - boost=1.64.0=py27_4 - - bzip2=1.0.6=1 - - ca-certificates=2018.4.16=0 - - cairo=1.14.10=0 - - certifi=2018.4.16=py27_0 - - cffi=1.11.5=py27_0 - - cftime=1.0.0b1=py27_0 - - chardet=3.0.4=py27_0 - - cloudpickle=0.5.3=py_0 - - colorama=0.3.9=py27_0 - - conda=4.5.4=py27_0 - - conda-build=3.10.2=py27_0 - - conda-env=2.6.0=0 - - conda-verify=2.0.0=py27_0 - - configparser=3.5.0=py27_0 - - contextlib2=0.5.5=py27_1 - - cryptography=2.2.1=py27_0 - - curl=7.59.0=1 - - cycler=0.10.0=py27_0 - - cython=0.28.2=py27_0 - - dask-core=0.17.4=py_0 - - dbus=1.11.0=0 - - decorator=4.3.0=py_0 - - docutils=0.14=py27_0 - - edffile=5.0.0=py27_0 - - entrypoints=0.2.3=py27_1 - - enum34=1.1.6=py27_1 - - expat=2.2.5=0 - - fastcache=1.0.2=py27_0 - - fftw=3.3.7=0 - - filelock=3.0.4=py27_0 - - fontconfig=2.12.6=0 - - freetype=2.8.1=0 - - funcsigs=1.0.2=py_2 - - functools32=3.2.3.2=py27_2 - - futures=3.2.0=py27_0 - - gettext=0.19.8.1=0 - - glib=2.55.0=0 - - glob2=0.5=py27_0 - - gmp=6.1.2=0 - - gmpy2=2.0.8=py27_0 - - gst-plugins-base=1.8.0=0 - - gstreamer=1.8.0=1 - - hdf4=4.2.13=0 - - html5lib=1.0.1=py_0 - - icu=58.2=0 - - idna=2.6=py27_1 - - imageio=2.3.0=py27_0 - - imagesize=1.0.0=py27_0 - - ipaddress=1.0.22=py_1 - - ipykernel=4.8.2=py27_0 - - ipython=5.7.0=py27_0 - - ipython_genutils=0.2.0=py27_0 - - isort=4.3.4=py27_0 - - jbig=2.1=0 - - jedi=0.12.0=py27_0 - - jinja2=2.10=py27_0 - - jpeg=9b=2 - - jsonschema=2.6.0=py27_1 - - jupyter_client=5.2.3=py27_0 - - jupyter_core=4.4.0=py_0 - - kiwisolver=1.0.1=py27_1 - - krb5=1.14.6=0 - - lazy-object-proxy=1.3.1=py27_0 - - libedit=3.1.20170329=0 - - libffi=3.2.1=3 - - libiconv=1.15=0 - - libpng=1.6.34=0 - - libsodium=1.0.16=0 - - libssh2=1.8.0=2 - - libtiff=4.0.9=0 - - libxcb=1.13=0 - - libxml2=2.9.8=0 - - linecache2=1.0.0=py27_0 - - mako=1.0.7=py27_0 - - markupsafe=1.0=py27_0 - - matplotlib=2.2.2=py27_1 - - mccabe=0.6.1=py27_0 - - mistune=0.8.3=py27_1 - - mock=2.0.0=py27_0 - - more-itertools=4.1.0=py_0 - - mpc=1.1.0=5 - - mpfr=4.0.1=0 - - mpmath=1.0.0=py_0 - - nbconvert=5.3.1=py_1 - - nbformat=4.4.0=py27_0 - - ncurses=5.9=10 - - networkx=2.1=py27_0 - - numexpr=2.6.5=py27_0 - - numpydoc=0.8.0=py27_0 - - olefile=0.45.1=py27_0 - - openblas=0.2.20=7 - - openssl=1.0.2o=0 - - packaging=17.1=py_0 - - pandas=0.23.0=py27_0 - - pandoc=2.2.1=0 - - pandocfilters=1.4.2=py27_0 - - parso=0.2.0=py_0 - - patchelf=0.9=2 - - path.py=10.3.1=py27_0 - - pathlib2=2.3.2=py27_0 - - pbr=4.0.2=py_0 - - pcre=8.41=1 - - pep8=1.7.1=py_0 - - pexpect=4.5.0=py27_0 - - pickleshare=0.7.4=py27_0 - - pillow=5.1.0=py27_0 - - pip=9.0.3=py27_0 - - pixman=0.34.0=2 - - pkginfo=1.4.2=py27_0 - - pluggy=0.6.0=py_0 - - prompt_toolkit=1.0.15=py27_0 - - psutil=5.4.5=py27_0 - - ptyprocess=0.5.2=py27_0 - - py=1.5.3=py_0 - - pycairo=1.16.3=py27_0 - - pycodestyle=2.4.0=py27_0 - - pycosat=0.6.3=py27_0 - - pycparser=2.18=py27_0 - - pycrypto=2.6.1=py27_1 - - pyfftw=0.10.4=py27_3 - - pyflakes=1.6.0=py27_0 - - pygments=2.2.0=py27_0 - - pylint=1.8.4=py27_0 - - pyopenssl=17.5.0=py27_1 - - pyparsing=2.2.0=py27_0 - - pyqt=5.6.0=py27_5 - - pytest=3.5.1=py27_0 - - python=2.7.15=0 - - python-dateutil=2.7.3=py_0 - - pytz=2018.4=py_0 - - pywavelets=0.5.2=py27_1 - - pyyaml=3.12=py27_1 - - pyzmq=17.0.0=py27_4 - - qt=5.6.2=7 - - qtawesome=0.4.4=py27_0 - - qtconsole=4.3.1=py27_0 - - qtpy=1.4.2=py27h8a2030e_0 - - readline=7.0=0 - - reikna=0.6.8=py27_0 - - requests=2.18.4=py27_1 - - rope=0.10.7=py27_0 - - ruamel_yaml=0.15.37=py27h470a237_0 - - scandir=1.7=py27_0 - - scikit-image=0.13.1=py27_0 - - setuptools=39.1.0=py27_0 - - simplegeneric=0.8.1=py27_0 - - singledispatch=3.4.0.3=py27_0 - - sip=4.18=py27_1 - - six=1.11.0=py27_1 - - snowballstemmer=1.2.1=py27_0 - - spefile=1.6=py_1 - - sphinx=1.7.4=py27_0 - - sphinxcontrib-websupport=1.0.1=py27_0 - - spyder=3.2.8=py27_0 - - sqlite=3.20.1=2 - - ssl_match_hostname=3.5.0.1=py27_1 - - subprocess32=3.5.0=py27_0 - - sympy=1.1.1=py27_0 - - testpath=0.3.1=py27_0 - - tifffile=0.14.0=py27_1 - - tk=8.6.7=0 - - toolz=0.9.0=py_0 - - tornado=5.0.2=py27_0 - - traceback2=1.4.0=py27_0 - - traitlets=4.3.2=py27_0 - - typing=3.6.4=py27_0 - - unittest2=1.1.0=py_0 - - wcwidth=0.1.7=py27_0 - - webencodings=0.5=py27_0 - - wheel=0.31.0=py27_0 - - wrapt=1.10.11=py27_0 - - xorg-libxau=1.0.8=3 - - xorg-libxdmcp=1.1.2=3 - - xz=5.2.3=0 - - yaml=0.1.7=0 - - zeromq=4.2.5=1 - - zlib=1.2.11=0 - - blas=1.0=mkl - - configobj=5.0.6=py27_0 - - get_terminal_size=1.0.0=haa9412d_0 - - intel-openmp=2018.0.0=8 - - libgcc=7.2.0=h69d50b8_2 - - libgcc-ng=7.2.0=hdf63c60_3 - - libgfortran=3.0.0=1 - - libgfortran-ng=7.2.0=hdf63c60_3 - - libstdcxx-ng=7.2.0=hdf63c60_3 - - mkl=2018.0.2=1 - - mkl_fft=1.0.1=py27h3010b51_0 - - mkl_random=1.0.1=py27h629b387_0 - - numpy=1.14.2=py27hdbf6ddf_1 - - pysocks=1.6.8=py27_0 - - scikit-learn=0.19.1=py27h445a80a_0 - - scipy=1.1.0=py27hfc37229_0 - - sphinxcontrib=1.0=py27h1512b58_1 - - urllib3=1.22=py27ha55213b_0 - - dreampy=0.1=py27_0 - - pip: - - appdirs==1.4.3 - - asteval==0.9.12 - - backports.ssl-match-hostname==3.5.0.1 - - cached-property==1.4.2 - - cmarkgfm==0.4.2 - - dask==0.17.4 - - fabio==0.6.0 - - fisx==1.1.4 - - future==0.16.0 - - ipywidgets==7.2.1 - - jupyter==1.0.0 - - jupyter-console==5.2.0 - - lmfit==0.9.9 - - mrcfile==1.0.4 - - notebook==5.5.0 - - nvidia-ml-py==7.352.0 - - peakutils==1.1.1 - - phasepack==1.5 - - polytope==0.2.1 - - pyfai==0.15.0 - - pymca==5.3.1 - - pymca5==5.3.1 - - pyreadline==2.1 - - pytools==2018.4 - - readme-renderer==20.0 - - restview==2.9.0 - - send2trash==1.5.0 - - silx==0.7.0 - - simpleitk==1.1.0 - - sphinx-rtd-theme==0.3.1 - - terminado==0.8.1 - - widgetsnbextension==3.2.1 - diff --git a/install/2_3_install/savu_v2.3/savu/build.sh b/install/2_3_install/savu_v2.3/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_3_install/savu_v2.3/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_3_install/savu_v2.3/savu/meta.yaml b/install/2_3_install/savu_v2.3/savu/meta.yaml deleted file mode 100644 index d69f99c70..000000000 --- a/install/2_3_install/savu_v2.3/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.3" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_3_install/savu_v2.3/savu_installer.sh b/install/2_3_install/savu_v2.3/savu_installer.sh deleted file mode 100644 index da4f5b2a0..000000000 --- a/install/2_3_install/savu_v2.3/savu_installer.sh +++ /dev/null @@ -1,445 +0,0 @@ -#!/bin/bash -ex - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX="${PREFIX:-$HOME}" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -if [ ! $test_flag ] ; then - - echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O $PREFIX/miniconda.sh; - bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda - PYTHONHOME=$PREFIX/miniconda/bin - export PATH="$PYTHONHOME:$PATH" - - conda install -y -q conda-build conda-env - - conda env update -n root -f $DIR/environment.yml - - echo "Building Savu..." - conda build $DIR/$savu_recipe - savubuild=`conda build $DIR/$savu_recipe --output` - echo "Installing Savu..." - conda install -y -q --use-local $savubuild - - path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") - savu_path=${path%/savu/__init__.pyc} - - # get the savu version - install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") - recipes=$savu_path/$install_path/conda-recipes - - launcher_path=`command -v savu_launcher.sh` - launcher_path=${launcher_path%/savu_launcher.sh} - if [ "$facility" ]; then - cp $savu_path/system_files/$facility/mpi/savu_launcher.sh $launcher_path - cp $savu_path/system_files/$facility/mpi/savu_mpijob.sh $launcher_path - fi - - #----------------------------------------------------------------- - echo "Installing pyfai..." - pip install pyfai - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing mpi4py..." - mpi4py_version=`cat $recipes/mpi4py/version.txt` - env MPICC=$MPICC pip install mpi4py==$mpi4py_version - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building hdf5..." - conda uninstall -y -q hdf5 || true - conda build $recipes/hdf5 - hdf5build=`conda build $recipes/hdf5 --output` - - echo "Installing hdf5..." - conda install -y -q --use-local $hdf5build --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building h5py..." - conda uninstall -y -q h5py || true - conda build $recipes/h5py --no-test - h5pybuild=`conda build $recipes/h5py --output` - - echo "Installing h5py..." - conda install -y -q --use-local $h5pybuild --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building astra toolbox..." - conda build $recipes/astra - astrabuild=`conda build $recipes/astra --output` - - echo "Installing astra toolbox..." - conda install -y -q --use-local $astrabuild --no-deps - - site_path=$(python -c "import site; print site.getsitepackages()[0]") - cp $recipes/astra/astra.pth $site_path - astra_lib_path=$site_path/astra/lib - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building xraylib..." - conda build $recipes/xraylib - xraylibbuild=`conda build $recipes/xraylib --output` - - echo "Installing xraylib..." - conda install -y -q --use-local $xraylibbuild --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing tomopy..." - # these packages were missing in copied environment - conda install -y -q -c dgursoy tomopy --no-deps - conda install -y -q -c dgursoy dxchange --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - #echo "Building xdesign" - #conda build $recipes/xdesign - #xdesignbuild=`conda build $recipes/xdesign --output` - - #echo "Installing xdesign" - #conda install -y -q --use-local $xdesignbuild --no-deps - #----------------------------------------------------------------- - - echo -e "\n\t***************************************************" - echo -e "\t Package installation complete" - echo -e "\t Check $error_log for errors" - echo -e "\t***************************************************\n" - -fi - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(nvidia-smi -L | wc -l) - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - - echo -e "\n***** Running Savu MPI local CPU tests *****\n" - - local_mpi_cpu_test.sh $test_dir -r $tmpfile - - result=$(grep -i "Processing Complete" $tmpfile) - if [ ! $result ] ; then - echo -e "\n****The tests have errored: See $tmpfile for more details****\n" - else - echo -e "\n***Test successfully completed!***\n" - fi - - echo "The number of GPUs is", $nGPUs - if [ $nGPUs -gt 0 ] ; then - echo -e "\n***** Running Savu MPI local GPU tests *****\n" - local_mpi_gpu_test.sh $test_dir - else - echo -e "\n***** Skipping Savu MPI local GPU tests (no GPUs found) *****\n" - fi - - rm -r $test_dir - - echo -e "\n************** MPI local tests complete ******************\n" -fi - -if [ ! $test_flag ] ; then - - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICES================================" - echo -e "If you are installing Savu for cluster use, you will need to update the savu " - echo -e "launcher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you" - echo -e "open a new terminal. Alternatively, if you are using the Modules system, see" - echo -e "$DIR/module_template for an example module file." - echo -e "================================================================================\n" - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_3_install/savu_v2.3/savu_master/build.sh b/install/2_3_install/savu_v2.3/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_3_install/savu_v2.3/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_3_install/savu_v2.3/savu_master/meta.yaml b/install/2_3_install/savu_v2.3/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_3_install/savu_v2.3/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_3_install/savu_v2.3/version.txt b/install/2_3_install/savu_v2.3/version.txt deleted file mode 100644 index c3519eab0..000000000 --- a/install/2_3_install/savu_v2.3/version.txt +++ /dev/null @@ -1,3 +0,0 @@ -2.3 - - diff --git a/install/2_3_install/tests/local_mpi_cpu_test.sh b/install/2_3_install/tests/local_mpi_cpu_test.sh deleted file mode 100644 index 586af6a0b..000000000 --- a/install/2_3_install/tests/local_mpi_cpu_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 1 ]] ; do - if [ $1 == $flag ] ; then - eval "$return"=$2 - fi - shift - done -} - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." - - -arg_parse "-r" redirect "$@" -if [ $redirect ] ; then - exec 4<&2 - exec 5<&1 - exec &> $redirect -fi - -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - -if [ $redirect ] ; then - exec 2<&4 - exec 1<&5 -fi - diff --git a/install/2_3_install/tests/local_mpi_gpu_test.sh b/install/2_3_install/tests/local_mpi_gpu_test.sh deleted file mode 100644 index 44cf9bbfd..000000000 --- a/install/2_3_install/tests/local_mpi_gpu_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 1 ]] ; do - if [ $1 == $flag ] ; then - eval "$return"=$2 - fi - shift - done -} - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." - - -arg_parse "-r" redirect "$@" -if [ $redirect ] ; then - exec 4<&2 - exec 5<&1 - exec &> $redirect -fi - -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - -if [ $redirect ] ; then - exec 2<&4 - exec 1<&5 -fi - diff --git a/install/2_3_install/tests/mpi_cpu_test.sh b/install/2_3_install/tests/mpi_cpu_test.sh deleted file mode 100644 index 105afebcd..000000000 --- a/install/2_3_install/tests/mpi_cpu_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# get the loaded module version of savu -IN=$LOADEDMODULES -while IFS=':' read -ra ADDR; do - for i in "${ADDR[@]}"; do - if [[ $i == *"savu"* ]]; then - version=`echo "$i" | awk -F/ '{print $NF}'` - fi - done -done <<< "$IN" - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." -savu_launcher.sh $version $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/2_3_install/tests/mpi_gpu_test.sh b/install/2_3_install/tests/mpi_gpu_test.sh deleted file mode 100644 index fa07b4653..000000000 --- a/install/2_3_install/tests/mpi_gpu_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# get the loaded module version of savu -IN=$LOADEDMODULES -while IFS=':' read -ra ADDR; do - for i in "${ADDR[@]}"; do - if [[ $i == *"savu"* ]]; then - version=`echo "$i" | awk -F/ '{print $NF}'` - fi - done -done <<< "$IN" - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." -savu_launcher.sh $version $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/2_3_install/tests/test_setup.sh b/install/2_3_install/tests/test_setup.sh deleted file mode 100644 index 90a35b203..000000000 --- a/install/2_3_install/tests/test_setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -savu_path=$(python -c "import savu; import os; print os.path.abspath(os.path.dirname(savu.__file__))") -test_path=$savu_path'/../test_data' -export TESTDATA=$test_path -echo '$TESTDATA points to the Savu test data folder at' $TESTDATA - diff --git a/install/2_4_install/__init__.py b/install/2_4_install/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/2_4_install/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/2_4_install/conda-recipes/__init__.py b/install/2_4_install/conda-recipes/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/2_4_install/conda-recipes/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/2_4_install/conda-recipes/astra/astra.pth b/install/2_4_install/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/2_4_install/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/2_4_install/conda-recipes/astra/build.sh b/install/2_4_install/conda-recipes/astra/build.sh deleted file mode 100644 index acd72a6d6..000000000 --- a/install/2_4_install/conda-recipes/astra/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -savu_path=`command -v savu` -ana_path=${savu_path%/savu} -prefix=${ana_path%/bin}/lib/python2.7/site-packages/astra -export PATH=$ana_path:$PATH - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/2_4_install/conda-recipes/astra/meta.yaml b/install/2_4_install/conda-recipes/astra/meta.yaml deleted file mode 100644 index 4a04c0bc4..000000000 --- a/install/2_4_install/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.8" %} - -package: - name: astra-toolbox - version: 1.8 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: 44602e0eb0789a557622eae959fc0a067d81396bcb79ec315cb39b59d52322e7 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/2_4_install/conda-recipes/h5py/meta.yaml b/install/2_4_install/conda-recipes/h5py/meta.yaml deleted file mode 100644 index 375cefa71..000000000 --- a/install/2_4_install/conda-recipes/h5py/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "2.9.0" %} # change this - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz -requirements: - build: - - python - - numpy - - hdf5 - - cython - - pkgconfig - - six - -build: - number: 1 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) - diff --git a/install/2_4_install/conda-recipes/hdf5/build.sh b/install/2_4_install/conda-recipes/hdf5/build.sh deleted file mode 100644 index add607820..000000000 --- a/install/2_4_install/conda-recipes/hdf5/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH - -# check anaconda distribution -ana_path=$(command -v savu) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples - diff --git a/install/2_4_install/savu_v2.4.tar.gz b/install/2_4_install/savu_v2.4.tar.gz deleted file mode 100644 index 68840980b..000000000 Binary files a/install/2_4_install/savu_v2.4.tar.gz and /dev/null differ diff --git a/install/2_4_install/savu_v2.4/environment.yml b/install/2_4_install/savu_v2.4/environment.yml deleted file mode 100644 index 09139fbd7..000000000 --- a/install/2_4_install/savu_v2.4/environment.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: root -channels: -- local -- defaults -- conda-forge -- dkazanc -- ccpi -- astra-toolbox/label/dev -dependencies: -- cython -- spyder -- scipy -- pytest -- colorama -- setuptools -- jinja2 -- numpy -- pandas -- mock -- ipython -- matplotlib -- PyWavelets -- scikit-image -- scikit-learn -- tomobar -- tomophantom -- ccpi-regulariser -- larix -- ccpi-reconstruction -- astra-toolbox -- xraylib -- tomopy -- pyfai -- fabio -- pymca -- tifffile -- pyfftw -- PeakUtils -- pip -- yamllint -- pip: - - pyreadline - - nvidia-ml-py - - pmacparser - - gnureadline==6.3.8 - - sphinx-rtd-theme diff --git a/install/2_4_install/savu_v2.4/savu/build.sh b/install/2_4_install/savu_v2.4/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_4_install/savu_v2.4/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_4_install/savu_v2.4/savu/meta.yaml b/install/2_4_install/savu_v2.4/savu/meta.yaml deleted file mode 100644 index 812724eee..000000000 --- a/install/2_4_install/savu_v2.4/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.4" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_4_install/savu_v2.4/savu_installer.sh b/install/2_4_install/savu_v2.4/savu_installer.sh deleted file mode 100644 index a0cd943e4..000000000 --- a/install/2_4_install/savu_v2.4/savu_installer.sh +++ /dev/null @@ -1,402 +0,0 @@ -#!/bin/bash -ex - -# change to 'latest' for the latest version -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -versions_file=$DIR/versions_file.txt - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX="${PREFIX:-$HOME}" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the facility -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the conda folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the savu recipe -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -# override the conda recipes folder -arg_parse "-r" recipes "$@" - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -MPI_HOME=${MPICC%/mpicc} -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC - export PATH=$MPI_HOME:$PATH -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME - export PATH=$CUDAHOME/bin:$PATH - export LD_LIBRARY_PATH=$CUDAHOME/lib64:$LD_LIBRARY_PATH -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -if [ ! $test_flag ] ; then - - echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - - unset IFS - string=`awk '/^miniconda/' $versions_file` - miniconda_version=`echo $string | cut -d " " -f 2` - wget https://repo.continuum.io/miniconda/Miniconda2-$miniconda_version-Linux-x86_64.sh -O $PREFIX/miniconda.sh; - bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda - PYTHONHOME=$PREFIX/miniconda/bin - export PATH="$PYTHONHOME:$PATH" - - conda install -y -q conda-build conda-env - conda install -y -q conda-verify - - echo "Building Savu..." - conda build $DIR/$savu_recipe - savubuild=`conda build $DIR/$savu_recipe --output` - echo "Installing Savu..." - conda install -y -q --use-local $savubuild - - path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") - savu_path=${path%/savu/__init__.pyc} - - # get the savu version - if [ -z $recipes ] ; then - install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") - recipes=$savu_path/$install_path/conda-recipes - fi - - launcher_path=`command -v savu_launcher.sh` - launcher_path=${launcher_path%/savu_launcher.sh} - if [ "$facility" ]; then - cp $savu_path/system_files/$facility/mpi/savu_launcher.sh $launcher_path - cp $savu_path/system_files/$facility/mpi/savu_mpijob.sh $launcher_path - fi - - # moving things here to see if this works better - #----------------------------------------------------------------- - echo "Installing mpi4py..." - pip uninstall -y -q mpi4py || true - string=`awk '/^mpi4py/' $versions_file` - mpi4py_version=`echo $string | cut -d " " -f 2` - pip install mpi4py==$mpi4py_version - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building hdf5..." - conda uninstall -y -q hdf5 || true - conda build $recipes/hdf5 - hdf5build=`conda build $recipes/hdf5 --output` - - echo "Installing hdf5..." - conda install -y -q --use-local $hdf5build - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building h5py..." - conda uninstall -y -q h5py || true - conda build $recipes/h5py --no-test - h5pybuild=`conda build $recipes/h5py --output` - - echo "Installing h5py..." - conda install -y -q --use-local $h5pybuild - #----------------------------------------------------------------- - - - conda env update -n root -f $DIR/environment.yml - - - echo -e "\n\t***************************************************" - echo -e "\t Package installation complete" - echo -e "\t Check $error_log for errors" - echo -e "\t***************************************************\n" - -fi - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(nvidia-smi -L | wc -l) - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - -fi - -if [ ! $test_flag ] ; then - - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICES================================" - echo -e "If you are installing Savu for cluster use, you will need to update the savu " - echo -e "launcher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you" - echo -e "open a new terminal. Alternatively, if you are using the Modules system, see" - echo -e "$DIR/module_template for an example module file." - echo -e "================================================================================\n" - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/2_4_install/savu_v2.4/savu_master/build.sh b/install/2_4_install/savu_v2.4/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/2_4_install/savu_v2.4/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_4_install/savu_v2.4/savu_master/meta.yaml b/install/2_4_install/savu_v2.4/savu_master/meta.yaml deleted file mode 100644 index 63c862f93..000000000 --- a/install/2_4_install/savu_v2.4/savu_master/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{% set repo = "master" %} - -package: - name: savu - version: "master" - -source: - url: https://github.com/DiamondLightSource/Savu/archive/{{ repo }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - number: 0 - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/2_4_install/savu_v2.4/test_data.nxs b/install/2_4_install/savu_v2.4/test_data.nxs deleted file mode 100644 index e456346f7..000000000 Binary files a/install/2_4_install/savu_v2.4/test_data.nxs and /dev/null differ diff --git a/install/2_4_install/savu_v2.4/version.txt b/install/2_4_install/savu_v2.4/version.txt deleted file mode 100644 index b21b1c26b..000000000 --- a/install/2_4_install/savu_v2.4/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.4 - diff --git a/install/2_4_install/tests/local_mpi_cpu_test.sh b/install/2_4_install/tests/local_mpi_cpu_test.sh deleted file mode 100644 index 586af6a0b..000000000 --- a/install/2_4_install/tests/local_mpi_cpu_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 1 ]] ; do - if [ $1 == $flag ] ; then - eval "$return"=$2 - fi - shift - done -} - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." - - -arg_parse "-r" redirect "$@" -if [ $redirect ] ; then - exec 4<&2 - exec 5<&1 - exec &> $redirect -fi - -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - -if [ $redirect ] ; then - exec 2<&4 - exec 1<&5 -fi - diff --git a/install/2_4_install/tests/local_mpi_gpu_test.sh b/install/2_4_install/tests/local_mpi_gpu_test.sh deleted file mode 100644 index 44cf9bbfd..000000000 --- a/install/2_4_install/tests/local_mpi_gpu_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 1 ]] ; do - if [ $1 == $flag ] ; then - eval "$return"=$2 - fi - shift - done -} - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." - - -arg_parse "-r" redirect "$@" -if [ $redirect ] ; then - exec 4<&2 - exec 5<&1 - exec &> $redirect -fi - -savu_mpijob_local.sh $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - -if [ $redirect ] ; then - exec 2<&4 - exec 1<&5 -fi - diff --git a/install/2_4_install/tests/mpi_cpu_test.sh b/install/2_4_install/tests/mpi_cpu_test.sh deleted file mode 100644 index 105afebcd..000000000 --- a/install/2_4_install/tests/mpi_cpu_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# get the loaded module version of savu -IN=$LOADEDMODULES -while IFS=':' read -ra ADDR; do - for i in "${ADDR[@]}"; do - if [[ $i == *"savu"* ]]; then - version=`echo "$i" | awk -F/ '{print $NF}'` - fi - done -done <<< "$IN" - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi cpu test..." -savu_launcher.sh $version $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_cpu_test.nxs $output - diff --git a/install/2_4_install/tests/mpi_gpu_test.sh b/install/2_4_install/tests/mpi_gpu_test.sh deleted file mode 100644 index fa07b4653..000000000 --- a/install/2_4_install/tests/mpi_gpu_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -output=$1 -if ! [ "$output" ]; then - echo "Please pass the path to the output folder." - exit 1 -fi - -# get the loaded module version of savu -IN=$LOADEDMODULES -while IFS=':' read -ra ADDR; do - for i in "${ADDR[@]}"; do - if [[ $i == *"savu"* ]]; then - version=`echo "$i" | awk -F/ '{print $NF}'` - fi - done -done <<< "$IN" - -# set the TESTDATA environment variable -. test_setup.sh - -echo "Running the mpi gpu test..." -savu_launcher.sh $version $TESTDATA/data/24737.nxs $TESTDATA/test_process_lists/mpi_gpu_test.nxs $output - diff --git a/install/2_4_install/tests/test_setup.sh b/install/2_4_install/tests/test_setup.sh deleted file mode 100644 index 90a35b203..000000000 --- a/install/2_4_install/tests/test_setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -savu_path=$(python -c "import savu; import os; print os.path.abspath(os.path.dirname(savu.__file__))") -test_path=$savu_path'/../test_data' -export TESTDATA=$test_path -echo '$TESTDATA points to the Savu test data folder at' $TESTDATA - diff --git a/install/__init__.py b/install/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/install/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/install/all_versions.txt b/install/all_versions.txt deleted file mode 100644 index ea1407803..000000000 --- a/install/all_versions.txt +++ /dev/null @@ -1,10 +0,0 @@ -2.0 https://github.com/DiamondLightSource/Savu/raw/v2.0/install/2_0_install/savu_v2.0.tar.gz -2.1 https://github.com/DiamondLightSource/Savu/raw/v2.1/install/2_1_install/savu_v2.1.tar.gz -2.1.1 https://github.com/DiamondLightSource/Savu/raw/v2.1.1/install/2_1_install/savu_v2.1.1.tar.gz -2.2 https://github.com/DiamondLightSource/Savu/raw/v2.2/install/2_1_install/savu_v2.2.tar.gz -2.2.1 https://github.com/DiamondLightSource/Savu/raw/v2.2.1/install/2_1_install/savu_v2.2.1.tar.gz -2.3 https://github.com/DiamondLightSource/Savu/raw/v2.3/install/2_3_install/savu_v2.3.tar.gz -2.3.1 https://github.com/DiamondLightSource/Savu/raw/v2.3.1/install/2_3_1_install/savu_v2.3.1.tar.gz -2.4 https://github.com/DiamondLightSource/Savu/raw/v2.4/install/2_4_install/savu_v2.4.tar.gz - - diff --git a/install/latest_version.txt b/install/latest_version.txt deleted file mode 100644 index aaceb90a0..000000000 --- a/install/latest_version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2_4_install/savu_v2.4/version.txt - diff --git a/install/2_4_install/conda-recipes/h5py/build.sh b/install/savu_hpc/conda-recipes/h5py/build.sh similarity index 71% rename from install/2_4_install/conda-recipes/h5py/build.sh rename to install/savu_hpc/conda-recipes/h5py/build.sh index 1659ce752..81d513d29 100644 --- a/install/2_4_install/conda-recipes/h5py/build.sh +++ b/install/savu_hpc/conda-recipes/h5py/build.sh @@ -2,7 +2,7 @@ # set compiler wrapper mpicc=$(command -v mpicc) -mpi=`dirname $mpicc` +mpi=${mpicc%/bin/mpicc} # set anaconda distribution ana_path=$(command -v savu) @@ -12,10 +12,12 @@ hdf5_build_no=1 export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ export CC=$mpicc +source $ana_path/bin/activate $ana_path +export PYTHONPATH=$PYTHONPATH:$(python -c 'import site; print(site.getsitepackages()[0])') + +echo Running with Python: $(which python) $PYTHON setup.py configure --hdf5=$ana_path $PYTHON setup.py configure --hdf5-version=$hdf5_version $PYTHON setup.py configure --mpi diff --git a/install/2_1_install/conda-recipes/h5py/meta.yaml b/install/savu_hpc/conda-recipes/h5py/meta.yaml similarity index 90% rename from install/2_1_install/conda-recipes/h5py/meta.yaml rename to install/savu_hpc/conda-recipes/h5py/meta.yaml index 0778446ae..23ee86f74 100644 --- a/install/2_1_install/conda-recipes/h5py/meta.yaml +++ b/install/savu_hpc/conda-recipes/h5py/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "2.7.1" %} # change this +{% set version = "2.10.0" %} package: name: h5py @@ -7,6 +7,7 @@ package: source: fn: h5py-{{ version }}.tar.gz url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz + requirements: build: - python diff --git a/install/2_3_1_install/conda-recipes/hdf5/build.sh b/install/savu_hpc/conda-recipes/hdf5/build.sh similarity index 87% rename from install/2_3_1_install/conda-recipes/hdf5/build.sh rename to install/savu_hpc/conda-recipes/hdf5/build.sh index add607820..34767622b 100644 --- a/install/2_3_1_install/conda-recipes/hdf5/build.sh +++ b/install/savu_hpc/conda-recipes/hdf5/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +export LD_RUN_PATH=$LD_LIBRARY_PATH + # set compiler wrapper mpicc=$(command -v mpicc) mpi=${mpicc%/bin/mpicc} @@ -10,7 +12,7 @@ export LD_RUN_PATH=$LD_LIBRARY_PATH ana_path=$(command -v savu) CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make +make -j$(nproc) make install rm -rf $PREFIX/share/hdf5_examples diff --git a/install/2_4_install/conda-recipes/hdf5/meta.yaml b/install/savu_hpc/conda-recipes/hdf5/meta.yaml similarity index 100% rename from install/2_4_install/conda-recipes/hdf5/meta.yaml rename to install/savu_hpc/conda-recipes/hdf5/meta.yaml diff --git a/install/savu_hpc/conda-recipes/installer.sh b/install/savu_hpc/conda-recipes/installer.sh new file mode 100644 index 000000000..d42bd2049 --- /dev/null +++ b/install/savu_hpc/conda-recipes/installer.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +package=$1 + +echo "Building $package..." +conda build $recipes/$package +build=$(conda build $recipes/$package --output) + +echo "Installing $package..." +conda install -y -q --use-local $build diff --git a/install/savu_hpc/conda-recipes/tomophantom/build.sh b/install/savu_hpc/conda-recipes/tomophantom/build.sh new file mode 100644 index 000000000..774f342f7 --- /dev/null +++ b/install/savu_hpc/conda-recipes/tomophantom/build.sh @@ -0,0 +1,7 @@ +mkdir -p ${SRC_DIR}/tomophantom +cd tomophantom + +#issue cmake to create setup.py +cmake -G "Unix Makefiles" ../ -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX +make install + diff --git a/install/savu_hpc/conda-recipes/tomophantom/meta.yaml b/install/savu_hpc/conda-recipes/tomophantom/meta.yaml new file mode 100644 index 000000000..f56107d69 --- /dev/null +++ b/install/savu_hpc/conda-recipes/tomophantom/meta.yaml @@ -0,0 +1,37 @@ +{% set CIL_VERSION = "1.4.5" %} + +package: + name: tomophantom + version: {{ CIL_VERSION }} + +source: + url: https://github.com/dkazanc/TomoPhantom/archive/v{{ CIL_VERSION }}.tar.gz + + +build: + preserve_egg_dir: False + number: 0 + script_env: + - CIL_VERSION={{ CIL_VERSION }} + +requirements: + build: + - python + - numpy + - setuptools + - cython + - cmake + - blas=*=openblas # [not win] + + + run: + - {{ pin_compatible('numpy', max_pin='x.x') }} + - python + - numpy + - libgcc-ng # [unix] + +about: + home: https://github.com/dkazanc/TomoPhantom + license: Apache 2.0 license + summary: 'Tomography Phantom Data generator' + diff --git a/install/savu_hpc/savu_installer.tar.gz b/install/savu_hpc/savu_installer.tar.gz new file mode 100644 index 000000000..9e3b5075c Binary files /dev/null and b/install/savu_hpc/savu_installer.tar.gz differ diff --git a/install/savu_hpc/savu_installer/environment.yml b/install/savu_hpc/savu_installer/environment.yml new file mode 100644 index 000000000..2e60f7ec8 --- /dev/null +++ b/install/savu_hpc/savu_installer/environment.yml @@ -0,0 +1,49 @@ +channels: + - conda-forge + - defaults + - astra-toolbox/label/dev + - dkazanc + - ccpi + - fastai +dependencies: + - python=3.7 + - tomopy + - scipy + - numpy + - pandas + - PyWavelets + - scikit-learn + - scikit-image + - geodistk + - morphsnakes + - tomobar + - larix + - ccpi-reconstruction + - ccpi-regulariser + - astra-toolbox + - pyfai + - pymca==5.5.5 + - pyfftw + - xraylib + - PeakUtils + - mrcfile + - tifffile + - fabio + - colorama + - jinja2 + - ipython + - pytest + - setuptools + - mock + - spyder + - pip + - fastai==1.0.59 + - pip: + - matplotlib + - pyreadline + - pmacparser + - gnureadline==6.3.8 + - sphinx-rtd-theme + - sphinx-argparse + - nvidia-ml-py3 + diff --git a/install/savu_hpc/savu_installer/environment_ci.yml b/install/savu_hpc/savu_installer/environment_ci.yml new file mode 100644 index 000000000..d591a22e8 --- /dev/null +++ b/install/savu_hpc/savu_installer/environment_ci.yml @@ -0,0 +1,11 @@ +# Extra packages needed for CI +channels: +- conda-forge +dependencies: + - python=3.7 + - numpy=1.15 + - hdf5 + - openmpi + - h5py=2.10.0=mpi_openmpi* + - mpi4py +# - h5py=2.10.0=mpi_openmpi_py37h8f0990d_2 diff --git a/install/2_1_install/savu_v2.2.1/savu/build.sh b/install/savu_hpc/savu_installer/savu/build.sh similarity index 99% rename from install/2_1_install/savu_v2.2.1/savu/build.sh rename to install/savu_hpc/savu_installer/savu/build.sh index b6fbaff2b..9180b5fb7 100644 --- a/install/2_1_install/savu_v2.2.1/savu/build.sh +++ b/install/savu_hpc/savu_installer/savu/build.sh @@ -1,4 +1,3 @@ #!/bin/bash $PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/2_0_install/savu_v2.0/savu/meta.yaml b/install/savu_hpc/savu_installer/savu/meta.yaml similarity index 92% rename from install/2_0_install/savu_v2.0/savu/meta.yaml rename to install/savu_hpc/savu_installer/savu/meta.yaml index d747a6c51..00eb6c1e7 100644 --- a/install/2_0_install/savu_v2.0/savu/meta.yaml +++ b/install/savu_hpc/savu_installer/savu/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "2.0" %} +{% set version = "3.0" %} package: name: savu @@ -20,4 +20,3 @@ about: home: https://github.com/diamondlightsource/Savu license: Apache V2 and GPL V3 license_file: LICENCE.txt - diff --git a/install/2_3_install/savu_v2.3.1/test_installer.sh b/install/savu_hpc/savu_installer/savu_installer.sh old mode 100644 new mode 100755 similarity index 51% rename from install/2_3_install/savu_v2.3.1/test_installer.sh rename to install/savu_hpc/savu_installer/savu_installer.sh index 98ef9c9ce..2d5be1017 --- a/install/2_3_install/savu_v2.3.1/test_installer.sh +++ b/install/savu_hpc/savu_installer/savu_installer.sh @@ -1,11 +1,11 @@ #!/bin/bash -ex # change to 'latest' for the latest version -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -versions_file=$DIR/../conda-recipes/versions_file.txt +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +versions_file=$DIR/versions_file.txt # error log to screen and file -log_temp=`mktemp -d` +log_temp=$(mktemp -d) error_log=$log_temp/savu_error_log.txt exec 2> >(tee -ia $error_log) @@ -14,21 +14,21 @@ newprompt=">>> " export PS1=$newprompt for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig + trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig done PREFIX="${PREFIX:-$HOME}" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# get version from the version file in base of savu +savu_version=$(cat $DIR/version.txt) # function for parsing optional arguments -function arg_parse () -{ +function arg_parse() { flag=$1 return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then + while [[ $# -gt 2 ]]; do + if [ $3 == $flag ]; then eval "$return"=$4 fi shift @@ -36,65 +36,68 @@ function arg_parse () } # function for parsing flags without arguments -function flag_parse () -{ +function flag_parse() { flag=$1 return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then + while [[ $# -gt 2 ]]; do + if [ $3 == $flag ]; then eval "$return"=true fi shift done } -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - # Set the test flag to true if test only flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then +if [ $test_flag ]; then test_flag=true fi # Set the prompts flag to false if no prompts are required flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then +if [ $prompts ]; then prompts=false else prompts=true fi -# set the intermediate folder +# set the facility arg_parse "-f" facility "$@" -if [ ! $facility ] ; then +if [ ! $facility ]; then facility=dls # change this default? fi export FACILITY=$facility -# set the intermediate folder +# set the conda folder arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then +if [ ! $conda_folder ]; then conda_folder=Savu_$savu_version fi -# set the intermediate folder +# set the savu recipe arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master +case $savu_recipe in + "master") savu_recipe="savu_master" ;; + "local") savu_recipe="savu_local" ;; + "") savu_recipe="savu" ;; + *) echo "Unknown Savu installation version."; exit 1 ;; +esac + +# override the conda recipes folder +arg_parse "-r" recipes "$@" + +# Specify whether this is running on CI +arg_parse "--local" local_installation "$@" +if [ ! $local_installation ]; then + local_installation=false else - echo "Unknown Savu installation version." + local_installation=true fi - #=========================library checking============================== -if [ $test_flag ] ; then + +if [ $test_flag ]; then echo -e "\n=============================================================" echo -e " ......Thank you for running the Savu tests......\n" echo -e "Performing a library check..." @@ -103,55 +106,41 @@ else echo -e " ......Thank you for running the Savu installer......\n" echo -e "Performing a library check..." echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." + #echo -e "Cuda is desirable for a full range of plugins." echo -e "\n=============================================================" fi -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then +if [ $local_installation = false ]; then + # set compiler wrapper + MPICC=$(command -v mpicc) + MPI_HOME=${MPICC%/mpicc} + if ! [ "$MPICC" ]; then echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" exit 1 -else + else echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -IFS=: -file_base=libfftw?.so -for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" - break - fi -done - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME + export PATH=$MPI_HOME:$PATH + fi else - echo "fftw has not been found." + echo "Going to use the openmpi installation from conda" fi -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi +# # check for cuda +# nvcc=`command -v nvcc` +# CUDAHOME=${nvcc%/bin/nvcc} +# if [ "$CUDAHOME" ]; then +# echo "Using cuda: " $CUDAHOME +# export PATH=$CUDAHOME/bin:$PATH +# export LD_LIBRARY_PATH=$CUDAHOME/lib64:$LD_LIBRARY_PATH +# else +# echo "No cuda libraries found." +# fi -if [ $test_flag ] && [ $prompts = true ] ; then +if [ $test_flag ] && [ $prompts = true ]; then - PYTHONHOME=`command -v conda` + PYTHONHOME=$(command -v conda) PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then + if [ ! $PYTHONHOME ]; then echo -e "No conda environment found in PATH. Try:" echo -e " >>> source /savu_setup.sh" echo -e "Aborting the tests." @@ -159,8 +148,8 @@ if [ $test_flag ] && [ $prompts = true ] ; then fi echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input + while true; do + read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input if [ "$input" = "y" ]; then echo -e "\nProceeding with the tests." break @@ -169,12 +158,12 @@ if [ $test_flag ] && [ $prompts = true ] ; then exit 0 else echo -e "\nYour input was unknown.\n" - fi + fi done -elif [ $prompts = true ] ; then +elif [ $prompts = true ]; then echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input + while true; do + read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input if [ "$input" = "y" ]; then echo -e "\nYour input was yes" break @@ -186,10 +175,10 @@ elif [ $prompts = true ] ; then fi done -#=====================installing other packages========================== + #=====================installing other packages========================== echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input + read -p ">>> Press ENTER to continue or input a different path: " input if [ "$input" != "" ]; then PREFIX=$input @@ -201,13 +190,13 @@ elif [ $prompts = true ] ; then break fi echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input + read -p ">>> Please input a different installation path: " input PREFIX=$input done if [ -d "$PREFIX" ]; then echo - while true ; do + while true; do read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input if [ "$input" = "y" ]; then echo -e "\nStarting the installation........" @@ -224,36 +213,73 @@ elif [ $prompts = true ] ; then mkdir -p $PREFIX fi else - if [ ! -d "$PREFIX" ] ; then + if [ ! -d "$PREFIX" ]; then mkdir -p $PREFIX fi fi -if [ ! $test_flag ] ; then + +if [ ! $test_flag ]; then echo -e "\nThank you! Installing Savu into" $PREFIX"\n" unset IFS - string=`awk '/^miniconda/' $versions_file` - miniconda_version=`echo $string | cut -d " " -f 2` - wget https://repo.continuum.io/miniconda/Miniconda2-$miniconda_version-Linux-x86_64.sh -O $PREFIX/miniconda.sh; + string=$(awk '/^miniconda/' $versions_file) + miniconda_version=$(echo $string | cut -d " " -f 2) + + wget https://repo.continuum.io/miniconda/Miniconda3-$miniconda_version-Linux-x86_64.sh -O $PREFIX/miniconda.sh + bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda PYTHONHOME=$PREFIX/miniconda/bin export PATH="$PYTHONHOME:$PATH" - conda install -y -q conda-build conda-env - conda install ipython - pip install pymca==5.2.1 - pip install pymca5==5.2.1 - conda install numpy==1.13.0 - - #conda install numpy==1.13.0 - #conda install h5py==2.7.0 - #conda install hdf5==1.10.0 - #conda install mpi4py=2.0.0 + conda install -y -q conda-build + + if [ $local_installation = false ]; then + + echo "Building Savu..." + conda build $DIR/$savu_recipe + savubuild=`conda build $DIR/$savu_recipe --output` + echo "Installing Savu..." + conda install -y -q --use-local $savubuild - #conda env update -n root -f $DIR/environment.yml + path=$(python -c "import savu; import os; print(os.path.abspath(savu.__file__))") + savu_path=${path%/savu/__init__.py*} + # get the savu version + if [ -z $recipes ]; then + install_path=$(python -c "import savu; import savu.version as sv; print(sv.__install__)") + recipes=$savu_path/$install_path/../conda-recipes + fi + + echo "Installing mpi4py..." + string=$(awk '/^mpi4py/' $versions_file) + mpi4py_version=$(echo $string | cut -d " " -f 2) + pip install mpi4py==$mpi4py_version + + . $recipes/installer.sh "hdf5" + . $recipes/installer.sh "h5py" + + else + echo "Installing mpi4py/hdf5/h5py from conda for CI run" + recipes=$DIR/../conda-recipes + conda env update -n root -f $DIR/environment_ci.yml + fi + + echo "Installing pytorch..." + string=$(awk '/^cudatoolkit/' $versions_file) + cudatoolkit_version=$(echo $string | cut -d " " -f 2) + conda install -y -q pytorch torchvision cudatoolkit=$cudatoolkit_version -c pytorch + + conda env update -n root -f $DIR/environment.yml + + . $recipes/installer.sh "tomophantom" + + # cleanup build artifacts + rm $PREFIX/miniconda.sh + + conda build purge + conda clean -y --all echo -e "\n\t***************************************************" echo -e "\t Package installation complete" @@ -262,10 +288,10 @@ if [ ! $test_flag ] ; then fi -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then +if [ ! $test_flag ]; then + if [ $prompts = true ]; then while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input + read -n 1 -p "Would you like to run the tests? (y/n): " input if [ "$input" = "y" ]; then echo -e "\nYour input was yes" test_flag=true @@ -273,7 +299,7 @@ if [ ! $test_flag ] ; then elif [ "$input" = "n" ]; then echo -e "Aborting test run..." echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" + echo -e " >>> bash savu_installer/savu_installer.sh --tests_only" exit 0 else echo -e "\nYour input was unknown.\n" @@ -283,28 +309,28 @@ if [ ! $test_flag ] ; then setup_script=$PREFIX/'savu_setup.sh' echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 + ([ -e "$setup_script" ] || touch "$setup_script") && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script + echo '#!bin/bash' >$setup_script + echo ""export PATH=$MPIHOME/bin:'$PATH'"" >>$setup_script + echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >>$setup_script + echo ""export PYTHONUSERSITE True"" >>$setup_script + echo ""export PATH=$PYTHONHOME:'$PATH'"" >>$setup_script + echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >>$setup_script + echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >>$setup_script if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script + echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >>$setup_script + echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >>$setup_script fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script + if [ "$FFTWHOME" ]; then + echo ""export FFTWDIR=$FFTWHOME"" >>$setup_script + echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >>$setup_script fi source $setup_script fi -if [ $test_flag ] ; then +if [ $test_flag ]; then nGPUs=$(nvidia-smi -L | wc -l) @@ -316,48 +342,9 @@ if [ $test_flag ] ; then echo -e "\n************** Single-threaded local tests complete ******************\n" - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - - echo -e "\n***** Running Savu MPI local CPU tests *****\n" - - local_mpi_cpu_test.sh $test_dir -r $tmpfile - - result=$(grep -i "Processing Complete" $tmpfile) - if [ ! $result ] ; then - echo -e "\n****The tests have errored: See $tmpfile for more details****\n" - else - echo -e "\n***Test successfully completed!***\n" - fi - - echo "The number of GPUs is", $nGPUs - if [ $nGPUs -gt 0 ] ; then - echo -e "\n***** Running Savu MPI local GPU tests *****\n" - local_mpi_gpu_test.sh $test_dir - else - echo -e "\n***** Skipping Savu MPI local GPU tests (no GPUs found) *****\n" - fi - - rm -r $test_dir - - echo -e "\n************** MPI local tests complete ******************\n" fi -if [ ! $test_flag ] ; then - - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICES================================" - echo -e "If you are installing Savu for cluster use, you will need to update the savu " - echo -e "launcher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you" - echo -e "open a new terminal. Alternatively, if you are using the Modules system, see" - echo -e "$DIR/module_template for an example module file." - echo -e "================================================================================\n" +if [ ! $test_flag ]; then echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" echo -e " ......Thank you for running the Savu installer......\n" @@ -369,5 +356,9 @@ else echo -e "=======================================================\n" fi -exit 0 +echo -e "\n\t***************************************************" +echo -e "\t Package installation complete" +echo -e "\t Check $error_log for errors" +echo -e "\t***************************************************\n" +exit 0 diff --git a/install/2_0_install/savu_v2.0/savu/build.sh b/install/savu_hpc/savu_installer/savu_local/build.sh similarity index 100% rename from install/2_0_install/savu_v2.0/savu/build.sh rename to install/savu_hpc/savu_installer/savu_local/build.sh diff --git a/install/unstable_master/savu/savu_master/meta.yaml b/install/savu_hpc/savu_installer/savu_local/meta.yaml similarity index 69% rename from install/unstable_master/savu/savu_master/meta.yaml rename to install/savu_hpc/savu_installer/savu_local/meta.yaml index 8f2bca48f..b633e8312 100644 --- a/install/unstable_master/savu/savu_master/meta.yaml +++ b/install/savu_hpc/savu_installer/savu_local/meta.yaml @@ -1,11 +1,11 @@ -{% set repo = "master" %} +{% set repo = "local_repo" %} package: name: savu - version: "master" + version: "local_repo" source: - url: https://github.com/DiamondLightSource/Savu/archive/v2.3.2.tar.gz + path: /home/qmm55171/Documents/Git/git_repos/Savu requirements: build: diff --git a/install/2_0_install/savu_v2.0/savu_master/build.sh b/install/savu_hpc/savu_installer/savu_master/build.sh similarity index 100% rename from install/2_0_install/savu_v2.0/savu_master/build.sh rename to install/savu_hpc/savu_installer/savu_master/build.sh diff --git a/install/2_0_install/savu_v2.0/savu_master/meta.yaml b/install/savu_hpc/savu_installer/savu_master/meta.yaml similarity index 100% rename from install/2_0_install/savu_v2.0/savu_master/meta.yaml rename to install/savu_hpc/savu_installer/savu_master/meta.yaml diff --git a/install/savu_hpc/savu_installer/version.txt b/install/savu_hpc/savu_installer/version.txt new file mode 100644 index 000000000..8ef0f5001 --- /dev/null +++ b/install/savu_hpc/savu_installer/version.txt @@ -0,0 +1,2 @@ +3.0 + diff --git a/install/2_4_install/savu_v2.4/versions_file.txt b/install/savu_hpc/savu_installer/versions_file.txt similarity index 68% rename from install/2_4_install/savu_v2.4/versions_file.txt rename to install/savu_hpc/savu_installer/versions_file.txt index 9b00c4f16..11a94c639 100644 --- a/install/2_4_install/savu_v2.4/versions_file.txt +++ b/install/savu_hpc/savu_installer/versions_file.txt @@ -1,3 +1,3 @@ miniconda 4.6.14 mpi4py 3.0.2 - +cudatoolkit 10.1 diff --git a/conda-recipes/Singularity b/install/savu_singularity/conda-recipes/Singularity similarity index 100% rename from conda-recipes/Singularity rename to install/savu_singularity/conda-recipes/Singularity diff --git a/conda-recipes/fftw/build.sh b/install/savu_singularity/conda-recipes/fftw/build.sh similarity index 100% rename from conda-recipes/fftw/build.sh rename to install/savu_singularity/conda-recipes/fftw/build.sh diff --git a/conda-recipes/fftw/meta.yaml b/install/savu_singularity/conda-recipes/fftw/meta.yaml similarity index 100% rename from conda-recipes/fftw/meta.yaml rename to install/savu_singularity/conda-recipes/fftw/meta.yaml diff --git a/conda-recipes/h5py/build.sh b/install/savu_singularity/conda-recipes/h5py/build.sh similarity index 100% rename from conda-recipes/h5py/build.sh rename to install/savu_singularity/conda-recipes/h5py/build.sh diff --git a/conda-recipes/h5py/meta.yaml b/install/savu_singularity/conda-recipes/h5py/meta.yaml similarity index 100% rename from conda-recipes/h5py/meta.yaml rename to install/savu_singularity/conda-recipes/h5py/meta.yaml diff --git a/conda-recipes/h5py/run_test.py b/install/savu_singularity/conda-recipes/h5py/run_test.py similarity index 100% rename from conda-recipes/h5py/run_test.py rename to install/savu_singularity/conda-recipes/h5py/run_test.py diff --git a/conda-recipes/h5py/support-1.10.5.patch b/install/savu_singularity/conda-recipes/h5py/support-1.10.5.patch similarity index 100% rename from conda-recipes/h5py/support-1.10.5.patch rename to install/savu_singularity/conda-recipes/h5py/support-1.10.5.patch diff --git a/conda-recipes/hdf5/build.sh b/install/savu_singularity/conda-recipes/hdf5/build.sh similarity index 100% rename from conda-recipes/hdf5/build.sh rename to install/savu_singularity/conda-recipes/hdf5/build.sh diff --git a/conda-recipes/hdf5/h5_cmprss.c b/install/savu_singularity/conda-recipes/hdf5/h5_cmprss.c similarity index 100% rename from conda-recipes/hdf5/h5_cmprss.c rename to install/savu_singularity/conda-recipes/hdf5/h5_cmprss.c diff --git a/conda-recipes/hdf5/meta.yaml b/install/savu_singularity/conda-recipes/hdf5/meta.yaml similarity index 100% rename from conda-recipes/hdf5/meta.yaml rename to install/savu_singularity/conda-recipes/hdf5/meta.yaml diff --git a/conda-recipes/hdf5/mpiexec.sh b/install/savu_singularity/conda-recipes/hdf5/mpiexec.sh similarity index 100% rename from conda-recipes/hdf5/mpiexec.sh rename to install/savu_singularity/conda-recipes/hdf5/mpiexec.sh diff --git a/conda-recipes/hdf5/run_test.sh b/install/savu_singularity/conda-recipes/hdf5/run_test.sh similarity index 100% rename from conda-recipes/hdf5/run_test.sh rename to install/savu_singularity/conda-recipes/hdf5/run_test.sh diff --git a/conda-recipes/hdf5/test_Makefile.in.patch b/install/savu_singularity/conda-recipes/hdf5/test_Makefile.in.patch similarity index 100% rename from conda-recipes/hdf5/test_Makefile.in.patch rename to install/savu_singularity/conda-recipes/hdf5/test_Makefile.in.patch diff --git a/conda-recipes/hdf5/testh5diff.sh.in.patch b/install/savu_singularity/conda-recipes/hdf5/testh5diff.sh.in.patch similarity index 100% rename from conda-recipes/hdf5/testh5diff.sh.in.patch rename to install/savu_singularity/conda-recipes/hdf5/testh5diff.sh.in.patch diff --git a/conda-recipes/hdf5/testpar_Makefile.in.patch b/install/savu_singularity/conda-recipes/hdf5/testpar_Makefile.in.patch similarity index 100% rename from conda-recipes/hdf5/testpar_Makefile.in.patch rename to install/savu_singularity/conda-recipes/hdf5/testpar_Makefile.in.patch diff --git a/conda-recipes/hdf5/testpar_pflush.sh.in.openmpi.patch b/install/savu_singularity/conda-recipes/hdf5/testpar_pflush.sh.in.openmpi.patch similarity index 100% rename from conda-recipes/hdf5/testpar_pflush.sh.in.openmpi.patch rename to install/savu_singularity/conda-recipes/hdf5/testpar_pflush.sh.in.openmpi.patch diff --git a/conda-recipes/mass-rebuild.sh b/install/savu_singularity/conda-recipes/mass-rebuild.sh similarity index 100% rename from conda-recipes/mass-rebuild.sh rename to install/savu_singularity/conda-recipes/mass-rebuild.sh diff --git a/conda-recipes/mpi4py/helloworld.py b/install/savu_singularity/conda-recipes/mpi4py/helloworld.py similarity index 100% rename from conda-recipes/mpi4py/helloworld.py rename to install/savu_singularity/conda-recipes/mpi4py/helloworld.py diff --git a/conda-recipes/mpi4py/meta.yaml b/install/savu_singularity/conda-recipes/mpi4py/meta.yaml similarity index 100% rename from conda-recipes/mpi4py/meta.yaml rename to install/savu_singularity/conda-recipes/mpi4py/meta.yaml diff --git a/conda-recipes/mpi4py/mpiexec.sh b/install/savu_singularity/conda-recipes/mpi4py/mpiexec.sh similarity index 100% rename from conda-recipes/mpi4py/mpiexec.sh rename to install/savu_singularity/conda-recipes/mpi4py/mpiexec.sh diff --git a/conda-recipes/mpi4py/run_test.sh b/install/savu_singularity/conda-recipes/mpi4py/run_test.sh similarity index 100% rename from conda-recipes/mpi4py/run_test.sh rename to install/savu_singularity/conda-recipes/mpi4py/run_test.sh diff --git a/conda-recipes/openmpi/build.sh b/install/savu_singularity/conda-recipes/openmpi/build.sh similarity index 100% rename from conda-recipes/openmpi/build.sh rename to install/savu_singularity/conda-recipes/openmpi/build.sh diff --git a/conda-recipes/openmpi/meta.yaml b/install/savu_singularity/conda-recipes/openmpi/meta.yaml similarity index 100% rename from conda-recipes/openmpi/meta.yaml rename to install/savu_singularity/conda-recipes/openmpi/meta.yaml diff --git a/conda-recipes/openmpi/mpiexec.sh b/install/savu_singularity/conda-recipes/openmpi/mpiexec.sh similarity index 100% rename from conda-recipes/openmpi/mpiexec.sh rename to install/savu_singularity/conda-recipes/openmpi/mpiexec.sh diff --git a/conda-recipes/openmpi/run_test.sh b/install/savu_singularity/conda-recipes/openmpi/run_test.sh similarity index 100% rename from conda-recipes/openmpi/run_test.sh rename to install/savu_singularity/conda-recipes/openmpi/run_test.sh diff --git a/conda-recipes/openmpi/tests/helloworld b/install/savu_singularity/conda-recipes/openmpi/tests/helloworld similarity index 100% rename from conda-recipes/openmpi/tests/helloworld rename to install/savu_singularity/conda-recipes/openmpi/tests/helloworld diff --git a/conda-recipes/openmpi/tests/helloworld.c b/install/savu_singularity/conda-recipes/openmpi/tests/helloworld.c similarity index 100% rename from conda-recipes/openmpi/tests/helloworld.c rename to install/savu_singularity/conda-recipes/openmpi/tests/helloworld.c diff --git a/conda-recipes/openmpi/tests/helloworld.cxx b/install/savu_singularity/conda-recipes/openmpi/tests/helloworld.cxx similarity index 100% rename from conda-recipes/openmpi/tests/helloworld.cxx rename to install/savu_singularity/conda-recipes/openmpi/tests/helloworld.cxx diff --git a/conda-recipes/openmpi/tests/helloworld.f b/install/savu_singularity/conda-recipes/openmpi/tests/helloworld.f similarity index 100% rename from conda-recipes/openmpi/tests/helloworld.f rename to install/savu_singularity/conda-recipes/openmpi/tests/helloworld.f diff --git a/conda-recipes/openmpi/tests/helloworld.f90 b/install/savu_singularity/conda-recipes/openmpi/tests/helloworld.f90 similarity index 100% rename from conda-recipes/openmpi/tests/helloworld.f90 rename to install/savu_singularity/conda-recipes/openmpi/tests/helloworld.f90 diff --git a/conda-recipes/openmpi/tests/test_exec.py b/install/savu_singularity/conda-recipes/openmpi/tests/test_exec.py similarity index 100% rename from conda-recipes/openmpi/tests/test_exec.py rename to install/savu_singularity/conda-recipes/openmpi/tests/test_exec.py diff --git a/singularity-recipes/.gitignore b/install/savu_singularity/singularity-recipes/.gitignore similarity index 100% rename from singularity-recipes/.gitignore rename to install/savu_singularity/singularity-recipes/.gitignore diff --git a/singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.py b/install/savu_singularity/singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.py similarity index 100% rename from singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.py rename to install/savu_singularity/singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.py diff --git a/singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.sge b/install/savu_singularity/singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.sge similarity index 100% rename from singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.sge rename to install/savu_singularity/singularity-recipes/SavuDeps.test/SavuDeps.mpi4py.sge diff --git a/singularity-recipes/Singularity.SavuAstra b/install/savu_singularity/singularity-recipes/Singularity.SavuAstra similarity index 100% rename from singularity-recipes/Singularity.SavuAstra rename to install/savu_singularity/singularity-recipes/Singularity.SavuAstra diff --git a/singularity-recipes/Singularity.SavuCore b/install/savu_singularity/singularity-recipes/Singularity.SavuCore similarity index 100% rename from singularity-recipes/Singularity.SavuCore rename to install/savu_singularity/singularity-recipes/Singularity.SavuCore diff --git a/singularity-recipes/Singularity.SavuDeps b/install/savu_singularity/singularity-recipes/Singularity.SavuDeps similarity index 100% rename from singularity-recipes/Singularity.SavuDeps rename to install/savu_singularity/singularity-recipes/Singularity.SavuDeps diff --git a/singularity-recipes/mass-rebuild.py b/install/savu_singularity/singularity-recipes/mass-rebuild.py similarity index 91% rename from singularity-recipes/mass-rebuild.py rename to install/savu_singularity/singularity-recipes/mass-rebuild.py index a4ea2a1b3..94129abd6 100644 --- a/singularity-recipes/mass-rebuild.py +++ b/install/savu_singularity/singularity-recipes/mass-rebuild.py @@ -60,9 +60,9 @@ print('#########################') print('#') - print('# Building {}'.format(image.name)) - print('# local_image: {}'.format(local_image)) - print('# registry_image: {}'.format(registry_image)) + print(('# Building {}'.format(image.name))) + print(('# local_image: {}'.format(local_image))) + print(('# registry_image: {}'.format(registry_image))) print('#') print('#########################') @@ -83,7 +83,7 @@ spython_client.quiet = False # circumvent problem with sregistry setting this attribute to True, which kills my local builds! filename = spython_client.build(recipe='Singularity.' + image.name, image=local_image, sudo_options=sudo_options) if filename is None: - print("Error creating singularity image {}".format(local_image)) + print(("Error creating singularity image {}".format(local_image))) sys.exit(1) # @@ -96,6 +96,6 @@ # push to GS bucket # if image.push is True and use_sregistry is True and 'CIRCLECI' in os.environ: - print("Pushing {} to {}".format(local_image, registry_image)) + print(("Pushing {} to {}".format(local_image, registry_image))) sregistry_client.push(path=local_image, name=registry_image) diff --git a/singularity-recipes/savu/build.sh b/install/savu_singularity/singularity-recipes/savu/build.sh similarity index 100% rename from singularity-recipes/savu/build.sh rename to install/savu_singularity/singularity-recipes/savu/build.sh diff --git a/singularity-recipes/savu/meta.yaml b/install/savu_singularity/singularity-recipes/savu/meta.yaml similarity index 100% rename from singularity-recipes/savu/meta.yaml rename to install/savu_singularity/singularity-recipes/savu/meta.yaml diff --git a/install/1_2_install/__init__.py b/install/tests/__init__.py similarity index 100% rename from install/1_2_install/__init__.py rename to install/tests/__init__.py diff --git a/install/2_1_install/tests/local_mpi_cpu_test.sh b/install/tests/local_mpi_cpu_test.sh similarity index 100% rename from install/2_1_install/tests/local_mpi_cpu_test.sh rename to install/tests/local_mpi_cpu_test.sh diff --git a/install/2_1_install/tests/local_mpi_gpu_test.sh b/install/tests/local_mpi_gpu_test.sh similarity index 100% rename from install/2_1_install/tests/local_mpi_gpu_test.sh rename to install/tests/local_mpi_gpu_test.sh diff --git a/install/2_1_install/tests/mpi_cpu_test.sh b/install/tests/mpi_cpu_test.sh similarity index 100% rename from install/2_1_install/tests/mpi_cpu_test.sh rename to install/tests/mpi_cpu_test.sh diff --git a/install/2_1_install/tests/mpi_gpu_test.sh b/install/tests/mpi_gpu_test.sh similarity index 100% rename from install/2_1_install/tests/mpi_gpu_test.sh rename to install/tests/mpi_gpu_test.sh diff --git a/install/2_0_install/tests/test_setup.sh b/install/tests/test_setup.sh similarity index 100% rename from install/2_0_install/tests/test_setup.sh rename to install/tests/test_setup.sh diff --git a/install/unstable_master/conda-recipes/astra/astra.pth b/install/unstable_master/conda-recipes/astra/astra.pth deleted file mode 100644 index 45c4c6127..000000000 --- a/install/unstable_master/conda-recipes/astra/astra.pth +++ /dev/null @@ -1,2 +0,0 @@ -./astra/python - diff --git a/install/unstable_master/conda-recipes/astra/build.sh b/install/unstable_master/conda-recipes/astra/build.sh deleted file mode 100644 index acd72a6d6..000000000 --- a/install/unstable_master/conda-recipes/astra/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -nvcc=`command -v nvcc` -cuda=${nvcc%/bin/nvcc} - -savu_path=`command -v savu` -ana_path=${savu_path%/savu} -prefix=${ana_path%/bin}/lib/python2.7/site-packages/astra -export PATH=$ana_path:$PATH - -cd build/linux - -if [ "$cuda" ]; then - ./configure --with-cuda=$cuda --with-python --prefix=$prefix -else - echo "cuda has not been found." - ./configure --with-python --prefix=$prefix -fi - -make -j 4 -make install - diff --git a/install/unstable_master/conda-recipes/astra/meta.yaml b/install/unstable_master/conda-recipes/astra/meta.yaml deleted file mode 100644 index 4a04c0bc4..000000000 --- a/install/unstable_master/conda-recipes/astra/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% set version = "1.8" %} - -package: - name: astra-toolbox - version: 1.8 - -source: - fn: astra-{{ version }}.tar.bz2 - url: http://www.astra-toolbox.com/files/astra-{{ version }}/astra-{{ version }}.tar.bz2 - sha256: 44602e0eb0789a557622eae959fc0a067d81396bcb79ec315cb39b59d52322e7 - -requirements: - build: - - python - - numpy - - cython - -build: - number: 2 - -about: - home: http://www.astra-toolbox.com - license: GPLv3 - summary: 'The ASTRA Toolbox is a Python toolbox of high-performance GPU primitives for 2D and 3D tomography.' - diff --git a/install/unstable_master/conda-recipes/ccpirecon/build.sh b/install/unstable_master/conda-recipes/ccpirecon/build.sh deleted file mode 100755 index 8d7154d16..000000000 --- a/install/unstable_master/conda-recipes/ccpirecon/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -mkdir build -cd build -git clone https://github.com/vais-ral/CCPi-Reconstruction.git -export CIL_VERSION=19.03 -conda build CCPi-Reconstruction/recipes/library --numpy 1.15 --python 2.7 -conda install -y -q --use-local cil_reconstruction=${CIL_VERSION} -cd ../ -rm -r -f build diff --git a/install/unstable_master/conda-recipes/ccpiregul/build.sh b/install/unstable_master/conda-recipes/ccpiregul/build.sh deleted file mode 100755 index 604f4ede7..000000000 --- a/install/unstable_master/conda-recipes/ccpiregul/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -mkdir build -cd build -git clone https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git -export CIL_VERSION=19.03 -conda build CCPi-Regularisation-Toolkit/recipe/ --numpy 1.15 --python 2.7 --no-test -conda install -y -q --use-local ccpi-regulariser=${CIL_VERSION} -cd ../ -rm -r -f build diff --git a/install/unstable_master/conda-recipes/h5py/build.sh b/install/unstable_master/conda-recipes/h5py/build.sh deleted file mode 100644 index aaf52046f..000000000 --- a/install/unstable_master/conda-recipes/h5py/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} - -# set anaconda distribution -ana_path=$(command -v savu) -ana_path=${ana_path%/bin/savu} -hdf5_version=1.10.5 -hdf5_build_no=1 - -export LD_LIBRARY_PATH=$mpi/lib:$mpi/include:$ana_path/lib:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -export PYTHONPATH=$PYTHONPATH:$ana_path/lib/python2.7/site-packages -export PATH=$PATH:$ana_path/bin/ -export CC=$mpicc - -$PYTHON setup.py configure --mpi --hdf5=$ana_path --hdf5-version=$hdf5_version -$PYTHON setup.py build -$PYTHON setup.py install - diff --git a/install/unstable_master/conda-recipes/h5py/meta.yaml b/install/unstable_master/conda-recipes/h5py/meta.yaml deleted file mode 100644 index af1ce8921..000000000 --- a/install/unstable_master/conda-recipes/h5py/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "2.9.0" %} # change this - -package: - name: h5py - version: {{ version }} - -source: - fn: h5py-{{ version }}.tar.gz - url: https://github.com/h5py/h5py/archive/{{ version }}.tar.gz -requirements: - build: - - python - - numpy - - hdf5 ==1.10.5 - - cython - - pkgconfig - - six - - -build: - number: 1 - -about: - home: http://www.h5py.org/ - license: New BSD (http://opensource.org/licenses/bsd-license.php) - diff --git a/install/unstable_master/conda-recipes/hdf5/build.sh b/install/unstable_master/conda-recipes/hdf5/build.sh deleted file mode 100644 index 053d86577..000000000 --- a/install/unstable_master/conda-recipes/hdf5/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# set compiler wrapper -mpicc=$(command -v mpicc) -mpi=${mpicc%/bin/mpicc} -export LD_LIBRARY_PATH=$mpi:$mpi/lib:$mpi/include:$LD_LIBRARY_PATH -export LD_RUN_PATH=$LD_LIBRARY_PATH -#export RPATH=$mpi/lib - -# check anaconda distribution -#ana_path=$(command -v savu) - -CC=$mpicc ./configure --with-zlib --enable-parallel --enable-shared --prefix=$PREFIX -make -make install - -rm -rf $PREFIX/share/hdf5_examples - diff --git a/install/unstable_master/conda-recipes/hdf5/meta.yaml b/install/unstable_master/conda-recipes/hdf5/meta.yaml deleted file mode 100644 index a958df804..000000000 --- a/install/unstable_master/conda-recipes/hdf5/meta.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{% set version = "1.10.5" %} -{% set release = "hdf5-1.10" %} -{% set patch = "hdf5-1.10.5" %} - -package: - name: hdf5 - version: {{ version }} - -source: - fn: {{ patch }}.tar.bz2 - url: https://www.hdfgroup.org/ftp/HDF5/releases/{{ release }}/{{ patch }}/src/{{ patch }}.tar.bz2 - md5: 7c19d6b81ee2a3ba7d36f6922b2f90d3 - -build: - number: 1 - -about: - home: http://www.hdfgroup.org/HDF5/ - license: BSD-style (http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING) - diff --git a/install/unstable_master/conda-recipes/tomobar/build.sh b/install/unstable_master/conda-recipes/tomobar/build.sh deleted file mode 100755 index 4672077b5..000000000 --- a/install/unstable_master/conda-recipes/tomobar/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -mkdir build -cd build -git clone git@github.com:dkazanc/ToMoBAR.git -conda build ToMoBAR/Wrappers/Python/conda-recipe --numpy 1.15 --python 2.7 -conda install -y -q --use-local tomobar -cd ../ -rm -r -f build diff --git a/install/unstable_master/conda-recipes/tomophantom/build.sh b/install/unstable_master/conda-recipes/tomophantom/build.sh deleted file mode 100755 index 4c37d7ed3..000000000 --- a/install/unstable_master/conda-recipes/tomophantom/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -mkdir build -cd build -git clone https://github.com/dkazanc/TomoPhantom.git -export CIL_VERSION=1.2_1 -conda build TomoPhantom/Wrappers/Python/conda-recipe --numpy 1.15 --python 3.7 -conda install -y -q --use-local tomophantom -cd ../ -rm -r -f build diff --git a/install/unstable_master/conda-recipes/xdesign/build.sh b/install/unstable_master/conda-recipes/xdesign/build.sh deleted file mode 100644 index b161f631b..000000000 --- a/install/unstable_master/conda-recipes/xdesign/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install - diff --git a/install/unstable_master/conda-recipes/xdesign/meta.yaml b/install/unstable_master/conda-recipes/xdesign/meta.yaml deleted file mode 100644 index 68693b427..000000000 --- a/install/unstable_master/conda-recipes/xdesign/meta.yaml +++ /dev/null @@ -1,24 +0,0 @@ -package: - name: xdesign - version: '0.3.0' - -source: - git_url: https://github.com/tomography/xdesign.git - -build: - number: 0 - -requirements: - build: - - python - - setuptools - -about: - home: http://xdesign.readthedocs.io - license: BSD-3 - summary: 'Benchmarking and optimization tools for tomography.' - -# See -# http://docs.continuum.io/conda/build.html for -# more information about meta.yaml - diff --git a/install/unstable_master/conda-recipes/xraylib/build.sh b/install/unstable_master/conda-recipes/xraylib/build.sh deleted file mode 100644 index 8f0acd316..000000000 --- a/install/unstable_master/conda-recipes/xraylib/build.sh +++ /dev/null @@ -1,7 +0,0 @@ - -./configure --enable-python --disable-perl --disable-java \ - --disable-fortran2003 --disable-lua --prefix=$PREFIX -make -make check -make install - diff --git a/install/unstable_master/conda-recipes/xraylib/meta.yaml b/install/unstable_master/conda-recipes/xraylib/meta.yaml deleted file mode 100644 index f924056e2..000000000 --- a/install/unstable_master/conda-recipes/xraylib/meta.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{% set version = "3.3.0" %} - -package: - name: xraylib - version: {{ version }} - -source: - fn: xraylib-{{ version }}.tar.gz - url: https://xraylib.tomschoonjans.eu/xraylib-{{ version }}.tar.gz - sha256: a22a73b8d90eb752b034bab1a4cf6abdd81b8c7dc5020bcb22132d2ee7aacd42 - -build: - number: 0 - -requirements: - build: - - python - - setuptools - - numpy - - scipy >=0.7.0 - - cython - - swig - - autoconf - - libtool - - automake - diff --git a/install/unstable_master/savu/environment.yml b/install/unstable_master/savu/environment.yml deleted file mode 100644 index 79d658ca9..000000000 --- a/install/unstable_master/savu/environment.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: root -channels: -- defaults -dependencies: -- scipy==1.1.0 -- colorama==0.3.9 -- setuptools==39.2.0 -- jinja2==2.10 -- numpy==1.14.5 -- pandas==0.23.3 -- mock==2.0.0 -- PyWavelets==0.5.2 -- scikit-image==0.14.0 -- scikit-learn==0.19.1 -- pytest==3.6.2 -- spyder==3.3.0 -- ipython==5.7.0 -- cython==0.28.3 -- boost==1.67.0 -- pip: - - fabio==0.4.0 - - pyfftw==0.10.4 - - nvidia-ml-py==7.352.0 - - PeakUtils==1.1.1 - - pymca==5.3.1 - - tifffile==0.4.0 - - pyreadline==2.1 - - gnureadline==6.3.8 - - sphinx_rtd_theme==0.4.1 - diff --git a/install/unstable_master/savu/savu/build.sh b/install/unstable_master/savu/savu/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/unstable_master/savu/savu/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/unstable_master/savu/savu/meta.yaml b/install/unstable_master/savu/savu/meta.yaml deleted file mode 100644 index 7fa123735..000000000 --- a/install/unstable_master/savu/savu/meta.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{% set version = "2.3.2" %} - -package: - name: savu - version: {{ version }} - -source: - url: https://github.com/DiamondLightSource/Savu/archive/v{{ version }}.tar.gz - -requirements: - build: - - python - -build: - preserve_egg_dir: True - script_env: - - FACILITY - -about: - home: https://github.com/diamondlightsource/Savu - license: Apache V2 and GPL V3 - license_file: LICENCE.txt - diff --git a/install/unstable_master/savu/savu_installer.sh b/install/unstable_master/savu/savu_installer.sh deleted file mode 100644 index e7e6ecf9d..000000000 --- a/install/unstable_master/savu/savu_installer.sh +++ /dev/null @@ -1,448 +0,0 @@ -#!/bin/bash -ex - -# change to 'latest' for the latest version -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -versions_file=$DIR/versions_file.txt - -# error log to screen and file -log_temp=`mktemp -d` -error_log=$log_temp/savu_error_log.txt -exec 2> >(tee -ia $error_log) - -oldprompt=$PS1 -newprompt=">>> " -export PS1=$newprompt - -for sig in INT TERM EXIT; do - trap "export PS1=$oldprompt; [[ $sig == EXIT ]] || kill -$sig $$" $sig -done - -PREFIX="${PREFIX:-$HOME}" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -savu_version=`cat $DIR/version.txt` - -# function for parsing optional arguments -function arg_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=$4 - fi - shift - done -} - -# function for parsing flags without arguments -function flag_parse () -{ - flag=$1 - return=$2 - while [[ $# -gt 2 ]] ; do - if [ $3 == $flag ] ; then - eval "$return"=true - fi - shift - done -} - -# Set the install PREFIX -flag_parse "--PREFIX" prefix "$@" -if [ $prefix ] ; then - PREFIX=true -fi - -# Set the test flag to true if test only -flag_parse "--tests_only" test_flag "$@" -if [ $test_flag ] ; then - test_flag=true -fi - -# Set the prompts flag to false if no prompts are required -flag_parse "--no_prompts" prompts "$@" -if [ $prompts ] ; then - prompts=false -else - prompts=true -fi - -# set the intermediate folder -arg_parse "-f" facility "$@" -if [ ! $facility ] ; then - facility=dls # change this default? -fi - -export FACILITY=$facility - -# set the intermediate folder -arg_parse "-c" conda_folder "$@" -if [ ! $conda_folder ] ; then - conda_folder=Savu_$savu_version -fi - -# set the intermediate folder -arg_parse "-s" savu_recipe "$@" -if [ ! $savu_recipe ] ; then - savu_recipe=savu -elif [ $savu_recipe = 'master' ] ; then - savu_recipe=savu_master -else - echo "Unknown Savu installation version." -fi - -#=========================library checking============================== - -if [ $test_flag ] ; then - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e "Performing a library check..." -else - echo -e "\n=============================================================" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "Performing a library check..." - echo -e "\nNB: An MPI implementation is required to build Savu." - echo -e "fftw is required to build Savu." - echo -e "Cuda is desirable for a full range of plugins." - echo -e "\n=============================================================" -fi - -# set compiler wrapper -MPICC=$(command -v mpicc) -if ! [ "$MPICC" ]; then - echo "ERROR: I require mpicc but I can't find it. Check /path/to/mpi_implementation/bin is in your PATH" - exit 1 -else - echo "Using mpicc: " $MPICC -fi - -# check for fftw -CFLAGS="" -LDFLAGS="" -# If no FFTWHOME provided search LD_LIBRARY_PATH for the static library -if [ -z ${FFTWHOME+x} ]; then - IFS=: - file_base=libfftw?.so - for p in ${LD_LIBRARY_PATH}; do - file_path=${p}/$file_base - if [ "x$p" != "x" -a -e $file_path ]; then - FFTWHOME=${file_path%/lib/libfftw?.so} - break - fi - done -fi -# If a valid FFTWHOME was found or provided then use it -if [ ${FFTWHOME} ]; then - CFLAGS="$FFTWHOME/include" - LDFLAGS="$FFTWHOME/lib" -fi - -if [ "$CFLAGS" ]; then - echo "Using fftw: " $FFTWHOME -else - echo "fftw has not been found." -fi - -# check for cuda -nvcc=`command -v nvcc` -CUDAHOME=${nvcc%/bin/nvcc} -if [ "$CUDAHOME" ]; then - echo "Using cuda: " $CUDAHOME -else - echo "cuda has not been found." -fi - -if [ $test_flag ] && [ $prompts = true ] ; then - - PYTHONHOME=`command -v conda` - PYTHONHOME=${PYTHONHOME%conda} - if [ ! $PYTHONHOME ] ; then - echo -e "No conda environment found in PATH. Try:" - echo -e " >>> source /savu_setup.sh" - echo -e "Aborting the tests." - exit 1 - fi - - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nProceeding with the tests." - break - elif [ "$input" = "n" ]; then - echo -e "\nAborting the tests." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done -elif [ $prompts = true ] ; then - echo -e "=============================================================\n" - while true ; do - read -n 1 -p "Are you happy to proceed with the installation? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - -#=====================installing other packages========================== - - echo -e "\nInstalling Savu in" $PREFIX - read -p ">>> Press ENTER to continue or input a different path: " input - - if [ "$input" != "" ]; then - PREFIX=$input - fi - - while true; do - if [ -d "$PREFIX" ]; then - PREFIX=$PREFIX/$conda_folder/ - break - fi - echo "The path" $PREFIX "is not recognised" - read -p ">>> Please input a different installation path: " input - PREFIX=$input - done - - if [ -d "$PREFIX" ]; then - echo - while true ; do - read -n 1 -p "The folder $PREFIX already exists. Continue? [y/n]" input - if [ "$input" = "y" ]; then - echo -e "\nStarting the installation........" - break - elif [ "$input" = "n" ]; then - echo -e "\nInstallation process terminated." - exit 0 - else - echo -e "\nYour input was unknown.\n\n" - fi - done - else - # create the folder - mkdir -p $PREFIX - fi -else - if [ ! -d "$PREFIX" ] ; then - mkdir -p $PREFIX - fi -fi - -if [ ! $test_flag ] ; then - - echo -e "\nThank you! Installing Savu into" $PREFIX"\n" - - unset IFS - string=`awk '/^miniconda/' $versions_file` - miniconda_version=`echo $string | cut -d " " -f 2` - wget https://repo.continuum.io/miniconda/Miniconda2-$miniconda_version-Linux-x86_64.sh -O $PREFIX/miniconda.sh; - bash $PREFIX/miniconda.sh -b -p $PREFIX/miniconda - PYTHONHOME=$PREFIX/miniconda/bin - export PATH="$PYTHONHOME:$PATH" - - conda install -y -q conda-build conda-env - conda install -y -q conda-verify - conda env update -n root -f $DIR/environment.yml - - echo "Building Savu..." - conda build $DIR/$savu_recipe - savubuild=`conda build $DIR/$savu_recipe --output` - echo "Installing Savu..." - conda install -y -q --use-local $savubuild - - path=$(python -c "import savu; import os; print os.path.abspath(savu.__file__)") - savu_path=${path%/savu/__init__.pyc} - - # get the savu version - install_path=$(python -c "import savu; import savu.version as sv; print sv.__install__") - recipes=$savu_path/$install_path/conda-recipes - - launcher_path=`command -v savu_launcher.sh` - launcher_path=${launcher_path%/savu_launcher.sh} - if [ "$facility" ]; then - cp $savu_path/system_files/$facility/mpi/savu_launcher.sh $launcher_path - cp $savu_path/system_files/$facility/mpi/savu_mpijob.sh $launcher_path - fi - - - - #----------------------------------------------------------------- -# echo "Building astra toolbox..." -# conda build $recipes/astra -# astrabuild=`conda build $recipes/astra --output` - - echo "Installing astra toolbox..." -# conda install -y -q --use-local $astrabuild - -# site_path=$(python -c "import site; print site.getsitepackages()[0]") -# cp $recipes/astra/astra.pth $site_path -# astra_lib_path=$site_path/astra/lib - - conda install -y -q -c astra-toolbox/label/dev astra-toolbox - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building xraylib..." - conda build $recipes/xraylib - xraylibbuild=`conda build $recipes/xraylib --output` - - echo "Installing xraylib..." - conda install -y -q --use-local $xraylibbuild --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing tomopy..." - # these packages were missing in copied environment - string=`awk '/^tomopy/' $versions_file` - tomopy_version=`echo $string | cut -d " " -f 2` - string=`awk '/^dxchange/' $versions_file` - dxchange_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c dgursoy tomopy==$tomopy_version --no-deps - conda install -y -q -c dgursoy dxchange==$dxchange_version --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing ccpi-reconstruction" - string=`awk '/^ccpi/' $versions_file` - ccpi_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c ccpi ccpi-reconstruction==$ccpi_version -c conda-forge --no-deps - conda install -y -q -c ccpi cil_reconstruction==$ccpi_version -c conda-forge --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing pyfai" - string=`awk '/^pyfai/' $versions_file` - pyfai_version=`echo $string | cut -d " " -f 2` - conda install -y -q -c conda-forge pyfai==$pyfai_version --no-deps - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Installing mpi4py..." - pip uninstall -y -q mpi4py || true - string=`awk '/^mpi4py/' $versions_file` - mpi4py_version=`echo $string | cut -d " " -f 2` - env MPICC=$MPICC pip install mpi4py==$mpi4py_version - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building hdf5..." - conda uninstall -y -q hdf5 || true - conda build $recipes/hdf5 - hdf5build=`conda build $recipes/hdf5 --output` - - echo "Installing hdf5..." - conda install -y -q --use-local $hdf5build - #----------------------------------------------------------------- - - #----------------------------------------------------------------- - echo "Building h5py..." - conda uninstall -y -q h5py || true - conda build $recipes/h5py --no-test - h5pybuild=`conda build $recipes/h5py --output` - - echo "Installing h5py..." - conda install -y -q --use-local $h5pybuild - #----------------------------------------------------------------- - - - echo -e "\n\t***************************************************" - echo -e "\t Package installation complete" - echo -e "\t Check $error_log for errors" - echo -e "\t***************************************************\n" - -fi - -if [ ! $test_flag ] ; then - if [ $prompts = true ] ; then - while true; do - read -n 1 -p "Would you like to run the tests? (y/n): " input - if [ "$input" = "y" ]; then - echo -e "\nYour input was yes" - test_flag=true - break - elif [ "$input" = "n" ]; then - echo -e "Aborting test run..." - echo -e "To run the tests later type: " - echo -e " >>> bash savu_v2.1/savu_installer.sh --tests_only" - exit 0 - else - echo -e "\nYour input was unknown.\n" - fi - done - fi - - setup_script=$PREFIX/'savu_setup.sh' - echo -e "\nCreating a Savu setup script" $setup_script - ( [ -e "$setup_script" ] || touch "$setup_script" ) && [ ! -w "$setup_script" ] && echo cannot write to $setup_script && exit 1 - MPIHOME="$(dirname "$(dirname $MPICC)")" - echo '#!bin/bash' > $setup_script - echo ""export PATH=$MPIHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$MPIHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export PYTHONUSERSITE True"" >> $setup_script - echo ""export PATH=$PYTHONHOME:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$PYTHONHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$astra_lib_path:'$LD_LIBRARY_PATH'"" >> $setup_script - if [ "$CUDAHOME" ]; then - echo ""export PATH=$CUDAHOME/bin:'$PATH'"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$CUDAHOME/lib64:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - if [ "$FFTWHOME" ]; then - echo ""export FFTWDIR=$FFTWHOME"" >> $setup_script - echo ""export LD_LIBRARY_PATH=$FFTWHOME/lib:'$LD_LIBRARY_PATH'"" >> $setup_script - fi - - source $setup_script -fi - -if [ $test_flag ] ; then - - nGPUs=$(nvidia-smi -L | wc -l) - - echo -e "\n***** Testing Savu setup *****\n" - savu_quick_tests - - echo -e "\n*****Running Savu single-threaded local tests *****\n" - savu_full_tests - - echo -e "\n************** Single-threaded local tests complete ******************\n" - - test_dir=`mktemp -d` - tmp_dir=`mktemp -d` - tmpfile=$tmp_dir/temp_output.txt - touch $tmpfile - -fi - -if [ ! $test_flag ] ; then - - launcher_path=`command -v savu_launcher.sh` - mpijob_path=`command -v savu_mpijob.sh` - echo -e "\n\n===============================IMPORTANT NOTICES================================" - echo -e "If you are installing Savu for cluster use, you will need to update the savu " - echo -e "launcher scripts:" - echo -e "\n$launcher_path" - echo -e "$mpijob_path\n" - echo -e "\n\nTo run Savu type 'source $savu_setup' to set relevant paths every time you" - echo -e "open a new terminal. Alternatively, if you are using the Modules system, see" - echo -e "$DIR/module_template for an example module file." - echo -e "================================================================================\n" - - echo -e "*************** SAVU INSTALLATION COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu installer......\n" - echo -e "=============================================================\n" -else - echo -e "\n\n*************** SAVU TESTS COMPLETE! ******************\n" - echo -e " ......Thank you for running the Savu tests......\n" - echo -e " Please check $tmpfile for errors\n" - echo -e "=======================================================\n" -fi - -exit 0 - diff --git a/install/unstable_master/savu/savu_master/build.sh b/install/unstable_master/savu/savu_master/build.sh deleted file mode 100644 index b6fbaff2b..000000000 --- a/install/unstable_master/savu/savu_master/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --facility $FACILITY # Python command to install the script. - diff --git a/install/unstable_master/savu/version.txt b/install/unstable_master/savu/version.txt deleted file mode 100644 index abb84c2c7..000000000 --- a/install/unstable_master/savu/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -2.3.2 - diff --git a/install/unstable_master/savu/versions_file.txt b/install/unstable_master/savu/versions_file.txt deleted file mode 100644 index 116a12c1a..000000000 --- a/install/unstable_master/savu/versions_file.txt +++ /dev/null @@ -1,7 +0,0 @@ -miniconda 4.5.4 # change this to 'latest' for latest version -mpi4py 3.0.0 -tomopy 1.0.1 -dxchange 0.1.1 -ccpi 0.10.0 -pyfai 0.15.0 - diff --git a/launchers/Build HTML Docs.launch b/launchers/Build HTML Docs.launch deleted file mode 100644 index 00aa35cd3..000000000 --- a/launchers/Build HTML Docs.launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for file framework (process01).launch b/launchers/Run DLS MPI test for file framework (process01).launch deleted file mode 100644 index 8b4065d18..000000000 --- a/launchers/Run DLS MPI test for file framework (process01).launch +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/launchers/Run DLS MPI test for file framework (process06).launch b/launchers/Run DLS MPI test for file framework (process06).launch deleted file mode 100644 index f21f9edd2..000000000 --- a/launchers/Run DLS MPI test for file framework (process06).launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for file framework (process10).launch b/launchers/Run DLS MPI test for file framework (process10).launch deleted file mode 100644 index ad5b35044..000000000 --- a/launchers/Run DLS MPI test for file framework (process10).launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for file framework 1xCPU (process01).launch b/launchers/Run DLS MPI test for file framework 1xCPU (process01).launch deleted file mode 100644 index b0c72c674..000000000 --- a/launchers/Run DLS MPI test for file framework 1xCPU (process01).launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for file framework 6xCPU + 2xGPU (process06).launch b/launchers/Run DLS MPI test for file framework 6xCPU + 2xGPU (process06).launch deleted file mode 100644 index 19d83fb6b..000000000 --- a/launchers/Run DLS MPI test for file framework 6xCPU + 2xGPU (process06).launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for file framework 6xCPU + 2xGPU (process08).launch b/launchers/Run DLS MPI test for file framework 6xCPU + 2xGPU (process08).launch deleted file mode 100644 index aa4cfa3dc..000000000 --- a/launchers/Run DLS MPI test for file framework 6xCPU + 2xGPU (process08).launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for framework (timeseries_field_corrections).launch b/launchers/Run DLS MPI test for framework (timeseries_field_corrections).launch deleted file mode 100644 index 34ec34552..000000000 --- a/launchers/Run DLS MPI test for framework (timeseries_field_corrections).launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for savu.plugins.median_filter.launch b/launchers/Run DLS MPI test for savu.plugins.median_filter.launch deleted file mode 100644 index 4bf25ddb8..000000000 --- a/launchers/Run DLS MPI test for savu.plugins.median_filter.launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for savu.plugins.simple_recon.launch b/launchers/Run DLS MPI test for savu.plugins.simple_recon.launch deleted file mode 100644 index ca56eb2a6..000000000 --- a/launchers/Run DLS MPI test for savu.plugins.simple_recon.launch +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/launchers/Run DLS MPI test for savu.plugins.timeseries_field_corrections.launch b/launchers/Run DLS MPI test for savu.plugins.timeseries_field_corrections.launch deleted file mode 100644 index 158c71688..000000000 --- a/launchers/Run DLS MPI test for savu.plugins.timeseries_field_corrections.launch +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/lib/dezing.so b/lib/dezing.so deleted file mode 100755 index 212ef66fe..000000000 Binary files a/lib/dezing.so and /dev/null differ diff --git a/lib/unwarp.so b/lib/unwarp.so deleted file mode 100755 index b39f49ccb..000000000 Binary files a/lib/unwarp.so and /dev/null differ diff --git a/plugin_examples/example_median_filter.py b/plugin_examples/example_median_filter.py index fd286bc90..7a02535d0 100644 --- a/plugin_examples/example_median_filter.py +++ b/plugin_examples/example_median_filter.py @@ -44,7 +44,7 @@ def filter_frames(self, data): return result def set_filter_padding(self, in_data, out_data): - padding = (self.parameters['kernel_size'][0]-1)/2 + padding = (self.parameters['kernel_size'][0]-1) // 2 in_data[0].padding = {'pad_multi_frames': padding} out_data[0].padding = {'pad_multi_frames': padding} diff --git a/install/2_3_1_install/conda-recipes/__init__.py b/plugin_examples/plugin_templates/__init__.py similarity index 90% rename from install/2_3_1_install/conda-recipes/__init__.py rename to plugin_examples/plugin_templates/__init__.py index 05ec9bfd3..70c726306 100644 --- a/install/2_3_1_install/conda-recipes/__init__.py +++ b/plugin_examples/plugin_templates/__init__.py @@ -16,7 +16,7 @@ All the plugin architecture for Savu is contained here -.. moduleauthor:: Mark Basham +.. moduleauthor:: Nicola Wadeson """ diff --git a/install/1_2_install/conda-recipes/__init__.py b/plugin_examples/plugin_templates/general/__init__.py similarity index 100% rename from install/1_2_install/conda-recipes/__init__.py rename to plugin_examples/plugin_templates/general/__init__.py diff --git a/plugin_examples/plugin_templates/general/plugin_template4.py b/plugin_examples/plugin_templates/general/plugin_template4.py index 1eecd0ec8..545080605 100644 --- a/plugin_examples/plugin_templates/general/plugin_template4.py +++ b/plugin_examples/plugin_templates/general/plugin_template4.py @@ -59,14 +59,14 @@ def setup(self): # example of getting information from the dataset metadata dictionary # this may have been populated by a previous plugin mData = in_dataset[0].meta_data - if 'PeakEnergy' in mData.get_dictionary().keys(): + if 'PeakEnergy' in list(mData.get_dictionary().keys()): nChannels = mData.get('PeakEnergy') else: nChannels = 4096 # for test data self.set_preview(in_dataset[1], self.parameters['preview']) - print out_dataset[0].get_axis_labels() + print(out_dataset[0].get_axis_labels()) in_pData[0].plugin_data_setup('SINOGRAM', nChannels) in_pData[1].plugin_data_setup('SINOGRAM', 'single') diff --git a/plugin_examples/plugin_templates/general/plugin_template6.py b/plugin_examples/plugin_templates/general/plugin_template6.py index a446f38a9..3b85e919f 100644 --- a/plugin_examples/plugin_templates/general/plugin_template6.py +++ b/plugin_examples/plugin_templates/general/plugin_template6.py @@ -79,7 +79,7 @@ def new_shape(self, full_shape, data): core_dirs = data.get_core_dimensions() new_shape = list(full_shape) for dim in core_dirs: - new_shape[dim] = full_shape[dim]/self.parameters['bin_size'] + new_shape[dim] = full_shape[dim] // self.parameters['bin_size'] return tuple(new_shape) def pre_process(self): diff --git a/plugin_examples/plugin_templates/general/plugin_template7.py b/plugin_examples/plugin_templates/general/plugin_template7.py index aa960a99f..2bc05aed4 100644 --- a/plugin_examples/plugin_templates/general/plugin_template7.py +++ b/plugin_examples/plugin_templates/general/plugin_template7.py @@ -86,7 +86,7 @@ def setup(self): core_dims = set(range(0, len(shape))).difference(set(slice_dim)) sinomovie = {'core_dims': tuple(core_dims), 'slice_dims': slice_dim} out_dataset[0].add_pattern("SINOMOVIE", **sinomovie) - print out_dataset[0].get_data_patterns()['SINOMOVIE'] + print(out_dataset[0].get_data_patterns()['SINOMOVIE']) #================== populate plugin datasets ========================== in_pData, out_pData = self.get_plugin_datasets() diff --git a/install/2_1_install/__init__.py b/plugin_examples/plugin_templates/iterative/__init__.py similarity index 90% rename from install/2_1_install/__init__.py rename to plugin_examples/plugin_templates/iterative/__init__.py index 05ec9bfd3..70c726306 100644 --- a/install/2_1_install/__init__.py +++ b/plugin_examples/plugin_templates/iterative/__init__.py @@ -16,7 +16,7 @@ All the plugin architecture for Savu is contained here -.. moduleauthor:: Mark Basham +.. moduleauthor:: Nicola Wadeson """ diff --git a/savu/core/basic_plugin_runner.py b/savu/core/basic_plugin_runner.py index 3fc6c4143..ecce22399 100644 --- a/savu/core/basic_plugin_runner.py +++ b/savu/core/basic_plugin_runner.py @@ -71,7 +71,7 @@ def _run_plugin_list(self): count += 1 # terminate any remaining datasets - for data in self.exp.index['in_data'].values(): + for data in list(self.exp.index['in_data'].values()): self._transport_terminate_dataset(data) cu.user_message("***********************") diff --git a/savu/core/checkpointing.py b/savu/core/checkpointing.py index 4b6a1f7aa..30f579678 100644 --- a/savu/core/checkpointing.py +++ b/savu/core/checkpointing.py @@ -61,7 +61,7 @@ def _initialise(self, comm): self._exp._barrier(communicator=comm, msg=msg) def _create_dataset(self, f, name, val): - if name in f.keys(): + if name in list(f.keys()): f[name][...] = val else: f.create_dataset(name, data=val, dtype=np.int16) @@ -110,12 +110,12 @@ def __does_file_exist(self, thefile, level): def __set_dataset_metadata(self, f, dtype): self.meta_data.set(dtype, {}) - if dtype not in f.keys(): + if dtype not in list(f.keys()): return entry = f[dtype] - for name, gp in entry.iteritems(): + for name, gp in entry.items(): data_entry = gp.require_group('meta_data') - for key, value in data_entry.iteritems(): + for key, value in data_entry.items(): self.meta_data.set([dtype, name, key], value[key][...]) def _get_dataset_metadata(self, dtype, name): diff --git a/savu/core/plugin_runner.py b/savu/core/plugin_runner.py index d76f2a071..597cfc4cf 100644 --- a/savu/core/plugin_runner.py +++ b/savu/core/plugin_runner.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - """ .. module:: plugin_runner :platform: Unix @@ -29,7 +28,6 @@ class PluginRunner(object): """ Plugin list runner, which passes control to the transport layer. """ - def __init__(self, options, name='PluginRunner'): class_name = "savu.core.transports." + options["transport"] \ + "_transport" @@ -45,7 +43,7 @@ def __init__(self, options, name='PluginRunner'): def _run_plugin_list(self): """ Create an experiment and run the plugin list. - """ + """ self.exp._setup(self) plugin_list = self.exp.meta_data.plugin_list @@ -60,7 +58,8 @@ def _run_plugin_list(self): self._transport_pre_plugin_list_run() cp = self.exp.checkpoint - for i in range(cp.get_checkpoint_plugin(), n_plugins): + checkpoint_plugin = cp.get_checkpoint_plugin() + for i in range(checkpoint_plugin, n_plugins): self.exp._set_experiment_for_current_plugin(i) memory_before = cu.get_memory_usage_linux() @@ -85,7 +84,7 @@ def _run_plugin_list(self): self._transport_post_plugin_list_run() # terminate any remaining datasets - for data in self.exp.index['in_data'].values(): + for data in list(self.exp.index['in_data'].values()): self._transport_terminate_dataset(data) self.__output_final_message() @@ -139,32 +138,43 @@ def _run_plugin_list_setup(self, plugin_list): n_loaders = self.exp.meta_data.plugin_list._get_n_loaders() n_plugins = plugin_list._get_n_processing_plugins() plist = plugin_list.plugin_list - + # set loaders for i in range(n_loaders): pu.plugin_loader(self.exp, plist[i]) self.exp._set_initial_datasets() - + # run all plugin setup methods and store information in experiment # collection count = 0 for plugin_dict in plist[n_loaders:n_loaders + n_plugins]: - plugin = pu.plugin_loader(self.exp, plugin_dict, check=True) - plugin._revert_preview(plugin.get_in_datasets()) - plugin_dict['cite'] = plugin.get_citation_information() - plugin._clean_up() - self.exp._update(plugin_dict) - self.exp._merge_out_data_to_in() + self.__plugin_setup(plugin_dict, count) count += 1 - self.exp._reset_datasets() - self.exp._finalise_setup(plugin_list) plugin_list._add_missing_savers(self.exp) - cu.user_message("Plugin list check complete!") - + # ********* transport function *********** self._transport_update_plugin_list() + # check added savers + for plugin_dict in plist[n_loaders + count:]: + self.__plugin_setup(plugin_dict, count) + count += 1 + + self.exp._reset_datasets() + self.exp._finalise_setup(plugin_list) + cu.user_message("Plugin list check complete!") + + + def __plugin_setup(self, plugin_dict, count): + self.exp.meta_data.set("nPlugin", count) + plugin = pu.plugin_loader(self.exp, plugin_dict, check=True) + plugin._revert_preview(plugin.get_in_datasets()) + plugin_dict['cite'] = plugin.get_citation_information() + plugin._clean_up() + self.exp._update(plugin_dict) + self.exp._merge_out_data_to_in() + def __check_gpu(self): """ Check if the process list contains GPU processes and determine if GPUs exists. Add GPU processes to the processes list if required.""" @@ -180,6 +190,8 @@ def __check_gpu(self): try: pv.nvmlInit() count = int(pv.nvmlDeviceGetCount()) + if count == 0: + raise Exception("No GPUs found") logging.debug("%s GPUs have been found.", count) if not self.exp.meta_data.get('test_state'): @@ -189,7 +201,7 @@ def __check_gpu(self): raise Exception("Unfortunately, GPU %i is busy. Try \ resubmitting the job to the queue." % i) except Exception as e: - raise Exception("Unable to run GPU plugins: %s", e.message) + raise Exception("Unable to run GPU plugins: %s", str(e)) self.__set_gpu_processes(count) def __set_gpu_processes(self, count): diff --git a/savu/core/transport_setup.py b/savu/core/transport_setup.py index 4b29877ac..caf81d3be 100644 --- a/savu/core/transport_setup.py +++ b/savu/core/transport_setup.py @@ -62,12 +62,12 @@ def __mpi_setup(self, options): rank_map = [i for s in uniq_hosts for i in range(n_cores) if s == hosts[i]] - index = sorted(range(len(rank_map)), key=lambda k: rank_map[k]) + index = sorted(list(range(len(rank_map))), key=lambda k: rank_map[k]) all_processes = [(names*n_nodes)[index[i]] for i in range(n_cores)] options['processes'] = all_processes rank = MPI.COMM_WORLD.rank options['process'] = rank - node_number = rank_map.index(rank)/n_cores_per_node + node_number = rank_map.index(rank) // n_cores_per_node local_name = all_processes[rank] self.__set_logger_parallel("%03i" % node_number, local_name, options) @@ -103,7 +103,7 @@ def __set_logger_single(self, options): def __set_logger_parallel(self, number, rank, options): """ Set parallel logger. """ - machine = 'M%-5s%-6s' % (number, rank) + machine = 'M%-5s%-6s' % (number, rank) log_format = 'L %(relativeCreated)12d ' + machine +\ ' %(levelname)-6s %(message)s' level = cu._get_log_level(options) @@ -138,7 +138,7 @@ def __add_user_logging(self, options): logger = logging.getLogger() filename = os.path.join(options['out_path'], 'user.log') cu.add_user_log_handler(logger, filename) - if 'syslog_server' in options.keys(): + if 'syslog_server' in list(options.keys()): try: cu.add_syslog_log_handler(logger, options['syslog_server'], options['syslog_port']) diff --git a/savu/core/transports/base_transport.py b/savu/core/transports/base_transport.py index 3dfba5f5d..6185a28bc 100644 --- a/savu/core/transports/base_transport.py +++ b/savu/core/transports/base_transport.py @@ -103,10 +103,10 @@ def process_setup(self, plugin): pDict['in_data'], pDict['out_data'] = plugin.get_datasets() pDict['in_sl'] = self._get_all_slice_lists(pDict['in_data'], 'in') pDict['out_sl'] = self._get_all_slice_lists(pDict['out_data'], 'out') - pDict['nIn'] = range(len(pDict['in_data'])) - pDict['nOut'] = range(len(pDict['out_data'])) + pDict['nIn'] = list(range(len(pDict['in_data']))) + pDict['nOut'] = list(range(len(pDict['out_data']))) pDict['nProc'] = len(pDict['in_sl']['process']) - if 'transfer' in pDict['in_sl'].keys(): + if 'transfer' in list(pDict['in_sl'].keys()): pDict['nTrans'] = len(pDict['in_sl']['transfer'][0]) else: pDict['nTrans'] = 1 @@ -128,7 +128,7 @@ def _transport_process(self, plugin): cp, sProc, sTrans = self.__get_checkpoint_params(plugin) count = 0 # temporary solution - prange = range(sProc, pDict['nProc']) + prange = list(range(sProc, pDict['nProc'])) kill = False for count in range(sTrans, nTrans): end = True if count == nTrans-1 else False @@ -188,7 +188,7 @@ def _initialise(self, plugin): return pDict, result, nTrans def _log_completion_status(self, count, nTrans, name): - percent_complete = count/(nTrans * 0.01) + percent_complete: float = count / (nTrans * 0.01) cu.user_message("%s - %3i%% complete" % (name, percent_complete)) def _transport_checkpoint(self): @@ -197,12 +197,14 @@ def _transport_checkpoint(self): return False def _transport_kill_signal(self): - """ An opportunity to send a kill signal to the framework. Return + """ + An opportunity to send a kill signal to the framework. Return True or False. """ return False def _get_all_slice_lists(self, data_list, dtype): - """ Get all slice lists for the current process. + """ + Get all slice lists for the current process. :param list(Data) data_list: Datasets :returns: A list of dictionaries containing slice lists for each \ @@ -212,20 +214,21 @@ def _get_all_slice_lists(self, data_list, dtype): sl_dict = {} for data in data_list: sl = data._get_transport_data()._get_slice_lists_per_process(dtype) - for key, value in sl.iteritems(): + for key, value in sl.items(): if key not in sl_dict: sl_dict[key] = [value] else: sl_dict[key].append(value) - for key in [k for k in ['process', 'unpad'] if k in sl_dict.keys()]: - nData = range(len(sl_dict[key])) + for key in [k for k in ['process', 'unpad'] if k in list(sl_dict.keys())]: + nData = list(range(len(sl_dict[key]))) #rep = range(len(sl_dict[key][0])) sl_dict[key] = [[sl_dict[key][i][j] for i in nData if j < len(sl_dict[key][i])] for j in range(len(sl_dict[key][0]))] return sl_dict def _transfer_all_data(self, count): - """ Transfer data from file and pad if required. + """ + Transfer data from file and pad if required. :param int count: The current frame index. :returns: All data for this frame and associated padded slice lists @@ -234,7 +237,7 @@ def _transfer_all_data(self, count): pDict = self.pDict data_list = pDict['in_data'] - if 'transfer' in pDict['in_sl'].keys(): + if 'transfer' in list(pDict['in_sl'].keys()): slice_list = \ [pDict['in_sl']['transfer'][i][count] for i in pDict['nIn']] else: @@ -270,7 +273,8 @@ def _get_output_data(self, result, count): return result def _return_all_data(self, count, result, end): - """ Transfer plugin results for current frame to backing files. + """ + Transfer plugin results for current frame to backing files. :param int count: The current frame index. :param list(np.ndarray) result: plugin results @@ -280,9 +284,10 @@ def _return_all_data(self, count, result, end): data_list = pDict['out_data'] slice_list = None - if 'transfer' in pDict['out_sl'].keys(): + if 'transfer' in list(pDict['out_sl'].keys()): slice_list = \ - [pDict['out_sl']['transfer'][i][count] for i in pDict['nOut'] if len(pDict['out_sl']['transfer'][i]) > count] + [pDict['out_sl']['transfer'][i][count] for i in pDict['nOut'] \ + if len(pDict['out_sl']['transfer'][i]) > count] result = [result] if type(result) is not list else result @@ -302,7 +307,7 @@ def _set_global_frame_index(self, plugin, frame_list, nProc): process_frames = [] for f in frame_list: if len(f): - process_frames.append(range(f[0]*nProc, (f[-1]+1)*nProc)) + process_frames.append(list(range(f[0]*nProc, (f[-1]+1)*nProc))) process_frames = np.array(process_frames) nframes = plugin.get_plugin_in_datasets()[0].get_total_frames() @@ -340,6 +345,10 @@ def __create_expand_function(self, data): new_slice = [slice(None)]*len(data.get_shape()) possible_slices = [copy.copy(new_slice)] + pData = data._get_plugin_data() + if pData._get_rank_inc(): + possible_slices[0] += [0]*pData._get_rank_inc() + if len(slice_dirs) > 1: for sl in slice_dirs[1:]: new_slice[sl] = None @@ -360,11 +369,16 @@ def __create_squeeze_function(self, data): max_frames = pData._get_max_frames_process() pad = True if pData.padding and data.get_slice_dimensions()[0] in \ - pData.padding._get_padding_directions().keys() else False + list(pData.padding._get_padding_directions().keys()) else False + n_core_dims = len(data.get_core_dimensions()) squeeze_dims = data.get_slice_dimensions() if max_frames > 1 or pData._get_no_squeeze() or pad: squeeze_dims = squeeze_dims[1:] + n_core_dims +=1 + if pData._get_rank_inc(): + sl = [(slice(None))]*n_core_dims + [None]*pData._get_rank_inc() + return lambda x: np.squeeze(x[tuple(sl)], axis=squeeze_dims) return lambda x: np.squeeze(x, axis=squeeze_dims) def _remove_excess_data(self, data, result, slice_list): @@ -410,7 +424,7 @@ def _set_file_details(self, files): self.exp.meta_data.set('link_type', {}) self.exp.meta_data.set('filename', {}) self.exp.meta_data.set('group_name', {}) - for key in self.exp.index['out_data'].keys(): + for key in list(self.exp.index['out_data'].keys()): self.exp.meta_data.set(['link_type', key], files['link_type'][key]) self.exp.meta_data.set(['filename', key], files['filename'][key]) self.exp.meta_data.set(['group_name', key], @@ -419,7 +433,7 @@ def _set_file_details(self, files): def _get_filenames(self, plugin_dict): count = self.exp.meta_data.get('nPlugin') + 1 files = {"filename": {}, "group_name": {}, "link_type": {}} - for key in self.exp.index["out_data"].keys(): + for key in list(self.exp.index["out_data"].keys()): name = key + '_p' + str(count) + '_' + \ plugin_dict['id'].split('.')[-1] + '.h5' link_type = self._get_link_type(key) @@ -455,7 +469,7 @@ def _populate_nexus_file(self, data): if link_type is 'final_result': group_name = 'final_result_' + data.get_name() else: - link = nxs_entry.require_group(link_type) + link = nxs_entry.require_group(link_type.encode("ascii")) link.attrs[NX_CLASS] = 'NXcollection' nxs_entry = link @@ -481,7 +495,7 @@ def _output_metadata(self, data, entry, name, dump=False): os.path.abspath(self.exp.meta_data.get('data_file')) def __output_data_type(self, entry, data, name): - data = data.data if 'data' in data.__dict__.keys() else data + data = data.data if 'data' in list(data.__dict__.keys()) else data if isinstance(data, h5py.Dataset): return @@ -489,20 +503,20 @@ def __output_data_type(self, entry, data, name): entry.attrs[NX_CLASS] = 'NXcollection' ltype = self.exp.meta_data.get('link_type') - if name in ltype.keys() and ltype[name] == 'input_data': + if name in list(ltype.keys()) and ltype[name] == 'input_data': self.__output_data(entry, data.__class__.__name__, 'cls') return args, kwargs, cls, extras = data._get_parameters(data.get_clone_args()) - for key, value in kwargs.iteritems(): + for key, value in kwargs.items(): gp = entry.require_group('kwargs') if isinstance(value, BaseType): self.__output_data_type(gp.require_group(key), value, key) else: self.__output_data(gp, value, key) - for key, value in extras.iteritems(): + for key, value in extras.items(): gp = entry.require_group('extras') if isinstance(value, BaseType): self.__output_data_type(gp.require_group(key), value, key) @@ -515,7 +529,7 @@ def __output_data_type(self, entry, data, name): self.__output_data(entry, cls, 'cls') - if 'data' in data.__dict__.keys() and not \ + if 'data' in list(data.__dict__.keys()) and not \ isinstance(data.data, h5py.Dataset): gp = entry.require_group('data') self.__output_data_type(gp, data.data, 'data') @@ -524,17 +538,17 @@ def __output_data(self, entry, data, name): if isinstance(data, dict): entry = entry.require_group(name) entry.attrs[NX_CLASS] = 'NXcollection' - for key, value in data.iteritems(): + for key, value in data.items(): self.__output_data(entry, value, key) else: try: self.__create_dataset(entry, name, data) - except: + except Exception: try: import json - data = np.array([json.dumps(data)]) + data = np.array([json.dumps(data).encode("ascii")]) self.__create_dataset(entry, name, data) - except: + except Exception: try: data = cu._savu_encoder(data) self.__create_dataset(entry, name, data) @@ -542,7 +556,7 @@ def __output_data(self, entry, data, name): raise Exception('Unable to output %s to file.' % name) def __create_dataset(self, entry, name, data): - if name not in entry.keys(): + if name not in list(entry.keys()): entry.create_dataset(name, data=data) else: entry[name][...] = data @@ -554,18 +568,21 @@ def __output_axis_labels(self, data, entry): axes = [] count = 0 for labels in axis_labels: - name = labels.keys()[0] + name = list(labels.keys())[0] axes.append(name) entry.attrs[name + '_indices'] = count - mData = ddict[name] if name in ddict.keys() \ + mData = ddict[name] if name in list(ddict.keys()) \ else np.arange(data.get_shape()[count]) if isinstance(mData, list): mData = np.array(mData) + if 'U' in str(mData.dtype): + mData = mData.astype(np.string_) + axis_entry = entry.require_dataset(name, mData.shape, mData.dtype) axis_entry[...] = mData[...] - axis_entry.attrs['units'] = labels.values()[0] + axis_entry.attrs['units'] = list(labels.values())[0] count += 1 entry.attrs['axes'] = axes @@ -582,7 +599,7 @@ def __output_data_patterns(self, data, entry): def _output_metadata_dict(self, entry, mData): entry.attrs[NX_CLASS] = 'NXcollection' - for key, value in mData.iteritems(): + for key, value in mData.items(): nx_data = entry.require_group(key) if isinstance(value, dict): self._output_metadata_dict(nx_data, value) diff --git a/savu/core/transports/dosna_transport.py b/savu/core/transports/dosna_transport.py index 4f1cedf2f..097ea3f1f 100644 --- a/savu/core/transports/dosna_transport.py +++ b/savu/core/transports/dosna_transport.py @@ -94,7 +94,7 @@ def _transport_pre_plugin_list_run(self): # loaders have completed now revert back to DosnaTransport, so any # output datasets created by a plugin will use this. self.hdf5 = Hdf5Utils(self.exp) - exp_coll = self.exp._get_experiment_collection() + exp_coll = self.exp._get_collection() self.data_flow = self.exp.meta_data.plugin_list._get_dataset_flow() #self.exp.meta_data.set('transport', 'dosna') plist = self.exp.meta_data.plugin_list @@ -163,7 +163,7 @@ def _setup_dosna_objects(self): if 'current_and_next' in self.exp.meta_data.get_dictionary(): current_and_next = self.exp.meta_data.get('current_and_next') - for key in out_data_dict.keys(): + for key in list(out_data_dict.keys()): out_data = out_data_dict[key] filename = self.exp.meta_data.get(["filename", key]) self._create_dosna_dataset(filename, out_data, key, diff --git a/savu/core/transports/hdf5_transport.py b/savu/core/transports/hdf5_transport.py index e48700b35..570ae87d2 100644 --- a/savu/core/transports/hdf5_transport.py +++ b/savu/core/transports/hdf5_transport.py @@ -59,7 +59,7 @@ def _transport_pre_plugin_list_run(self): self.hdf5 = Hdf5Utils(self.exp) self.exp_coll = self.exp._get_collection() self.data_flow = self.exp.meta_data.plugin_list._get_dataset_flow() - n_plugins = range(len(self.exp_coll['datasets'])) + n_plugins = list(range(len(self.exp_coll['datasets']))) for i in n_plugins: self.exp._set_experiment_for_current_plugin(i) @@ -73,7 +73,7 @@ def _transport_pre_plugin(self): self._set_file_details(self.files[count]) def _transport_post_plugin(self): - for data in self.exp.index['out_data'].values(): + for data in list(self.exp.index['out_data'].values()): if not data.remove: msg = self.__class__.__name__ + "_transport_post_plugin." self.exp._barrier(msg=msg) @@ -97,10 +97,10 @@ def _transport_checkpoint(self): self._metadata_dump(f, 'out_data') def _metadata_dump(self, f, gname): - if gname in f.keys(): + if gname in list(f.keys()): del f[gname] - for data in self.exp.index[gname].values(): + for data in list(self.exp.index[gname].values()): name = data.get_name() entry = f.require_group(gname + '/' + name) self._output_metadata(data, entry, name, dump=True) @@ -123,6 +123,6 @@ def _transport_cleanup(self, i): n_plugins = len(self.exp_coll['datasets']) for i in range(i, n_plugins): self.exp._set_experiment_for_current_plugin(i) - for data in self.exp.index['out_data'].values(): + for data in list(self.exp.index['out_data'].values()): self.hdf5._close_file(data) diff --git a/savu/core/utils.py b/savu/core/utils.py index 9b0db1027..c843f7c72 100644 --- a/savu/core/utils.py +++ b/savu/core/utils.py @@ -28,6 +28,22 @@ import logging.handlers as handlers from mpi4py import MPI +from typing import Union + + +def ensure_string(string: Union[str, bytes]) -> str: + """ + Python 3 and HDF5 mixture has created a somewhat ambiguous situation + where the strings in Python 3 are UTF-8 by default, + but HDF5 strings cannot be unicode. + + This function should wrap strings coming in from HDF5 to ensure that they + are decoded to UTF-8 so that they can be treated at `str` in Python, and + not `bytes`. + """ + if isinstance(string, bytes): + return string.decode("ascii") + return string def logfunction(func): @@ -214,15 +230,12 @@ def _send_email(address): def _savu_encoder(data): - return '#savu_encoded#' + str(data) - + return f'#savu_encoded#{data}'.encode("ascii") def _savu_decoder(data): + data = ensure_string(data) if isinstance(data, str) and len(data.split('#savu_encoded#')) > 1: - exec ('data = ' + data.split('#savu_encoded#')[-1]) - return data - return data - + return eval(data.split('#savu_encoded#')[-1]) def get_memory_usage_linux(kb=False, mb=True): """ diff --git a/savu/data/chunking.py b/savu/data/chunking.py index ff718f75c..e99958e5a 100644 --- a/savu/data/chunking.py +++ b/savu/data/chunking.py @@ -21,7 +21,7 @@ import copy import logging -from fractions import gcd +from math import gcd import numpy as np @@ -32,16 +32,16 @@ class Chunking(object): def __init__(self, exp, patternDict): self.pattern_dict = patternDict - self.current = patternDict['current'][patternDict['current'].keys()[0]] + self.current = patternDict['current'][list(patternDict['current'].keys())[0]] if patternDict['next']: - self.next = patternDict['next'][patternDict['next'].keys()[0]] + self.next = patternDict['next'][list(patternDict['next'].keys())[0]] else: self.next = self.current try: - self.next_pattern = patternDict['next'].keys()[0] + self.next_pattern = list(patternDict['next'].keys())[0] except AttributeError: - self.next_pattern = patternDict['current'].keys()[0] + self.next_pattern = list(patternDict['current'].keys())[0] self.exp = exp self.core = None @@ -53,14 +53,14 @@ def __lustre_workaround(self, chunks, shape): nChunks_to_create_file = \ np.ceil(np.prod(np.array(shape)/np.array(chunks, dtype=np.float))) nProcesses = self.exp.meta_data.get('processes') - dims = range(len(shape)) + dims = list(range(len(shape))) chunks = list(chunks) if nChunks_to_create_file < nProcesses: idx = [i for i in dims if shape[i] - chunks[i] > 0 and chunks[i] > 1] idx = idx if idx else [i for i in dims if chunks[i] > 1] if idx: - chunks[idx[0]] = int(np.ceil(chunks[idx[0]]/2.0)) + chunks[idx[0]] = int(np.ceil(chunks[idx[0]] / 2.0)) return tuple(chunks) else: raise Exception('There is an error in the lustre workaround') @@ -100,7 +100,7 @@ def __set_adjust_params(self, shape): for i in range(array_len): adjust_max[i] = shape[adjust_dim[i]] - + inc_dict = {'up': [1]*array_len, 'down': [1]*array_len} bounds = {'min': [1]*array_len, 'max': adjust_max} return {'dim': adjust_dim, 'inc': inc_dict, 'bounds': bounds} @@ -149,11 +149,10 @@ def __core_core(self, dim, adj_idx, adjust, shape): def __core_slice(self, dim, adj_idx, adjust, shape): max_frames = self.__get_max_frames_dict()[dim] adjust['inc']['up'][adj_idx] = '+' + str(max_frames) - adjust['inc']['down'][adj_idx] = '/2' # '-' + str(max_frames) + adjust['inc']['down'][adj_idx] = '/2' # '-' + str(max_frames) # which is the slice dimension: current or next? - ddict = self.current if dim in self.current['slice_dims'] \ - else self.next + ddict = self.current if dim in self.current['slice_dims'] else self.next shape, allslices = self.__get_shape(shape, ddict) adjust['bounds']['max'][adj_idx] = self.__max_frames_per_process( @@ -169,7 +168,7 @@ def __core_other(self, dim, adj_idx, adjust, shape): def __slice_slice(self, dim, adj_idx, adjust, shape): max_frames = self.__get_max_frames_dict()[dim] adjust['inc']['up'][adj_idx] = '+' + str(max_frames) - adjust['inc']['down'][adj_idx] = '/2' # '-' + str(max_frames) + adjust['inc']['down'][adj_idx] = '/2' shape1 = np.prod([shape[s] for s in self.current['slice_dims']]) shape2 = np.prod([shape[s] for s in self.next['slice_dims']]) @@ -192,7 +191,7 @@ def __get_max_frames_dict(self): if current_sdir == next_sdir: c_max = self.current[mft] n_max = self.next[mft] - least_common_multiple = (c_max*n_max)/gcd(c_max, n_max) + least_common_multiple = (c_max*n_max) // gcd(c_max, n_max) ddict = {current_sdir: least_common_multiple} else: ddict = {self.current['slice_dims'][0]: self.current[mft], @@ -202,7 +201,7 @@ def __get_max_frames_dict(self): def __get_shape(self, shape, ddict): """ Get shape taking into account padding. """ shape = [shape[s] for s in ddict['slice_dims']] - if 'transfer_shape' not in ddict.keys(): + if 'transfer_shape' not in list(ddict.keys()): return shape[0], np.prod(shape) size_list = [ddict['transfer_shape'][s] for s in ddict['slice_dims']] trans_per_dim = np.ceil(np.array(shape)/np.array( @@ -215,7 +214,7 @@ def __max_frames_per_process(self, shape, nFrames, allslices=None): Calculate the max possible frames per process """ nSlices = allslices if allslices else shape - total_plugin_runs = np.ceil(float(nSlices)/nFrames) + total_plugin_runs = np.ceil(float(nSlices) / nFrames) frame_list = np.arange(total_plugin_runs) nProcs = len(self.exp.meta_data.get('processes')) frame_list_per_proc = np.array_split(frame_list, nProcs) @@ -284,7 +283,7 @@ def __get_idx_increase(self, chunks, adjust): def __get_idx_order(self, adjust, chunks, direction): process_order = [self.slice1, self.core] - sl = slice(None, None, -1) + sl = slice(None, None, -1) if direction is 'up': sl = slice(None, None, 1) process_order = process_order[::-1] diff --git a/savu/data/data_structures/data.py b/savu/data/data_structures/data.py index 8dc5feadc..101e537f2 100644 --- a/savu/data/data_structures/data.py +++ b/savu/data/data_structures/data.py @@ -136,6 +136,17 @@ def set_original_shape(self, shape): self.orig_shape = shape self.set_shape(shape) + def get_original_shape(self): + """ + Returns the original shape of the data before previewing + + Returns + ------- + tuple + Original data shape. + """ + return self.orig_shape + def get_shape(self): """ Get the dataset shape @@ -231,11 +242,15 @@ def add_volume_patterns(self, x, y, z): :params int y: dimension to be associated with y-axis :params int z: dimension to be associated with z-axis """ - self.add_pattern("VOLUME_YZ", **self.__get_dirs_for_volume(y, z, x)) self.add_pattern("VOLUME_XZ", **self.__get_dirs_for_volume(x, z, y)) - self.add_pattern("VOLUME_XY", **self.__get_dirs_for_volume(x, y, z)) - if self.data_info.get("nDims") > 3: + if y: + self.add_pattern( + "VOLUME_YZ", **self.__get_dirs_for_volume(y, z, x)) + self.add_pattern( + "VOLUME_XY", **self.__get_dirs_for_volume(x, y, z)) + + if self.data_info.get("nDims") > 3 and y: self.add_pattern("VOLUME_3D", **self.__get_dirs_for_volume_3D()) def __get_dirs_for_volume(self, dim1, dim2, sdir, dim3=None): @@ -244,11 +259,10 @@ def __get_dirs_for_volume(self, dim1, dim2, sdir, dim3=None): all_dims = range(self.data_info.get("nDims")) vol_dict = {} vol_dict['core_dims'] = (dim1, dim2) - - slice_dir = [sdir] + slice_dir = [sdir] if type(sdir) is int else [] for ddir in all_dims: if ddir not in [dim1, dim2, sdir]: - slice_dir.append(ddir) + slice_dir.append(ddir) vol_dict['slice_dims'] = tuple(slice_dir) return vol_dict @@ -258,6 +272,7 @@ def __get_dirs_for_volume_3D(self): cdim = [] for v in ['VOLUME_YZ', 'VOLUME_XY', 'VOLUME_XZ']: cdim += (patterns[v]['core_dims']) + cdim = set(cdim) sdim = tuple(set(range(self.data_info.get("nDims"))).difference(cdim)) return {"core_dims": tuple(cdim), "slice_dims": sdim} @@ -290,40 +305,41 @@ def get_axis_labels(self): """ return self.data_info.get('axis_labels') - def get_data_dimension_by_axis_label(self, name, contains=False): + def get_data_dimension_by_axis_label(self, name, contains=False, exists=False): """ Get the dimension of the data associated with a particular axis_label. :param str name: The name of the axis_label :keyword bool contains: Set this flag to true if the name is only part of the axis_label name + :keyword bool exists: Set to True to return False rather than Exception :returns: The associated axis number :rtype: int """ axis_labels = self.data_info.get('axis_labels') for i in range(len(axis_labels)): if contains is True: - for names in axis_labels[i].keys(): + for names in list(axis_labels[i].keys()): if name in names: return i else: - if name in axis_labels[i].keys(): + if name in list(axis_labels[i].keys()): return i + if exists: + return False raise Exception("Cannot find the specifed axis label.") def _finalise_patterns(self): """ Adds a main axis (fastest changing) to SINOGRAM and PROJECTON patterns. """ - check = 0 + check = 0 check += self.__check_pattern('SINOGRAM') check += self.__check_pattern('PROJECTION') - if check is 2 and len(self.get_shape()) > 2: + if check == 2 and len(self.get_shape()) > 2: self.__set_main_axis('SINOGRAM') self.__set_main_axis('PROJECTION') - elif check is 1: - pass def __check_pattern(self, pattern_name): """ Check if a pattern exists. @@ -339,10 +355,10 @@ def __convert_pattern_dimensions(self, dtype): """ Replace negative indices in pattern kwargs. """ pattern = self.get_data_patterns()[dtype] - if 'main_dir' in pattern.keys(): + if 'main_dir' in list(pattern.keys()): del pattern['main_dir'] - nDims = sum([len(i) for i in pattern.values()]) + nDims = sum([len(i) for i in list(pattern.values())]) for p in pattern: ddirs = pattern[p] pattern[p] = self._non_negative_directions(ddirs, nDims) @@ -387,7 +403,7 @@ def get_axis_label_keys(self): axis_labels = self.data_info.get('axis_labels') axis_label_keys = [] for labels in axis_labels: - for key in labels.keys(): + for key in list(labels.keys()): axis_label_keys.append(key) return axis_label_keys @@ -397,8 +413,8 @@ def amend_axis_label_values(self, slice_list): """ axis_labels = self.get_axis_labels() for i in range(len(slice_list)): - label = axis_labels[i].keys()[0] - if label in self.meta_data.get_dictionary().keys(): + label = list(axis_labels[i].keys())[0] + if label in list(self.meta_data.get_dictionary().keys()): values = self.meta_data.get(label) preview_sl = [slice(None)]*len(values.shape) preview_sl[0] = slice_list[i] @@ -410,7 +426,7 @@ def get_core_dimensions(self): :returns: value associated with pattern key ``core_dims`` :rtype: tuple """ - return self._get_plugin_data().get_pattern().values()[0]['core_dims'] + return list(self._get_plugin_data().get_pattern().values())[0]['core_dims'] def get_slice_dimensions(self): """ Get the slice data dimensions associated with the current pattern. @@ -418,7 +434,7 @@ def get_slice_dimensions(self): :returns: value associated with pattern key ``slice_dims`` :rtype: tuple """ - return self._get_plugin_data().get_pattern().values()[0]['slice_dims'] + return list(self._get_plugin_data().get_pattern().values())[0]['slice_dims'] def get_itemsize(self): """ Returns bytes per entry """ diff --git a/savu/data/data_structures/data_add_ons.py b/savu/data/data_structures/data_add_ons.py index 28acbb293..d138138b3 100644 --- a/savu/data/data_structures/data_add_ons.py +++ b/savu/data/data_structures/data_add_ons.py @@ -38,7 +38,7 @@ def __init__(self, pData): self.padding_dirs = {} self.pad_dict = None self.dims = None - self.pattern_name = pData.get_pattern().keys()[0] + self.pattern_name = list(pData.get_pattern().keys())[0] self.pattern = pData.get_pattern()[self.pattern_name] self.dims = self.__set_dims() self.mode = 'edge' @@ -121,7 +121,7 @@ def _get_padding_directions(self): :returns: padding dictionary :rtype: dict """ - for key in self.padding_dirs.keys(): + for key in list(self.padding_dirs.keys()): if sum(self.padding_dirs[key].values()) is 0: del self.padding_dirs[key] return self.padding_dirs @@ -132,7 +132,7 @@ def _get_plugin_padding_directions(self): :returns: padding dictionary :rtype: dict """ - for key in self.padding_dirs.keys(): + for key in list(self.padding_dirs.keys()): if sum(self.padding_dirs[key].values()) is 0: del self.padding_dirs[key] return self.padding_dirs diff --git a/savu/data/data_structures/data_create.py b/savu/data/data_structures/data_create.py index 35d52e745..7e370c8b6 100644 --- a/savu/data/data_structures/data_create.py +++ b/savu/data/data_structures/data_create.py @@ -57,7 +57,7 @@ def create_dataset(self, *args, **kwargs): {0} \n {1} \n {2} \n {3} """ - #self.dtype = + #self.dtype = self.set_dtype(kwargs.get('dtype', np.float32)) self.remove = kwargs.get('remove', False) self.raw = kwargs.get('raw', False) @@ -122,7 +122,7 @@ def __copy_patterns(self, copy_data): if isinstance(copy_data, DataCreate): patterns = copy.deepcopy(copy_data.get_data_patterns()) else: - data = copy_data.keys()[0] + data = list(copy_data.keys())[0] pattern_list = copy_data[data] all_patterns = copy.deepcopy(data.get_data_patterns()) @@ -150,7 +150,7 @@ def __copy_patterns_removing_dimensions(self, pattern_list, all_patterns, dim_map = [a for a in range(nDims) if a not in dims] patterns = {} - for name, pattern_dict in copy_patterns.iteritems(): + for name, pattern_dict in copy_patterns.items(): empty_flag = False for ddir in ['slice_dims', 'core_dims']: s_dims = self._non_negative_directions( @@ -169,7 +169,7 @@ def __create_axis_labels(self, axis_labels): if isinstance(axis_labels, DataCreate): self.__copy_labels(axis_labels) elif isinstance(axis_labels, dict): - data = axis_labels.keys()[0] + data = list(axis_labels.keys())[0] self.__copy_labels(data) self.__amend_axis_labels(axis_labels[data]) else: @@ -197,8 +197,8 @@ def __add_extra_dims_labels(self): nDims = self.data_info.get('nDims') axis_labels = self.data_info.get('axis_labels') axis_labels.extend([0]*len(params_dict)) - for key, value in params_dict.iteritems(): - title = value['label'].encode('ascii', 'ignore') + for key, value in params_dict.items(): + title = value['label'] name, unit = title.split('.') axis_labels[nDims + key] = {name: unit} # add parameter values to the meta_data @@ -246,7 +246,7 @@ def __insert_axis_labels(self, label): def _set_data_patterns(self, patterns): """ Add missing dimensions to patterns and populate data info dict. """ - all_dims = range(len(self.get_shape())) + all_dims = list(range(len(self.get_shape()))) for p in patterns: pDims = patterns[p]['core_dims'] + patterns[p]['slice_dims'] for dim in all_dims: diff --git a/savu/data/data_structures/data_notes.py b/savu/data/data_structures/data_notes.py index 1f277e8f7..d5a759e91 100644 --- a/savu/data/data_structures/data_notes.py +++ b/savu/data/data_structures/data_notes.py @@ -40,7 +40,7 @@ def _set_preview_note(): represents the set of indices specified by: >>> a = np.tile(np.arange(start, stop, step), (chunk, 1)) - >>> b = np.transpose(np.tile(np.arange(chunk)-chunk/2, \ + >>> b = np.transpose(np.tile(np.arange(chunk)-chunk // 2, \ (a.shape[1], 1))) >>> indices = np.ravel(np.transpose(a + b)) @@ -52,16 +52,16 @@ def _set_preview_note(): then the list is invalid. When chunk > 1, new start and end values will be: - >>> new_start = start - int(chunk/2) + >>> new_start = start - int(chunk / 2) >>> new_end = range(start, stop, step)[-1] + \ -(step - int(chunk/2)) +(step - int(chunk / 2)) **accepted values**: Each entry is executed using :func:`eval` so simple formulas are\ allowed and may contain the following keywords: * ``:`` is a simplification for 0:end:1:1 (all values) - * ``mid`` is int(shape[dim]/2)-1 + * ``mid`` is int(shape[dim] / 2)-1 * ``end`` is shape[dim] """ diff --git a/savu/data/data_structures/data_types/base_type.py b/savu/data/data_structures/data_types/base_type.py index 057372df4..17a03aaae 100644 --- a/savu/data/data_structures/data_types/base_type.py +++ b/savu/data/data_structures/data_types/base_type.py @@ -68,8 +68,8 @@ def _set_parameters(self, args, kwargs, cls, cls_path, extras): cls = cls_path.split('.')[-1] func = pu.load_class(mod, cls).__init__ - argspec = inspect.getargspec(func) - if len(argspec[0])-1 != len(args) + len(kwargs.keys()): + argspec = inspect.getfullargspec(func) + if len(argspec[0])-1 != len(args) + len(list(kwargs.keys())): raise Exception('Incorrect number of input arguments mapped.') data_lists = [True if isinstance(a, list) and isinstance(a[0], int) @@ -135,7 +135,7 @@ def _get_parameters(self, dtype_dict): args = [self._str_to_value(self, a) for a in args] extras = self.__get_extras_vals(extras) - for key, value in kwargs.iteritems(): + for key, value in kwargs.items(): kwargs[key] = self._str_to_value(self, value) return args, kwargs, dtype_dict['cls'], extras @@ -156,5 +156,5 @@ def __get_extras_vals(self, vals): return extras def __update_extra_params(self, newObj, extras): - for key, value in extras.iteritems(): + for key, value in extras.items(): setattr(newObj, key, value) diff --git a/savu/data/data_structures/data_types/data_plus_darks_and_flats.py b/savu/data/data_structures/data_types/data_plus_darks_and_flats.py index f1bd1ac7b..d35d73826 100644 --- a/savu/data/data_structures/data_types/data_plus_darks_and_flats.py +++ b/savu/data/data_structures/data_types/data_plus_darks_and_flats.py @@ -84,14 +84,14 @@ def get_dark_flat_slice_list(self): idx = np.arange(0, len(slice_list)) detX = self.data_obj.get_data_dimension_by_axis_label('detector_x') detY = self.data_obj.get_data_dimension_by_axis_label('detector_y') - remove = set(idx).difference(set([remove_dim, detX, detY])) + remove = set(idx).difference({remove_dim, detX, detY}) for dim in sorted(list(remove), reverse=True): del slice_list[dim] return slice_list def _set_scale(self, name, scale): - self.set_flat_scale(scale) if name is 'flat' else\ + self.set_flat_scale(scale) if name == 'flat' else \ self.set_dark_scale(scale) def set_flat_scale(self, fscale): @@ -112,7 +112,7 @@ def flat_mean(self): return self._calc_mean(self.flat()) def _calc_mean(self, data): - return data if len(data.shape) is 2 else\ + return data if len(data.shape) is 2 else \ data.mean(self.proj_dim).astype(np.float32) def get_index(self, key, full=False): @@ -137,11 +137,11 @@ def __get_preview_image_key(self, slice_list): # all data entries data_idx = np.where(self.image_key == 0)[0] preview_idx = np.arange(len(data_idx))[slice_list] - # check the inconsistency regarding the preview of angles, e.g [0:10,:,:] - if (len(data_idx) == len(preview_idx)): - remove_idx = np.delete(data_idx, preview_idx[::-1]) - else: - remove_idx = [] + # check the inconsistency regarding the preview of angles, e.g [0:10,:,:] + if len(data_idx) == len(preview_idx): + remove_idx = np.delete(data_idx, preview_idx[::-1]) + else: + remove_idx = [] return np.delete(self.image_key, remove_idx) def __get_reduced_index(self, key, slice_list): @@ -151,9 +151,9 @@ def __get_reduced_index(self, key, slice_list): return np.where(preview_image_key == key)[0] def __get_data(self, key): - index = [slice(None)]*self.nDims + index = [slice(None)] * self.nDims rot_dim = self.data_obj.get_data_dimension_by_axis_label( - 'rotation_angle') + 'rotation_angle') # separate the transfer of data for slice lists with entries far \ # apart, as this significantly improves hdf5 performance. @@ -162,7 +162,7 @@ def __get_data(self, key): if not k_idx.size: return np.array([]) - k_idx = np.split(k_idx, np.where(np.diff(k_idx) > split_diff)[0]+1) + k_idx = np.split(k_idx, np.where(np.diff(k_idx) > split_diff)[0] + 1) index[self.proj_dim] = k_idx[0] data = self.data[tuple(index)] @@ -181,11 +181,11 @@ def __get_data(self, key): def dark_image_key_data(self): """ Get the dark data. """ - return self.__get_data(2)*self.dscale + return self.__get_data(2) * self.dscale def flat_image_key_data(self): """ Get the flat data. """ - return self.__get_data(1)*self.fscale + return self.__get_data(1) * self.fscale def update_dark(self, data): self.dark_updated = data @@ -203,7 +203,7 @@ def _set_dark_and_flat(self): slice_list = self.data_obj._preview._get_preview_slice_list() if slice_list: self.dark_flat_slice_list = \ - [tuple(self.get_dark_flat_slice_list())]*3 + [tuple(self.get_dark_flat_slice_list())] * 3 class ImageKey(DataWithDarksAndFlats): @@ -251,16 +251,16 @@ def __ignore_image_key_entries(self, ignore): if not isinstance(ignore, list): ignore = [ignore] for batch in ignore: - self.image_key[start[batch-1]:end[batch-1]+1] = 3 + self.image_key[start[batch - 1]:end[batch - 1] + 1] = 3 def dark(self): """ Get the dark data. """ - return self.dark_updated if self.dark_updated is not False else\ + return self.dark_updated if self.dark_updated is not False else \ self.dark_image_key_data() def flat(self): """ Get the flat data. """ - return self.flat_updated if self.flat_updated is not False else\ + return self.flat_updated if self.flat_updated is not False else \ self.flat_image_key_data() @@ -331,7 +331,7 @@ def dark(self): dark = self.dark_image_key_data() self.image_key = self.orig_image_key return dark - return self.dark_path[self.dark_flat_slice_list[2]]*self.dscale + return self.dark_path[self.dark_flat_slice_list[2]] * self.dscale def flat(self): """ Get the flat data. """ @@ -342,4 +342,4 @@ def flat(self): flat = self.flat_image_key_data() self.image_key = self.orig_image_key return flat - return self.flat_path[self.dark_flat_slice_list[1]]*self.fscale + return self.flat_path[self.dark_flat_slice_list[1]] * self.fscale diff --git a/savu/data/data_structures/data_types/image_data.py b/savu/data/data_structures/data_types/image_data.py index 35992e7e6..1a49d71c2 100644 --- a/savu/data/data_structures/data_types/image_data.py +++ b/savu/data/data_structures/data_types/image_data.py @@ -80,10 +80,10 @@ def __getitem__(self, index): index, frameidx = self.__get_indices(index, size) for i in range(len(frameidx)): - image = fabio.open(self.file_names[frameidx[i]]).data[tiff_slices] + image = fabio.open(self.file_names[frameidx[i]]).data[tuple(tiff_slices)] for d in self.frame_dim: image = np.expand_dims(image, axis=d) - data[index[i]] = image + data[tuple(index[i])] = image return data diff --git a/savu/data/data_structures/data_types/map_3dto4d_h5.py b/savu/data/data_structures/data_types/map_3dto4d_h5.py index 88b33e3c6..7432c9dfa 100644 --- a/savu/data/data_structures/data_types/map_3dto4d_h5.py +++ b/savu/data/data_structures/data_types/map_3dto4d_h5.py @@ -41,7 +41,7 @@ def __init__(self, data_obj, n_angles): if inspect.isclass(type(self.data)): self.add_base_class_with_instance(type(self.data), self.data) - new_shape = (n_angles, shape[1], shape[2], shape[0]/n_angles) + new_shape = (n_angles, shape[1], shape[2], shape[0] // n_angles) self.shape = new_shape def clone_data_args(self, args, kwargs, extras): @@ -59,14 +59,14 @@ def __getitem__(self, idx): size = [len(np.arange(i.start, i.stop, i.step)) for i in idx] data = np.empty(size) - change = np.where(idx_dim0[:-1]/n_angles != idx_dim0[1:]/n_angles)[0] + change = np.where(idx_dim0[:-1] // n_angles != idx_dim0[1:] // n_angles)[0] start = idx_dim0[np.append(0, change+1)] stop = idx_dim0[np.append(change, len(idx_dim0)-1)] + 1 length = stop - start for i in range(len(start)): - new_slice = [slice(start[i], stop[i], idx[0].step), idx[1], idx[2]] - data[0:length[i], :, :, i] = self.data[tuple(new_slice)] + new_slice = (slice(start[i], stop[i], idx[0].step), idx[1], idx[2]) + data[0:length[i], :, :, i] = self.data[new_slice] return data def get_shape(self): diff --git a/savu/data/data_structures/data_types/mrc.py b/savu/data/data_structures/data_types/mrc.py index 33f1f168b..ad443d5b9 100644 --- a/savu/data/data_structures/data_types/mrc.py +++ b/savu/data/data_structures/data_types/mrc.py @@ -37,7 +37,7 @@ def __init__(self, Data, filename, stats=None): def __getitem__(self, idx): data = self.file.data[idx].astype(np.float32) - data = data/1000.0 + data /= 1000.0 return data def get_shape(self): diff --git a/savu/data/data_structures/data_types/stitch_data.py b/savu/data/data_structures/data_types/stitch_data.py index ebd2bad27..182143b17 100644 --- a/savu/data/data_structures/data_types/stitch_data.py +++ b/savu/data/data_structures/data_types/stitch_data.py @@ -35,6 +35,8 @@ def __init__(self, data_obj_list, stack_or_cat, dim, remove=[]): self.stack_or_cat = stack_or_cat self.dim = dim self.remove = remove + self.dark_updated = False + self.flat_updated = False super(StitchData, self).__init__() self.shape = None @@ -91,7 +93,7 @@ def _get_lists_stack(self, idx): [slice(0, len(np.arange(s.start, s.stop, s.step))) for s in idx] out_slice_list = np.tile(out_slice_list, (len(init_vals), 1)) - new_slices = [slice(i, i+1) for i in range(len(init_vals))] + new_slices = [slice(i, i + 1) for i in range(len(init_vals))] out_slice_list[:, self.dim] = new_slices return obj_list, in_slice_list, out_slice_list @@ -103,7 +105,7 @@ def _get_lists_cat(self, idx): index = np.where(np.diff(array) < 0)[0] + 1 val_list = np.array_split(array, index) - obj_vals = init_vals[np.append(0, index)]/inc + obj_vals = init_vals[np.append(0, index)] / inc active_obj_list = [] for i in obj_vals: active_obj_list.append(self.obj_list[i]) @@ -114,7 +116,7 @@ def _get_lists_cat(self, idx): def _set_in_slice_list(self, idx, val_list, entry): in_slice_list = np.tile(idx, (len(val_list), 1)) - new_slices = [slice(e[0], e[-1]+1, entry.step) for e in val_list] + new_slices = [slice(e[0], e[-1] + 1, entry.step) for e in val_list] in_slice_list[:, self.dim] = new_slices return in_slice_list @@ -125,9 +127,10 @@ def _set_out_slice_list(self, idx, val_list): length = np.append(0, np.cumsum([len(v) for v in val_list])) if self.stack_or_cat == 'cat': new_slices = \ - [slice(length[i-1], length[i]) for i in range(1, len(length))] + [slice(length[i - 1], length[i]) + for i in range(1, len(length))] else: - new_slices = [slice(i, i+1) for i in range(len(val_list))] + new_slices = [slice(i, i + 1) for i in range(len(val_list))] out_slice_list[:, self.dim] = new_slices return out_slice_list @@ -147,10 +150,38 @@ def _set_shape(self): shape.insert(self.dim, nObjs) self.shape = tuple(shape) + def update_dark(self, data): + self.dark_updated = data + + def update_flat(self, data): + self.flat_updated = data + + def dark(self): + if self.dark_updated: + return self.dark_updated + if self.stack_or_cat == 'stack': + return np.vstack(tuple(np.asarray([d.data.dark() for d in self.obj_list]))) + else: + return np.hstack(tuple(np.asarray([d.data.dark() for d in self.obj_list]))) + + def flat(self): + if self.flat_updated: + return self.flat_updated + if self.stack_or_cat == 'stack': + return np.vstack(tuple(np.asarray([d.data.flat() for d in self.obj_list]))) + else: + return np.hstack(tuple(np.asarray([d.data.flat() for d in self.obj_list]))) + def dark_mean(self): """ Get the averaged dark projection data. """ - return self.obj_list[0].data.dark_mean() + if self.stack_or_cat == 'stack': + return np.vstack(tuple(np.asarray([d.data.dark_mean() for d in self.obj_list]))) + else: + return np.hstack(tuple(np.asarray([d.data.dark_mean() for d in self.obj_list]))) def flat_mean(self): """ Get the averaged flat projection data. """ - return self.obj_list[0].data.flat_mean() + if self.stack_or_cat == 'stack': + return np.vstack(tuple(np.asarray([d.data.flat_mean() for d in self.obj_list]))) + else: + return np.hstack(tuple(np.asarray([d.data.flat_mean() for d in self.obj_list]))) diff --git a/savu/data/data_structures/plugin_data.py b/savu/data/data_structures/plugin_data.py index fde873bea..b03a9cce8 100644 --- a/savu/data/data_structures/plugin_data.py +++ b/savu/data/data_structures/plugin_data.py @@ -57,6 +57,7 @@ def __init__(self, data_obj, plugin=None): self.no_squeeze = False self.pre_tuning_shape = None self._frame_limit = None + self._increase_rank = 0 def _get_preview(self): return self._preview @@ -136,7 +137,7 @@ def _set_shape_transfer(self, slice_size): i = 0 for dim in slice_dir: shape[dim] = slice_size[i] - i += 1 + i += 1 return tuple(shape) def __get_slice_size(self, mft): @@ -144,7 +145,7 @@ def __get_slice_size(self, mft): mft. """ dshape = list(self.data_obj.get_shape()) - if 'fixed_dimensions' in self.meta_data.get_dictionary().keys(): + if 'fixed_dimensions' in list(self.meta_data.get_dictionary().keys()): fixed_dims = self.meta_data.get('fixed_dimensions') for d in fixed_dims: dshape[d] = 1 @@ -155,7 +156,7 @@ def __get_slice_size(self, mft): while(mft > 1 and i < len(size_list)): size_list[i] = min(dshape[i], mft) - mft -= np.prod(size_list) if np.prod(size_list) > 1 else 0 + mft //= np.prod(size_list) if np.prod(size_list) > 1 else 1 i += 1 self.meta_data.set('size_list', size_list) @@ -164,7 +165,7 @@ def __get_slice_size(self, mft): def set_bytes_per_frame(self): """ Return the size of a single frame in bytes. """ nBytes = self.data_obj.get_itemsize() - dims = self.get_pattern().values()[0]['core_dims'] + dims = list(self.get_pattern().values())[0]['core_dims'] frame_shape = [self.data_obj.get_shape()[d] for d in dims] b_per_f = np.prod(frame_shape)*nBytes return frame_shape, b_per_f @@ -236,7 +237,7 @@ def __set_slice_dimensions(self, first_sdim=None): pattern['slice_dims'] = tuple(slice_dims) self.meta_data.set('slice_dims', tuple(slice_dims)) - + def get_slice_dimension(self): """ Return the position of the slice dimension in relation to the data @@ -353,6 +354,21 @@ def _set_no_squeeze(self): def _get_no_squeeze(self): return self.no_squeeze + + def _set_rank_inc(self, n): + """ Increase the rank of the array passed to the plugin by n. + + :param int n: Rank increment. + """ + self._increase_rank = n + + def _get_rank_inc(self): + """ Return the increased rank value + + :returns: Rank increment + :rtype: int + """ + return self._increase_rank def _set_meta_data(self): fixed, _ = self._get_fixed_dimensions() @@ -365,8 +381,8 @@ def _set_meta_data(self): if diff: shape = shape_before_tuning sdir = sdir[:-diff] - - if 'fix_total_frames' in self.meta_data.get_dictionary().keys(): + + if 'fix_total_frames' in list(self.meta_data.get_dictionary().keys()): frames = self.meta_data.get('fix_total_frames') else: frames = np.prod([shape[d] for d in sdir]) @@ -412,24 +428,35 @@ def __check_distribution(self, mft): if temp != 0.0 and temp < warn_threshold: shape = self.meta_data.get('shape') sdir = self.meta_data.get('sdir') - logging.warn('UNEVEN FRAME DISTRIBUTION: shape %s, nframes %s ' + + logging.warning('UNEVEN FRAME DISTRIBUTION: shape %s, nframes %s ' + 'sdir %s, nprocs %s', shape, nframes, sdir, nprocs) def _set_padding_dict(self): if self.padding and not isinstance(self.padding, Padding): self.pad_dict = copy.deepcopy(self.padding) self.padding = Padding(self) - for key in self.pad_dict.keys(): + for key in list(self.pad_dict.keys()): getattr(self.padding, key)(self.pad_dict[key]) - def plugin_data_setup(self, pattern, nFrames, split=None, slice_axis=None): + def plugin_data_setup(self, pattern, nFrames, split=None, slice_axis=None, + getall=None): """ Setup the PluginData object. :param str pattern: A pattern name - :param int nFrames: How many frames to process at a time. Choose from\ - 'single', 'multiple', 'fixed_multiple' or an integer (an integer \ + :param int nFrames: How many frames to process at a time. Choose from + 'single', 'multiple', 'fixed_multiple' or an integer (an integer should only ever be passed in exceptional circumstances) + :keyword str slice_axis: An axis label associated with the fastest + changing (first) slice dimension. + :keyword list[pattern, axis_label] getall: A list of two values. If + the requested pattern doesn't exist then use all of "axis_label" + dimension of "pattern" as this is equivalent to one slice of the + original pattern. """ + + if pattern not in self.data_obj.get_data_patterns() and getall: + pattern, nFrames = self.__set_getall_pattern(getall, nFrames) + # slice_axis is first slice dimension self.__set_pattern(pattern, first_sdim=slice_axis) if isinstance(nFrames, list): @@ -437,6 +464,19 @@ def plugin_data_setup(self, pattern, nFrames, split=None, slice_axis=None): self.max_frames = nFrames self.split = split + def __set_getall_pattern(self, getall, nFrames): + """ Set framework changes required to get all of a pattern of lower + rank. + """ + pattern, slice_axis = getall + dim = self.data_obj.get_data_dimension_by_axis_label(slice_axis) + # ensure data remains the same shape when 'getall' dim has length 1 + self._set_no_squeeze() + if nFrames == 'multiple' or (isinstance(nFrames, int) and nFrames > 1): + self._set_rank_inc(1) + nFrames = self.data_obj.get_shape()[dim] + return pattern, nFrames + def plugin_data_transfer_setup(self, copy=None, calc=None): """ Set up the plugin data transfer frame parameters. If copy=pData (another PluginData instance) then copy """ @@ -446,7 +486,7 @@ def plugin_data_transfer_setup(self, copy=None, calc=None): if not copy and not calc: mft, mft_shape, mfp = self._calculate_max_frames() elif calc: - max_mft = calc.meta_data.get('max_frames_transfer') + max_mft = calc.meta_data.get('max_frames_transfer') max_mfp = calc.meta_data.get('max_frames_process') max_nProc = int(np.ceil(max_mft/float(max_mfp))) nProc = max_nProc @@ -490,17 +530,17 @@ def _get_plugin_data_size_params(self): frame_shape = self.meta_data.get('frame_shape') total_frames = self.meta_data.get('total_frames') tbytes = nBytes*np.prod(frame_shape)*total_frames - + params = {'nBytes': nBytes, 'frame_shape': frame_shape, 'total_frames': total_frames, 'transfer_bytes': tbytes} return params def __perform_checks(self, nFrames): options = ['single', 'multiple'] - if not isinstance(nFrames, int) and nFrames not in options: - e_str = "The value of nFrames is not recognised. Please choose " - "from 'single' and 'multiple' (or an integer in exceptional " - "circumstances)." + if not np.issubdtype(type(nFrames), np.int64) and nFrames not in options: + e_str = ("The value of nFrames is not recognised. Please choose " + + "from 'single' and 'multiple' (or an integer in exceptional " + + "circumstances).") raise Exception(e_str) def get_frame_limit(self): diff --git a/savu/data/data_structures/preview.py b/savu/data/data_structures/preview.py index 0563c8fb1..a90779fe4 100644 --- a/savu/data/data_structures/preview.py +++ b/savu/data/data_structures/preview.py @@ -77,9 +77,9 @@ def __convert_nprocs(self, preview_list): for i in range(len(preview_list)): if preview_list[i] == 'nprocs': nprocs = self.get_data_obj().exp.meta_data.get('nProcesses') - start = int(np.floor(nprocs/2.0)) - end = int(np.ceil(nprocs/2.0)) - preview_list[i] = 'mid-' + str(start) + ':mid+' + str(end) + start = int(np.floor(nprocs / 2.0)) + end = int(np.ceil(nprocs / 2.0)) + preview_list[i] = f'mid-{start}:mid-{end}' return preview_list def _add_preview_defaults(self, plist): @@ -154,7 +154,7 @@ def _get_preview_indices(self, preview_list): chunks = len(preview_list)*[None] for i in range(len(preview_list)): - if preview_list[i] is ':': + if preview_list[i] == ':': preview_list[i] = '0:end:1:1' vals = preview_list[i].split(':') starts[i], stops[i], steps[i], chunks[i] = \ @@ -162,14 +162,37 @@ def _get_preview_indices(self, preview_list): return starts, stops, steps, chunks + def get_integer_entries(self, plist): + """ + Convert Savu preview syntax to python slicing (similar) syntax, by + replacing Savu Built-in constants. + + Parameters + ---------- + plist : list + A Savu data preview list to reduce the data dimensions. + + Returns + ------- + list + A Savu preview list containing integers and no strings. + + """ + if plist: + vals = self._get_preview_indices(self._add_preview_defaults(plist)) + else: + shape = self.get_data_obj().get_shape() + vals = [[0]*len(shape), shape, [1]*len(shape), [1]*len(shape)] + return [':'.join(map(str, l)) for l in list(zip(*vals))] + def convert_indices(self, idx, dim): """ convert keywords to integers. """ dobj = self.get_data_obj() shape = dobj.get_shape() - mid = np.clip(np.ceil(shape[dim]/2.0).astype('int') - 1, 0, None) + mid = np.clip(np.ceil(shape[dim] / 2.0).astype('int') - 1, 0, None) end = shape[dim] - idx = [eval(equ) for equ in idx] + idx = [eval(equ, {"builtins": None}, {'mid': mid, 'end': end}) for equ in idx] idx = [idx[i] if idx[i] > -1 else shape[dim]+1+idx[i] for i in range(len(idx))] return idx @@ -186,7 +209,7 @@ def get_starts_stops_steps(self, key=None): """ mData = self.get_data_obj().data_info - if 'starts' not in mData.get_dictionary().keys(): + if 'starts' not in list(mData.get_dictionary().keys()): return None if key else [None]*4 if key is not None: diff --git a/savu/data/data_structures/utils.py b/savu/data/data_structures/utils.py index ac24f998b..4301c5c85 100644 --- a/savu/data/data_structures/utils.py +++ b/savu/data/data_structures/utils.py @@ -39,7 +39,8 @@ "TIMESERIES": 1, "MOTOR_POSITION": 2, "TANGENTOGRAM": 2, - "SINOMOVIE": 3} + "SINOMOVIE": 3, + "SINOGRAM_STACK": 3} def _deepcopy_data_object(dObj, new_obj): @@ -64,7 +65,7 @@ def _deepcopy_data_object(dObj, new_obj): def get_available_pattern_types(): - return pattern_list.keys() + return list(pattern_list.keys()) def get_pattern_rank(pattern): diff --git a/savu/data/experiment_collection.py b/savu/data/experiment_collection.py index 2766a279a..fa27660da 100644 --- a/savu/data/experiment_collection.py +++ b/savu/data/experiment_collection.py @@ -54,6 +54,7 @@ def __init__(self, options): self.plugin = None self._transport = None self._barrier_count = 0 + self._dataset_names_complete = False def get(self, entry): """ Get the meta data dictionary. """ @@ -72,6 +73,7 @@ def __meta_data_setup(self, process_file): template = self.meta_data.get('template') self.meta_data.plugin_list._populate_plugin_list(process_file, template=template) + self.meta_data.set("nPlugin", 0) # initialise def create_data_object(self, dtype, name, override=True): """ Create a data object. @@ -80,7 +82,7 @@ def create_data_object(self, dtype, name, override=True): :params str dtype: either "in_data" or "out_data". """ - if name not in self.index[dtype].keys() or override: + if name not in list(self.index[dtype].keys()) or override: self.index[dtype][name] = Data(name, self) data_obj = self.index[dtype][name] data_obj._set_transport_data(self.meta_data.get('transport')) @@ -97,18 +99,23 @@ def _setup(self, transport): def _finalise_setup(self, plugin_list): checkpoint = self.meta_data.get('checkpoint') + self._set_dataset_names_complete() # save the plugin list - one process, first time only if self.meta_data.get('process') == \ - len(self.meta_data.get('processes'))-1 and not checkpoint: + len(self.meta_data.get('processes'))-1 and not checkpoint: # links the input data to the nexus file plugin_list._save_plugin_list(self.meta_data.get('nxs_filename')) self._add_input_data_to_nxs_file(self._get_transport()) + self._set_dataset_names_complete() def _set_initial_datasets(self): self.initial_datasets = copy.deepcopy(self.index['in_data']) def _update(self, plugin_dict): data = self.index['out_data'].copy() + # clear output metadata after first setup + for d in list(data.values()): + d.meta_data._set_dictionary({}) self.collection['datasets'].append(data) self.collection['plugin_dict'].append(plugin_dict) @@ -152,6 +159,14 @@ def _add_input_data_to_nxs_file(self, transport): transport._populate_nexus_file(data) h5._link_datafile_to_nexus_file(data) + def _set_dataset_names_complete(self): + """ Missing in/out_datasets fields have been populated + """ + self._dataset_names_complete = True + + def _get_dataset_names_complete(self): + return self._dataset_names_complete + def _reset_datasets(self): self.index['in_data'] = self.initial_datasets @@ -205,11 +220,10 @@ def _set_nxs_file(self): self._create_nxs_entry() - def _create_nxs_entry(self): + def _create_nxs_entry(self): # what if the file already exists?! logging.debug("Testing nexus file") import h5py - if self.meta_data.get('process') == \ - len(self.meta_data.get('processes'))-1: + if self.meta_data.get('process') == len(self.meta_data.get('processes')) - 1 and not self.checkpoint: with h5py.File(self.meta_data.get('nxs_filename'), 'w') as nxs_file: entry_group = nxs_file.create_group('entry') entry_group.attrs['NX_class'] = 'NXentry' @@ -235,12 +249,13 @@ def _finalise_experiment_for_current_plugin(self): else: finalise['keep'].append(data) - # find in datasets to replace + # find in datasets to replace finalise['replace'] = [] - for out_name in self.index['out_data'].keys(): - if out_name in self.index['in_data'].keys(): + for out_name in list(self.index['out_data'].keys()): + if out_name in list(self.index['in_data'].keys()): finalise['replace'].append(self.index['in_data'][out_name]) + return finalise def _reorganise_datasets(self, finalise): @@ -260,13 +275,13 @@ def _reorganise_datasets(self, finalise): def __unreplicate_data(self): in_data_list = self.index['in_data'] from savu.data.data_structures.data_types.replicate import Replicate - for in_data in in_data_list.values(): + for in_data in list(in_data_list.values()): if isinstance(in_data.data, Replicate): in_data.data = in_data.data._reset() def _set_all_datasets(self, name): data_names = [] - for key in self.index["in_data"].keys(): + for key in list(self.index["in_data"].keys()): if 'itr_clone' not in key: data_names.append(key) return data_names diff --git a/savu/data/meta_data.py b/savu/data/meta_data.py index 71c0fc3f0..a9855a55e 100644 --- a/savu/data/meta_data.py +++ b/savu/data/meta_data.py @@ -53,7 +53,7 @@ def set(self, name, value): >>> MetaDataObj.get_dictionary() {'name1': {'name2': 3}} """ - maplist = (name if type(name) is list else [name]) + maplist = name if isinstance(name, list) else [name] self.get(maplist[:-1], True)[maplist[-1]] = value def get(self, maplist, setFlag=False, value=True, units=False): @@ -91,7 +91,7 @@ def get(self, maplist, setFlag=False, value=True, units=False): if isinstance(accum_value, dict) and accum_value: options = OrderedDict([('value', value), ('units', units)]) if not set(accum_value.keys()).difference(set(options.keys())): - accum_value = [accum_value[k] for k, v in options.iteritems() + accum_value = [accum_value[k] for k, v in options.items() if v is True] return accum_value @@ -103,7 +103,7 @@ def delete(self, entry): try: del self.get_dictionary()[entry] except KeyError: - logging.warn("Trying to delete a dictionary entry that doesn't " + logging.warning("Trying to delete a dictionary entry that doesn't " "exist.") def get_dictionary(self): diff --git a/savu/data/plugin_list.py b/savu/data/plugin_list.py index 4b23709d2..f22cba896 100644 --- a/savu/data/plugin_list.py +++ b/savu/data/plugin_list.py @@ -22,24 +22,23 @@ .. moduleauthor:: Nicola Wadeson """ -import os -import re import ast -import yaml -import h5py -import json import copy import inspect +import json import logging +import os +import re +from collections import defaultdict +import h5py import numpy as np -from collections import defaultdict +import yaml -import savu.plugins.utils as pu -from savu.data.meta_data import MetaData import savu.data.framework_citations as fc import savu.plugins.loaders.utils.yaml_utils as yu - +import savu.plugins.utils as pu +from savu.data.meta_data import MetaData NX_CLASS = 'NX_class' @@ -80,8 +79,7 @@ def _get_plugin_entry_template(self): def __get_json_keys(self): return ['data', 'desc', 'user', 'hide'] - def _populate_plugin_list(self, filename, activePass=False, - template=False): + def _populate_plugin_list(self, filename, active_pass=False, template=False): """ Populate the plugin list from a nexus file. """ plugin_file = h5py.File(filename, 'r') @@ -92,23 +90,25 @@ def _populate_plugin_list(self, filename, activePass=False, self.plugin_list = [] single_val = ['name', 'id', 'pos', 'active'] exclude = ['citation'] - for key in plugin_group.keys(): + for group in plugin_group.keys(): plugin = self._get_plugin_entry_template() - entry_keys = plugin_group[key].keys() - json_keys = [k for k in entry_keys for e in exclude if k not in - single_val and e not in k] + entry_keys = plugin_group[group].keys() + parameters = [k for k in entry_keys for e in exclude if k not in + single_val and e not in k] if 'active' in entry_keys: - plugin['active'] = plugin_group[key]['active'][0] - - if plugin['active'] or activePass: - plugin['name'] = plugin_group[key]['name'][0] - plugin['id'] = plugin_group[key]['id'][0] - plugin['pos'] = key.encode('ascii').strip() - - for jkey in json_keys: - plugin[jkey] = \ - self._byteify(json.loads(plugin_group[key][jkey][0])) + plugin['active'] = plugin_group[group]['active'][0] + + if plugin['active'] or active_pass: + plugin['name'] = plugin_group[group]['name'][0].decode("utf-8") + plugin['id'] = plugin_group[group]['id'][0].decode("utf-8") + plugin['pos'] = group.strip() + + for param in parameters: + try: + plugin[param] = json.loads(plugin_group[group][param][0]) + except ValueError as e: + raise ValueError(f"Error: {e}\n Could not parse key '{param}' from group '{group}' as JSON") self.plugin_list.append(plugin) if template: @@ -123,10 +123,10 @@ def _save_plugin_list(self, out_filename): entry = nxs_file.require_group('entry') self._save_framework_citations(self._overwrite_group( - entry, 'framework_citations', 'NXcollection')) + entry, 'framework_citations', 'NXcollection')) self.__save_savu_notes(self._overwrite_group( - entry, 'savu_notes', 'NXnote')) + entry, 'savu_notes', 'NXnote')) plugins_group = self._overwrite_group(entry, 'plugin', 'NXprocess') @@ -141,8 +141,8 @@ def _save_plugin_list(self, out_filename): def _overwrite_group(self, entry, name, nxclass): if name in entry: entry.pop(name) - group = entry.create_group(name) - group.attrs[NX_CLASS] = nxclass + group = entry.create_group(name.encode("ascii")) + group.attrs[NX_CLASS] = nxclass.encode("ascii") return group def __save_savu_notes(self, notes): @@ -151,15 +151,16 @@ def __save_savu_notes(self, notes): def __populate_plugins_group(self, plugins_group, plugin, count): if 'pos' in plugin.keys(): - num = int(re.findall('\d+', plugin['pos'])[0]) + num = int(re.findall(r'\d+', plugin['pos'])[0]) letter = re.findall('[a-z]', plugin['pos']) letter = letter[0] if letter else "" - plugin_group = \ - plugins_group.create_group("%*i%*s" % (4, num, 1, letter)) + group_name = "%*i%*s" % (4, num, 1, letter) else: - plugin_group = plugins_group.create_group("%*i" % (4, count)) + group_name = "%*i" % (4, count) + + plugin_group = plugins_group.create_group(group_name.encode("ascii")) - plugin_group.attrs[NX_CLASS] = 'NXnote' + plugin_group.attrs[NX_CLASS] = 'NXnote'.encode('ascii') required_keys = self._get_plugin_entry_template().keys() json_keys = self.__get_json_keys() @@ -170,34 +171,40 @@ def __populate_plugins_group(self, plugins_group, plugin, count): for key in required_keys: # only need to apply dumps if saving in configurator data = self.__dumps(plugin[key]) if key == 'data' else plugin[key] - array = np.array([json.dumps(data)]) if key in json_keys else\ - np.array([plugin[key]]) - plugin_group.create_dataset(key, array.shape, array.dtype, array) + + # get the string value + data = json.dumps(data) if key in json_keys else plugin[key] + # if the data is string it has to be encoded to ascii so that + # hdf5 can save out the bytes + if isinstance(data, str): + data = data.encode("ascii") + data = np.array([data]) + plugin_group.create_dataset(key.encode('ascii'), data.shape, data.dtype, data) def __dumps(self, data_dict): """ Replace any missing quotes around variables """ - for key, val in data_dict.iteritems(): + for key, val in data_dict.items(): if isinstance(val, str): try: data_dict[key] = ast.literal_eval(val) continue - except: + except Exception: pass try: data_dict[key] = yaml.load(val, Loader=yaml.SafeLoader) continue - except: + except Exception: pass try: - isdict = re.findall("[\{\}]+", val) + isdict = re.findall(r"[\{\}]+", val) if isdict: val = val.replace("[", "'[").replace("]", "]'") data_dict[key] = self.__dumps(yaml.load(val)) else: data_dict[key] = pu.parse_config_string(val) continue - except: + except Exception: # for when parameter tuning with lists is added to the framework if len(val.split(';')) > 1: pass @@ -217,37 +224,37 @@ def _output_plugin_citations(self, citations, group): if not isinstance(citations, list): citations = [citations] for cite in citations: - citation_group = group.create_group(cite.name) + citation_group = group.create_group(cite.name.encode("ascii")) cite.write(citation_group) def _save_framework_citations(self, group): framework_cites = fc.get_framework_citations() - count = 0 for cite in framework_cites: - citation_group = group.require_group(cite['name']) + citation_group = group.require_group(cite['name'].encode("ascii")) citation = CitationInformation() - del cite['name'] - for key, value in cite.iteritems(): - exec('citation.' + key + '= value') + citation.name = cite["name"] + citation.description = cite["description"] + citation.bibtex = cite["bibtex"] + citation.endnote = cite["endnote"] + citation.write(citation_group) - count += 1 def _get_docstring_info(self, plugin): plugin_inst = pu.plugins[plugin]() plugin_inst._populate_default_parameters() return plugin_inst.docstring_info - def _byteify(self, input): - if isinstance(input, dict): - return {self._byteify(key): self._byteify(value) - for key, value in input.iteritems()} - elif isinstance(input, list): - temp = [self._byteify(element) for element in input] - return temp - elif isinstance(input, unicode): - return input.encode('utf-8') - else: - return input + # def _byteify(self, input): + # if isinstance(input, dict): + # return {self._byteify(key): self._byteify(value) + # for key, value in input.items()} + # elif isinstance(input, list): + # temp = [self._byteify(element) for element in input] + # return temp + # elif isinstance(input, str): + # return input.encode('utf-8') + # else: + # return input def _set_datasets_list(self, plugin): in_pData, out_pData = plugin.get_plugin_datasets() @@ -261,9 +268,9 @@ def _populate_datasets_list(self, data): for d in data: name = d.data_obj.get_name() pattern = copy.deepcopy(d.get_pattern()) - pattern[pattern.keys()[0]]['max_frames_transfer'] = \ + pattern[list(pattern.keys())[0]]['max_frames_transfer'] = \ d.meta_data.get('max_frames_transfer') - pattern[pattern.keys()[0]]['transfer_shape'] = \ + pattern[list(pattern.keys())[0]]['transfer_shape'] = \ d.meta_data.get('transfer_shape') data_list.append({'name': name, 'pattern': pattern}) return data_list @@ -323,7 +330,7 @@ def _check_loaders(self): loaders = self._get_loaders_index() if loaders: - if loaders[0] is not 0 or loaders[-1]+1 is not len(loaders): + if loaders[0] != 0 or loaders[-1] + 1 != len(loaders): raise Exception("All loader plugins must be at the beginning " "of the plugin list") else: @@ -334,30 +341,35 @@ def _add_missing_savers(self, exp): """ Add savers for missing datasets. """ data_names = exp.index['in_data'].keys() saved_data = [] + for i in self._get_savers_index(): saved_data.append(self.plugin_list[i]['data']['in_datasets']) saved_data = set([s for sub_list in saved_data for s in sub_list]) for name in [data for data in data_names if data not in saved_data]: + pos = exp.meta_data.get('nPlugin')+1 + exp.meta_data.set('nPlugin', pos) process = {} - pos = int(re.search(r'\d+', self.plugin_list[-1]['pos']).group())+1 - self.saver_idx.append(pos) - plugin = pu.get_plugin('savu.plugins.savers.hdf5_saver', - {'in_datasets': [name]}, exp) + plugin = pu.load_class('savu.plugins.savers.hdf5_saver')() plugin.parameters['in_datasets'] = [name] process['name'] = plugin.name process['id'] = plugin.__module__ - process['pos'] = str(pos) + process['pos'] = str(pos+1) process['data'] = plugin.parameters process['active'] = True process['desc'] = plugin.parameters_desc - self._add(pos, process) + self._add(pos+1, process) + + def _update_datasets(self, plugin_no, data_dict): + n_loaders = self._get_n_loaders() + idx = self._get_n_loaders() + plugin_no + self.plugin_list[idx]['data'].update(data_dict) def _get_dataset_flow(self): datasets_idx = [] n_loaders = self._get_n_loaders() n_plugins = self._get_n_processing_plugins() - for i in range(self.n_loaders, n_loaders+n_plugins): + for i in range(self.n_loaders, n_loaders + n_plugins): datasets_idx.append(self.plugin_list[i]['data']['out_datasets']) return datasets_idx @@ -403,9 +415,9 @@ def _output_template(self, fname, process_fname): ptype, isyaml, key, value = p if isyaml: data_name = isyaml if ptype == 'local' else 'all' - local_dict.set([i+1, name, data_name, key], value) + local_dict.set([i + 1, name, data_name, key], value) elif ptype == 'local': - local_dict.set([i+1, name, key], value) + local_dict.set([i + 1, name, key], value) else: global_dict.set(['all', name, key], value) @@ -414,12 +426,12 @@ def _output_template(self, fname, process_fname): yu.dump_yaml(local_dict.get_dictionary(), stream) def __get_template_params(self, params, tlist, yaml=False): - for key, value in params.iteritems(): + for key, value in params.items(): if key == 'yaml_file': yaml_dict = self._get_yaml_dict(value) - for entry in yaml_dict.keys(): + for entry in list(yaml_dict.keys()): self.__get_template_params( - yaml_dict[entry]['params'], tlist, yaml=entry) + yaml_dict[entry]['params'], tlist, yaml=entry) value = pu.is_template_param(value) if value is not False: ptype, value = value @@ -439,17 +451,17 @@ def update_process_list(self, template): tdict = yu.read_yaml(template) del tdict['process_list'] - for plugin_no, entry in tdict.iteritems(): - plugin = entry.keys()[0] - for key, value in entry.values()[0].iteritems(): + for plugin_no, entry in tdict.items(): + plugin = list(entry.keys())[0] + for key, value in list(entry.values())[0].iteritems(): depth = self.dict_depth(value) if depth == 1: self._set_param_for_template_loader_plugin( - plugin_no, key, value) + plugin_no, key, value) elif depth == 0: if plugin_no == 'all': self._set_param_for_all_instances_of_a_plugin( - plugin, key, value) + plugin, key, value) else: data = self._get_plugin_data_dict(str(plugin_no)) data[key] = value @@ -459,7 +471,7 @@ def update_process_list(self, template): def dict_depth(self, d, depth=0): if not isinstance(d, dict) or not d: return depth - return max(self.dict_depth(v, depth+1) for k, v in d.iteritems()) + return max(self.dict_depth(v, depth + 1) for k, v in d.items()) def _set_param_for_all_instances_of_a_plugin(self, plugin, param, value): # find all plugins with this name and replace the param @@ -468,8 +480,8 @@ def _set_param_for_all_instances_of_a_plugin(self, plugin, param, value): p['data'][param] = value def _set_param_for_template_loader_plugin(self, plugin_no, data, value): - param_key = value.keys()[0] - param_val = value.values()[0] + param_key = list(value.keys())[0] + param_val = list(value.values())[0] pdict = self._get_plugin_data_dict(str(plugin_no))['template_param'] pdict = defaultdict(dict) if not pdict else pdict pdict[data][param_key] = param_val @@ -486,33 +498,32 @@ class CitationInformation(object): Descriptor of Citation Information for plugins """ - def __init__(self): - super(CitationInformation, self).__init__() - self.description = "Default Description" - self.doi = "Default DOI" - self.endnote = "Default Endnote" - self.bibtex = "Default Bibtex" - self.name = 'citation' + name: str = 'citation' + bibtex: str = "Default Bibtex" + description: str = "Default Description" + doi: str = "Default DOI" + endnote: str = "Default Endnote" def write(self, citation_group): + # classes don't have to be encoded to ASCII citation_group.attrs[NX_CLASS] = 'NXcite' - description_array = np.array([self.description]) - citation_group.create_dataset('description', + description_array = np.array([self.description.encode('ascii')]) + citation_group.create_dataset('description'.encode('ascii'), description_array.shape, description_array.dtype, description_array) - doi_array = np.array([self.doi]) - citation_group.create_dataset('doi', + doi_array = np.array([self.doi.encode('ascii')]) + citation_group.create_dataset('doi'.encode('ascii'), doi_array.shape, doi_array.dtype, doi_array) - endnote_array = np.array([self.endnote]) - citation_group.create_dataset('endnote', + endnote_array = np.array([self.endnote.encode('ascii')]) + citation_group.create_dataset('endnote'.encode('ascii'), endnote_array.shape, endnote_array.dtype, endnote_array) - bibtex_array = np.array([self.bibtex]) - citation_group.create_dataset('bibtex', + bibtex_array = np.array([self.bibtex.encode('ascii')]) + citation_group.create_dataset('bibtex'.encode('ascii'), bibtex_array.shape, bibtex_array.dtype, bibtex_array) diff --git a/savu/data/transport_data/base_transport_data.py b/savu/data/transport_data/base_transport_data.py index fcbd4a7c6..629281266 100644 --- a/savu/data/transport_data/base_transport_data.py +++ b/savu/data/transport_data/base_transport_data.py @@ -24,6 +24,7 @@ import copy import logging import numpy as np +from typing import List class BaseTransportData(object): @@ -94,7 +95,7 @@ def _calc_max_frames_transfer_multi(self, nFrames): def _set_boundaries(self): b_per_f = self.params.get('bytes_per_frame') b_per_p = self.params.get('bytes_per_process') - + mem_multiply = \ self._get_data_obj()._get_plugin_data()._plugin.get_mem_multiply() @@ -111,14 +112,15 @@ def _set_boundaries(self): if max_mft == 0: raise Exception("The size of a single frame exceeds the permitted " "maximum bytes per frame.") - min_mft = int(max(np.floor(float(min_bytes)/b_per_f), 1)) - + min_mft = int(max(np.floor(float(min_bytes) / b_per_f), 1)) + return min_mft, max_mft def __convert_str(self, val, b_per_p): if isinstance(val, str): - exec("value = " + val) - return value + # FIXME this is still a potential security risk! + value = eval(val, {'__builtins__': None, 'b_per_p': b_per_p}) + return value def __get_optimum_distribution(self, nFrames): """ The number of frames each process should retrieve from file at a @@ -127,7 +129,7 @@ def __get_optimum_distribution(self, nFrames): min_mft, max_mft = self.__get_boundaries(nFrames) if isinstance(nFrames, int) and nFrames > max_mft: - logging.warn("The requested %s frames excedes the maximum " + logging.warning("The requested %s frames excedes the maximum " "preferred of %s." % (nFrames, max_mft)) max_mft = nFrames @@ -138,8 +140,9 @@ def __get_optimum_distribution(self, nFrames): #nSlices = np.prod(slice_shape) nSlices = self.params['shape'][sdir[0]] - fchoices, size_list = \ - self._get_frame_choices(sdir, min(max_mft, nSlices)) + nFrames = 1 if isinstance(nFrames, str) else nFrames + fchoices, size_list = self._get_frame_choices( + sdir, nFrames, min(max_mft, max(nFrames, nSlices))) threshold_idx = [i for i in range(len(fchoices)) if fchoices[i] >= min_mft] @@ -153,7 +156,6 @@ def __get_optimum_distribution(self, nFrames): # idx=True) mft, idx = self._find_best_frame_distribution( fchoices, nSlices, self.params['mpi_procs'], idx=True) - return int(mft), fchoices, size_list def __refine_distribution_for_multi_mfp(self, mft, size_list, fchoices): @@ -188,7 +190,7 @@ def __refine_distribution_for_multi_mfp(self, mft, size_list, fchoices): def __get_boundaries(self, nFrames): min_mft, max_mft = self._set_boundaries() if isinstance(nFrames, int) and nFrames > max_mft: - logging.warn("The requested %s frames excedes the maximum " + logging.warning("The requested %s frames excedes the maximum " "preferred of %s." % (nFrames, max_mft)) max_mft = nFrames return min_mft, max_mft @@ -220,7 +222,7 @@ def _get_slice_dir_matrix(self, dim): self.data.get_preview().get_starts_stops_steps() chunk = chunks[dim] a = np.tile(np.arange(starts[dim], stops[dim], steps[dim]), (chunk, 1)) - b = np.transpose(np.tile(np.arange(chunk)-chunk/2, (a.shape[1], 1))) + b = np.transpose(np.tile(np.arange(chunk)-chunk // 2, (a.shape[1], 1))) dim_idx = a + b if dim_idx[dim_idx < 0].size: raise Exception('Cannot have a negative value in the slice list.') @@ -259,11 +261,12 @@ def _find_closest_lower(self, vlist, value): # the above method is commented out as it was found to be slower than the one # below - try again in a different version of HDF5 - def _get_frame_choices(self, sdir, max_mft): + def _get_frame_choices(self, sdir, min_mft, max_mft): """ Find all possible combinations of increasing slice dimension sizes with their product less than max_mft and return a list of these products. """ temp = [1]*len(sdir) + #temp[0] = min_mft # this works for ccpi but not mpimap shape = self.data.get_shape() idx = 0 choices = [] @@ -295,25 +298,8 @@ def _find_multiples_of_b_that_divide_a(self, a, b): def _find_best_frame_distribution(self, flist, nframes, nprocs, idx=False): """ Determine which of the numbers in the list of possible frame chunks gives the best distribution of frames per process. """ - multi_list = [(nframes/float(v))/nprocs for v in flist] + multi_list: List[float] = [(nframes / float(v)) / nprocs for v in flist] min_val, closest_lower_idx = self._find_closest_lower(multi_list, 1) - if idx: + if idx: return flist[closest_lower_idx], closest_lower_idx return flist[closest_lower_idx] - -# use this for multiple mft slice dimensions -# def _find_best_frame_distribution(self, size_list, nframes, nprocs, -# idx=False, value=1): -# """ Determine which of the numbers in the list of possible frame -# chunks gives the best distribution of frames per process. """ -# flist = np.prod(size_list, axis=1) -# allframes = np.prod(nframes) -# multi_list = [(allframes/float(v))/nprocs for v in flist] -# min_val, closest_lower_idx = self._find_closest_lower(multi_list, 1) -# -# # refine final slice dimension here to reduce additional padding -# # if slice_dims > 1 -# -# if idx: -# return flist[closest_lower_idx], closest_lower_idx -# return flist[closest_lower_idx] diff --git a/savu/data/transport_data/hdf5_transport_data.py b/savu/data/transport_data/hdf5_transport_data.py index 451b57cbd..c0623c680 100644 --- a/savu/data/transport_data/hdf5_transport_data.py +++ b/savu/data/transport_data/hdf5_transport_data.py @@ -53,7 +53,7 @@ def _get_slice_lists_per_process(self, dtype): return self.__combine_dicts(trans_dict, proc_dict) def __combine_dicts(self, d1, d2): - for key, value in d2.iteritems(): + for key, value in d2.items(): d1[key] = value return d1 diff --git a/savu/data/transport_data/slice_lists.py b/savu/data/transport_data/slice_lists.py index 41cb0f890..1539e8b0e 100644 --- a/savu/data/transport_data/slice_lists.py +++ b/savu/data/transport_data/slice_lists.py @@ -26,10 +26,11 @@ class SliceLists(object): """ - The Hdf5TransportData class performs the organising and movement of data. + SliceLists class creates global and local slices lists used to transfer + the data """ - def __init__(self, name='Hdf5TransportData'): + def __init__(self, name='SliceLists'): super(SliceLists, self).__init__() self.pad = False self.transfer_data = None @@ -65,7 +66,7 @@ def _get_slice_dirs_index(self, slice_dirs, shape, value, calc=None): for i in range(len(slice_dirs)): c = chunk[i] r = repeat[i] - exec('values = ' + value) + values = eval(value) idx = np.ravel(np.kron(values, np.ones((r, c)))) idx_list.append(idx.astype(int)) return np.array(idx_list) @@ -113,11 +114,11 @@ def _get_core_slices(self, core_dirs): for c in core_dirs: if (chunks[c]) > 1: if (stops[c] - starts[c] == 1): - start = starts[c] - int(chunks[c]/2) + start = starts[c] - int(chunks[c] / 2.0) if start < 0: raise Exception('Cannot have a negative value in the ' 'slice list.') - stop = starts[c] + (chunks[c] - int(chunks[c]/2)) + stop = starts[c] + (chunks[c] - int(chunks[c] / 2.0)) core_slice.append(slice(start, stop, 1)) else: raise Exception("The core dimension does not support " @@ -139,6 +140,7 @@ def _banked_list(self, slice_list, max_frames, pad=False): b = self._split_list(s, max_frames) if pad: diff = max_frames - len(b[-1]) + #print("diff", diff, max_frames, len(b[-1])) b[-1][-1] = self._fix_list_length(b[-1][-1], diff, split_dim) if diff \ else b[-1][-1] banked.extend(b) @@ -161,12 +163,12 @@ def _group_dimension(self, sl, dim, step): return tuple(working_slice) def _split_list(self, the_list, size): - return [the_list[x:x+size] for x in xrange(0, len(the_list), size)] + return [the_list[x:x+size] for x in range(0, len(the_list), size)] # This method only works if the split dimensions in the slice list contain # slice objects def __split_frames(self, slice_list, split_list): - split = [map(int, a.split('.')) for a in split_list] + split = [list(map(int, a.split('.'))) for a in split_list] dims = [s[0] for s in split] length = [s[1] for s in split] replace = self.__get_split_frame_entries(slice_list, dims, length) @@ -174,7 +176,7 @@ def __split_frames(self, slice_list, split_list): array_list = [] for sl in slice_list: new_list = np.array([sl for i in range(len(replace[0]))]) - for d, i in zip(dims, range(len(dims))): + for d, i in zip(dims, list(range(len(dims)))): new_list[:, d] = replace[i] array_list += [tuple(a) for a in new_list] @@ -220,7 +222,7 @@ def _get_frames_per_process(self, slice_list): slice_list = [] return slice_list, frames - def _pad_slice_list(self, slice_list, inc_start_str, inc_stop_str): + def _pad_slice_list(self, slice_list, inc_start_str: str, inc_stop_str: str): """ Amend the slice lists to include padding. Includes variations for transfer and process slice lists. """ pData = self.data._get_plugin_data() @@ -230,9 +232,9 @@ def _pad_slice_list(self, slice_list, inc_start_str, inc_stop_str): pad_dict = pData.padding._get_padding_directions() shape = self.data.get_shape() - for ddir, value in pad_dict.iteritems(): - exec('inc_start = ' + inc_start_str) - exec('inc_stop = ' + inc_stop_str) + for ddir, value in pad_dict.items(): + inc_start = eval(inc_start_str) + inc_stop = eval(inc_stop_str) for i in range(len(slice_list)): slice_list[i] = list(slice_list[i]) sl = slice_list[i][ddir] @@ -360,7 +362,7 @@ def _get_slice_list(self): process_ssl = self.td._get_local_single_slice_list(shape) process_gsl = self.td._group_slice_list_in_one_dimension( - process_ssl, mf_process, self.sdir) + process_ssl, mf_process, self.sdir, pad=True) # pad if mfp is > nSlices (e.g. mfp = fixed int) return process_gsl def __get_unpad_slice_list(self, reps): @@ -369,7 +371,7 @@ def __get_unpad_slice_list(self, reps): if not self.pData.padding: return tuple([tuple(sl)]*reps) pad_dict = self.pData.padding._get_padding_directions() - for ddir, value in pad_dict.iteritems(): + for ddir, value in pad_dict.items(): sl[ddir] = slice(value['before'], -value['after']) return tuple([tuple(sl)]*reps) @@ -422,7 +424,7 @@ def _get_slice_list(self, shape, current_sl=None, pad=False): slice_dims = self.data.get_slice_dimensions() transfer_gsl = self.trans._group_slice_list_in_multiple_dimensions( transfer_ssl, mft, slice_dims, pad=pad) - + if current_sl: mfp = self.pData._get_max_frames_process() current_sl = self.trans._group_slice_list_in_multiple_dimensions( @@ -444,7 +446,7 @@ def _get_padded_data(self, slice_list, end=False): pad_list.append([0, 0]) data_dict = self.data.data_info.get_dictionary() - shape = data_dict['orig_shape'] if 'orig_shape' in data_dict.keys() \ + shape = data_dict['orig_shape'] if 'orig_shape' in list(data_dict.keys()) \ else self.data.get_shape() for dim in range(len(pad_dims)): diff --git a/savu/plugins/absorption_corrections/mc_near_absorption_correction.py b/savu/plugins/absorption_corrections/mc_near_absorption_correction.py index 10da67288..285f4953e 100644 --- a/savu/plugins/absorption_corrections/mc_near_absorption_correction.py +++ b/savu/plugins/absorption_corrections/mc_near_absorption_correction.py @@ -58,25 +58,19 @@ def pre_process(self): peak_energy = list(mData.get('energy')) except KeyError: logging.debug("No PeakEnergy or energy axis. This won't work") - raise + raise pump_mu = self.get_mu(compound, float(mono_energy), density) peak_mu = self.get_mu(compound, list(peak_energy), density) - #print "THE PUMP MU IS is:"+str(pump_mu)+str(mono_energy) - #print "THE PEAK MU IS is:"+str(peak_mu)+str(peak_energy) - self.atten_ratio = [pm/pump_mu for pm in peak_mu] - - # commenting this out as it is spamming the log files -# logging.debug('The test attenuation ratios should be:[25.651, 20.909, 2.903, 2.198],' -# 'they are: %s' % self.atten_ratio) + self.atten_ratio: float = [pm / pump_mu for pm in peak_mu] + theta = mData.get('rotation_angle') self.dtheta = theta[1]-theta[0] logging.debug('The rotation step is %s' % str(self.dtheta)) if np.abs(self.dtheta)>10.0: - logging.warn('The theta step is greater than 10 degrees! Watch out!') + logging.warning('The theta step is greater than 10 degrees! Watch out!') self.npix_displacement = self.parameters['azimuthal_offset']//self.dtheta logging.debug('This gives a pixel offset of %s' % str(self.npix_displacement)) - def process_frames(self, data): xrf = data[0] @@ -104,7 +98,7 @@ def correct_sino(self,Ti_ratio, FFI0_Ti, absorption): trans_ave_array[n] = row for m in range(1, len(row), 1): #row, axis=1 trans_ave_array[n][m] = np.average(row[0:m]) #average of all absorption between pixel 0 and pixel - removes t so should be mu only - + trans_ave_array = np.nan_to_num(trans_ave_array) exponent_Ti = self.get_exponent_Ti_mu(Ti_ratio, absorption, trans_ave_array) FFI0_corrected_Ti = np.multiply(FFI0_Ti, exponent_Ti) diff --git a/savu/plugins/alignment/projection_shift.py b/savu/plugins/alignment/projection_shift.py index 5fb3cd6e6..2b4055fb1 100644 --- a/savu/plugins/alignment/projection_shift.py +++ b/savu/plugins/alignment/projection_shift.py @@ -173,10 +173,10 @@ def _sub_pixel_shift_adjustment(self, data): return self._calculate_new_shift_array(np.array(new_shift)) def _calculate_frame_list(self, frames): - sixes = zip(*(frames[i:] for i in xrange(6))) - fives = zip(*(frames[i:] for i in xrange(5))) - fours = zip(*(frames[i:] for i in xrange(4))) - threes = zip(*(frames[i:] for i in xrange(3))) + sixes = list(zip(*(frames[i:] for i in range(6)))) + fives = list(zip(*(frames[i:] for i in range(5)))) + fours = list(zip(*(frames[i:] for i in range(4)))) + threes = list(zip(*(frames[i:] for i in range(3)))) return sixes + fives + fours + threes def _calculate_new_shift_array(self, shift): diff --git a/savu/plugins/alignment/sinogram_alignment.py b/savu/plugins/alignment/sinogram_alignment.py index fb063e657..9b42aac1b 100644 --- a/savu/plugins/alignment/sinogram_alignment.py +++ b/savu/plugins/alignment/sinogram_alignment.py @@ -98,14 +98,13 @@ def process_frames(self, data): result = np.empty_like(data[0]) for i in range(nFrames): self.sl[self.slice_dir] = i - sino = data[0][self.sl] + sino = data[0][tuple(self.sl)] if self.parameters['threshold']: a, b = self.parameters['threshold'].split('.') sino[sino > a] = b com_y = self.com_y if self.com_y is not None else self._com_y(sino) shifted = self._shift(sino, self.com_x, com_y) - result[self.sl] = \ - shifted.reshape(shifted.shape[0], shifted.shape[1]) + result[tuple(self.sl)] = shifted.reshape(shifted.shape[0], shifted.shape[1]) return result def _sinfunc(self, data, a, b, c): diff --git a/savu/plugins/alignment/sinogram_clean.py b/savu/plugins/alignment/sinogram_clean.py index 18c162c60..01ebe50f3 100644 --- a/savu/plugins/alignment/sinogram_clean.py +++ b/savu/plugins/alignment/sinogram_clean.py @@ -45,21 +45,18 @@ def __init__(self): super(SinogramClean, self).__init__("SinogramClean") def _create_mask(self, Nrow, Ncol, obj_radius): - du = 1.0/Ncol + du = 1.0 / Ncol dv = (Nrow-1.0)/(Nrow*2.0*math.pi) - cen_row = np.ceil(Nrow/2)-1 - cen_col = np.ceil(Ncol/2)-1 + cen_row = np.ceil(Nrow / 2.0)-1 + cen_col = np.ceil(Ncol / 2.0)-1 drop = self.parameters['row_drop'] mask = np.zeros((Nrow, Ncol), dtype=np.float32) for i in range(Nrow): - num1 = \ - np.round(((i-cen_row)*dv/obj_radius)/du) - (p1, p2) = \ - np.clip(np.sort((-num1+cen_col, num1+cen_col)), 0, Ncol-1) + num1 = np.round(((i-cen_row)*dv/obj_radius)/du) + (p1, p2) = np.clip(np.sort((-num1+cen_col, num1+cen_col)), 0, Ncol-1) mask[i, p1:p2+1] = np.ones(p2-p1+1, dtype=np.float32) if drop < cen_row: - mask[cen_row-drop:cen_row+drop+1, :] = \ - np.zeros((2*drop + 1, Ncol), dtype=np.float32) + mask[cen_row-drop:cen_row+drop+1, :] = np.zeros((2*drop + 1, Ncol), dtype=np.float32) return mask def process_frames(self, data): diff --git a/savu/plugins/analysis/stxm_analysis.py b/savu/plugins/analysis/stxm_analysis.py index fbf6a589f..8b4da2572 100644 --- a/savu/plugins/analysis/stxm_analysis.py +++ b/savu/plugins/analysis/stxm_analysis.py @@ -91,7 +91,7 @@ def setup(self): axis_labels={in_dataset[0]: axis_labels}, shape=new_shape) - channel = {'core_dims': (-1,), 'slice_dims': range(len(new_shape)-1)} + channel = {'core_dims': (-1,), 'slice_dims': list(range(len(new_shape)-1))} bf.add_pattern("CHANNEL", **channel) df.add_pattern("CHANNEL", **channel) diff --git a/savu/plugins/azimuthal_integrators/pyfai_azimuthal_integrator_with_bragg_filter.py b/savu/plugins/azimuthal_integrators/pyfai_azimuthal_integrator_with_bragg_filter.py index 202366618..605a9e5be 100644 --- a/savu/plugins/azimuthal_integrators/pyfai_azimuthal_integrator_with_bragg_filter.py +++ b/savu/plugins/azimuthal_integrators/pyfai_azimuthal_integrator_with_bragg_filter.py @@ -63,7 +63,7 @@ def process_frames(self, data): # print i idx = mask[:,i] == 1 if np.sum(idx*1)==0: - logging.warn("Found a bin where all the pixels are masked! Bin num: %s" , str(i)) + logging.warning("Found a bin where all the pixels are masked! Bin num: %s" , str(i)) out[i] = 0.0 else: foo = remapped[:,i][idx] diff --git a/savu/plugins/basic_operations/basic_operations.py b/savu/plugins/basic_operations/basic_operations.py index a7107437d..dac8a3298 100644 --- a/savu/plugins/basic_operations/basic_operations.py +++ b/savu/plugins/basic_operations/basic_operations.py @@ -44,9 +44,16 @@ def pre_process(self): self.out_data = self._set_out_data_names() def process_frames(self, data): + # creates an 'environment' that will store the variables created inside the exec statement + exec_environment = {'data': data} + for i in range(len(self.operations)): - exec(self.out_data[i] + "=" + self.operations[i]) - return [eval(out) for out in self.out_data] + # runs the exec with no builtins, and only 'data' available as a variable initially + exec(f"{self.out_data[i]} = {self.operations[i]}", {"builtins": None}, exec_environment) + + # Find the result from each exec. Does list comprehension on the results instead of just + # exec_environment.items to keep the order the same as in out_data + return [exec_environment[out] for out in self.out_data] def setup(self): """ @@ -93,7 +100,7 @@ def _amend_ops(self, mappings_dict): operations = self.parameters['operations'] new_ops = [] for op in operations: - for key, value in mappings_dict.iteritems(): + for key, value in mappings_dict.items(): op = op.replace(key, value) new_ops.append(op) return new_ops diff --git a/savu/plugins/basic_operations/no_process_plugin.py b/savu/plugins/basic_operations/no_process_plugin.py index 95d12ed6d..491354a55 100644 --- a/savu/plugins/basic_operations/no_process_plugin.py +++ b/savu/plugins/basic_operations/no_process_plugin.py @@ -51,7 +51,7 @@ def setup(self): if self.parameters['pattern']: pattern = self.parameters['pattern'] else: - pattern = in_dataset[0].get_data_patterns().keys()[0] + pattern = list(in_dataset[0].get_data_patterns().keys())[0] in_pData[0].plugin_data_setup(pattern, self.get_max_frames()) out_pData[0].plugin_data_setup(pattern, self.get_max_frames()) diff --git a/savu/plugins/centering/vo_centering.py b/savu/plugins/centering/vo_centering.py index 1b13cacee..61ee3e1e9 100644 --- a/savu/plugins/centering/vo_centering.py +++ b/savu/plugins/centering/vo_centering.py @@ -15,7 +15,7 @@ .. module:: vo_centering :platform: Unix :synopsis: A plugin to find the center of rotation per frame -.. moduleauthor:: Mark Basham, Nghia Vo, Nicola Wadeson \ +.. moduleauthor:: Mark Basham, Nghia Vo, Nicola Wadeson \ """ from savu.plugins.driver.cpu_plugin import CpuPlugin @@ -112,12 +112,12 @@ def _coarse_search(self, sino, start_cor, stop_cor, ratio, drop): if minpos==0: self.error_msg_1 = "!!! WARNING !!! Global minimum is out of "\ "the searching range. Please extend smin" - logging.warn(self.error_msg_1) + logging.warning(self.error_msg_1) cu.user_message(self.error_msg_1) if minpos==len(list_metric)-1: self.error_msg_2 = "!!! WARNING !!! Global minimum is out of "\ "the searching range. Please extend smax" - logging.warn(self.error_msg_2) + logging.warning(self.error_msg_2) cu.user_message(self.error_msg_2) rot_centre = list_cor[minpos] return rot_centre @@ -167,11 +167,11 @@ def _downsample(self, image, dsp_fact0, dsp_fact1): Return: - Downsampled image. """ (height, width) = image.shape - dsp_fact0 = np.clip(np.int16(dsp_fact0), 1, height//2) - dsp_fact1 = np.clip(np.int16(dsp_fact1), 1, width//2) + dsp_fact0 = np.clip(np.int16(dsp_fact0), 1, height // 2) + dsp_fact1 = np.clip(np.int16(dsp_fact1), 1, width // 2) height_dsp = height//dsp_fact0 width_dsp = width//dsp_fact1 - if (dsp_fact0 == 1) and (dsp_fact1 ==1): + if dsp_fact0 == 1 and dsp_fact1 == 1: image_dsp = image else: image_dsp = image[0:dsp_fact0*height_dsp,0:dsp_fact1*width_dsp] @@ -181,7 +181,7 @@ def _downsample(self, image, dsp_fact0, dsp_fact1): def set_filter_padding(self, in_data, out_data): padding = np.int16(self.parameters['average_radius']) - if padding>0: + if padding>0: in_data[0].padding = {'pad_multi_frames': padding} def pre_process(self): @@ -194,14 +194,14 @@ def pre_process(self): self.broadcast_method = str(self.parameters['broadcast_method']) self.error_msg_1 = "" self.error_msg_2 = "" - self.error_msg_3 = "" + self.error_msg_3 = "" if not((self.broadcast_method == 'mean') or (self.broadcast_method == 'median') or (self.broadcast_method == 'linear_fit') or (self.broadcast_method == 'nearest')): self.error_msg_3 = "!!! WARNING !!! Selected broadcasting "\ "method is out of the list. Use the default option: 'median'" - logging.warn(self.error_msg_3) + logging.warning(self.error_msg_3) cu.user_message(self.error_msg_3) self.broadcast_method = 'median' in_pData = self.get_plugin_in_datasets()[0] @@ -236,9 +236,9 @@ def process_frames(self, data): sino_fsearch = ndi.gaussian_filter(sino, (2,2), mode='reflect') sino_dsp = self._downsample(sino_csearch, dsp_row, dsp_col) fine_srange = max(self.search_radius, dsp_col) - off_set = 0.5*dsp_col if dsp_col>1 else 0.0 + off_set = 0.5*dsp_col if dsp_col > 1 else 0.0 if self.est_cor is None: - self.est_cor = (ncol-1.0)/2.0 + self.est_cor = (ncol-1.0) / 2.0 else: self.est_cor = np.float32(self.est_cor) start_cor = np.int16( @@ -341,35 +341,35 @@ def fix_transport(self): def get_citation_information(self): cite_info = CitationInformation() cite_info.description = \ - ("The center of rotation for this reconstruction was calculated " + + ("The center of rotation for this reconstruction was calculated " + "automatically using the method described in this work") cite_info.bibtex = \ - ("@article{vo2014reliable,\n" + - "title={Reliable method for calculating the center of rotation " + - "in parallel-beam tomography},\n" + - "author={Vo, Nghia T and Drakopoulos, Michael and Atwood, " + - "Robert C and Reinhard, Christina},\n" + - "journal={Optics Express},\n" + - "volume={22},\n" + - "number={16},\n" + - "pages={19078--19086},\n" + - "year={2014},\n" + - "publisher={Optical Society of America}\n" + + ("@article{vo2014reliable,\n" + + "title={Reliable method for calculating the center of rotation " + + "in parallel-beam tomography},\n" + + "author={Vo, Nghia T and Drakopoulos, Michael and Atwood, " + + "Robert C and Reinhard, Christina},\n" + + "journal={Optics Express},\n" + + "volume={22},\n" + + "number={16},\n" + + "pages={19078--19086},\n" + + "year={2014},\n" + + "publisher={Optical Society of America}\n" + "}") cite_info.endnote = \ - ("%0 Journal Article\n" + - "%T Reliable method for calculating the center of rotation in " + - "parallel-beam tomography\n" + - "%A Vo, Nghia T\n" + - "%A Drakopoulos, Michael\n" + - "%A Atwood, Robert C\n" + - "%A Reinhard, Christina\n" + - "%J Optics Express\n" + - "%V 22\n" + - "%N 16\n" + - "%P 19078-19086\n" + - "%@ 1094-4087\n" + - "%D 2014\n" + + ("%0 Journal Article\n" + + "%T Reliable method for calculating the center of rotation in " + + "parallel-beam tomography\n" + + "%A Vo, Nghia T\n" + + "%A Drakopoulos, Michael\n" + + "%A Atwood, Robert C\n" + + "%A Reinhard, Christina\n" + + "%J Optics Express\n" + + "%V 22\n" + + "%N 16\n" + + "%P 19078-19086\n" + + "%@ 1094-4087\n" + + "%D 2014\n" + "%I Optical Society of America") cite_info.doi = "https://doi.org/10.1364/OE.22.019078" return cite_info @@ -378,7 +378,7 @@ def executive_summary(self): if ((self.error_msg_1 == "") and (self.error_msg_2 == "")): msg = "Centre of rotation is : %s" % (str(self.cor_for_executive_summary)) - else: + else: msg = "\n" + self.error_msg_1 + "\n" + self.error_msg_2 msg2 = "(Not well) estimated centre of rotation is : %s" % (str( self.cor_for_executive_summary)) diff --git a/savu/plugins/centering/vo_centering_iterative.py b/savu/plugins/centering/vo_centering_iterative.py index b6b7e8d8a..147675e2b 100644 --- a/savu/plugins/centering/vo_centering_iterative.py +++ b/savu/plugins/centering/vo_centering_iterative.py @@ -77,7 +77,7 @@ def __init__(self): def _create_mask(self, Nrow, Ncol, obj_radius): du, dv = 1.0/Ncol, (Nrow-1.0)/(Nrow*2.0*math.pi) - cen_row, cen_col = int(np.ceil(Nrow/2)-1), int(np.ceil(Ncol/2)-1) + cen_row, cen_col = int(np.ceil(Nrow / 2.0)-1), int(np.ceil(Ncol / 2.0)-1) drop = self.parameters['row_drop'] mask = np.zeros((Nrow, Ncol), dtype=np.float32) for i in range(Nrow): @@ -98,7 +98,7 @@ def _get_start_shift(self, centre): else: in_mData = self.get_in_meta_data()[0] shift = centre - in_mData['centre'] if 'centre' in \ - in_mData.get_dictionary().keys() else 0 + list(in_mData.get_dictionary().keys()) else 0 return int(shift) def _coarse_search(self, sino, list_shift): @@ -128,7 +128,7 @@ def _coarse_search(self, sino, list_shift): def _fine_search(self, sino, raw_cor): (Nrow, Ncol) = sino.shape - centerfliplr = (Ncol + 1.0)/2.0-1.0 + centerfliplr = (Ncol + 1.0) / 2.0 - 1.0 # Use to shift the sino2 to the raw CoR shiftsino = np.int16(2*(raw_cor-centerfliplr)) sino2 = np.roll(np.fliplr(sino[1:]), shiftsino, axis=1) @@ -160,7 +160,7 @@ def _fine_search(self, sino, raw_cor): fft.fft2(sinojoin[:, lefttake:righttake + 1])))*mask) num1 = num1 + 1 minpos = np.argmin(listmetric) - rotcenter = raw_cor + listshift[minpos]/2.0 + rotcenter = raw_cor + listshift[minpos] / 2.0 return rotcenter def _get_listshift(self): @@ -204,7 +204,7 @@ def pre_process(self): self.downlevel = 4 if Ncol > 1800 else 1 self.downsample = slice(0, Ncol, self.downlevel) Ncol_downsample = len(np.arange(0, Ncol, self.downlevel)) - self.centre_fliplr = (Ncol_downsample - 1.0)/2.0 + self.centre_fliplr = (Ncol_downsample - 1.0) / 2.0 self.start_shift = self._get_start_shift(self.centre_fliplr)*2 self.boundary = int(np.ceil(Ncol/4.0)) @@ -244,7 +244,7 @@ def _analyse_result(self, metric, shift): minpos = np.argmin(metric) dist = min(abs(len(shift) - minpos), -minpos) - rot_centre = (self.centre_fliplr + shift[minpos]/2.0)*self.downlevel + rot_centre = (self.centre_fliplr + shift[minpos] / 2.0)*self.downlevel peaks = self._find_peaks(metric) good_nPeaks = True @@ -398,7 +398,7 @@ def setup(self): self._create_metadata_dataset(out_dataset[0], new_shape) self._create_metadata_dataset(out_dataset[1], self.orig_shape) self._create_metadata_dataset(out_dataset[2], new_shape) - + # output metric new_shape = (np.prod(np.array(fullData.get_shape())[slice_dirs]), 21) self._create_metadata_dataset(out_dataset[3], new_shape) diff --git a/savu/plugins/corrections/base_correction.py b/savu/plugins/corrections/base_correction.py index 84885d219..0415cc126 100644 --- a/savu/plugins/corrections/base_correction.py +++ b/savu/plugins/corrections/base_correction.py @@ -47,7 +47,7 @@ def setup(self): # set information relating to the plugin data in_pData, out_pData = self.get_plugin_datasets() # set pattern_name and nframes to process for all datasets - if 'pattern' in self.parameters.keys(): + if 'pattern' in list(self.parameters.keys()): pattern = self.parameters['pattern'] else: pattern = 'PROJECTION' diff --git a/savu/plugins/corrections/camera_rot_correction.py b/savu/plugins/corrections/camera_rot_correction.py index e4daf3f8d..58b527616 100644 --- a/savu/plugins/corrections/camera_rot_correction.py +++ b/savu/plugins/corrections/camera_rot_correction.py @@ -33,7 +33,7 @@ class CameraRotCorrection(BaseFilter, CpuPlugin): """ A plugin to apply a rotation to projection images, for example to correct\ for missing camera alignment. - + :u*param angle: The rotation angle for the output image in degrees. \ Default: 0.0. :u*param crop_edges: When a rotation is applied to any image,\ @@ -45,7 +45,7 @@ class CameraRotCorrection(BaseFilter, CpuPlugin): :param use_auto_centre: This parameter automatically sets the centre \ of rotation to the centre of the image. If set to False, the values \ from centre_x and centre_y are used. Note: The centre needs to be within \ - the image dimensions. Default: True + the image dimensions. Default: True :param centre_x: If not use_auto_centre, this value determines the \ detector x coordinate for the centre of rotation. The Default: 1279.5 :param centre_y: If not use_auto_centre, this value determines the \ @@ -57,10 +57,9 @@ def __init__(self): def pre_process(self): pass - + def process_frames(self, data): - return rotate(data[0].astype(np.float64), self.parameters['angle'], center=\ - self.centre)[self.new_slice] + return rotate(data[0].astype(np.float64), self.parameters['angle'], center=self.centre)[tuple(self.new_slice)] def post_process(self): pass @@ -74,7 +73,7 @@ def setup(self): self.shape = list(in_dataset[0].get_shape()) self.core_dims = in_pData[0].get_core_dimensions() - + self.use_auto_centre = self.parameters['use_auto_centre'] self.angle = self.parameters['angle'] self.static_crop = self.parameters['crop_edges'] @@ -88,30 +87,25 @@ def setup(self): img_dims = self.get_in_datasets()[0].get_shape() if self.use_auto_centre: - self.centre = (img_dims[det_y] / 2 - 0.5 \ - * np.mod(img_dims[det_y], 2), img_dims[det_x] / 2 \ - - 0.5 * np.mod(img_dims[det_x], 2)) + self.centre = (img_dims[det_y] // 2 - 0.5 * np.mod(img_dims[det_y], 2), + img_dims[det_x] // 2 - 0.5 * np.mod(img_dims[det_x], 2)) else: - self.centre = (self.parameters['centre_y'], \ - self.parameters['centre_x']) - + self.centre = (self.parameters['centre_y'], self.parameters['centre_x']) + # If the data is cropped then the centre of rotation must be shifted # accordingly, e.g if preview is [:, a:b, c:d] then shift is (a, c) shift = self.exp.meta_data.get(in_dataset[0].get_name() + '_preview_starts') - self.centre = (self.centre[0] - shift[det_y], \ - self.centre[1] - shift[det_x]) - - + self.centre = (self.centre[0] - shift[det_y], self.centre[1] - shift[det_x]) + self.new_slice = [slice(None)] * 2 img_dims = self.get_in_datasets()[0].get_shape() - + if self.static_crop > 0 and not self.auto_crop: - self.new_slice= \ - [slice(self.static_crop, img_dims[det_y] - self.static_crop),\ - slice(self.static_crop, img_dims[det_x] - self.static_crop)] + self.new_slice = [slice(self.static_crop, img_dims[det_y] - self.static_crop), + slice(self.static_crop, img_dims[det_x] - self.static_crop)] for ddim in [det_x, det_y]: self.shape[ddim] = self.shape[ddim] - 2 * self.static_crop - + elif self.auto_crop: xs = np.array([0, 0, img_dims[det_x], img_dims[det_x]]).astype(np.float32) ys = np.array([0, img_dims[det_x], img_dims[det_x], 0]).astype(np.float32) @@ -124,7 +118,7 @@ def setup(self): x1 = np.floor(min(x_p[2], x_p[3], img_dims[det_x])).astype(int) y0 = np.ceil(max(y_p[0], y_p[1], 0)).astype(int) y1 = np.floor(min(y_p[2], y_p[3], img_dims[det_y])).astype(int) - self.new_slice = [slice(y0, y1),slice(x0, x1)] + self.new_slice = [slice(y0, y1), slice(x0, x1)] self.shape[det_x] = x1 - x0 self.shape[det_y] = y1 - y0 diff --git a/savu/plugins/corrections/convert_360_180_sinogram.py b/savu/plugins/corrections/convert_360_180_sinogram.py index 3c2787065..54fb0356f 100644 --- a/savu/plugins/corrections/convert_360_180_sinogram.py +++ b/savu/plugins/corrections/convert_360_180_sinogram.py @@ -49,7 +49,7 @@ def setup(self): self.center = 0.0 key = "centre_of_rotation" - if key in in_dataset[0].meta_data.get_dictionary().keys(): + if key in list(in_dataset[0].meta_data.get_dictionary().keys()): self.center = in_dataset[0].meta_data.get(key) old_shape = in_dataset[0].get_shape() diff --git a/savu/plugins/corrections/distortion_correction.py b/savu/plugins/corrections/distortion_correction.py index 4611c16ed..304050818 100755 --- a/savu/plugins/corrections/distortion_correction.py +++ b/savu/plugins/corrections/distortion_correction.py @@ -110,9 +110,9 @@ def pre_process(self): "!!! ERROR !!! -> Plugin doesn't work with the step in the "\ "preview larger than 1 \n"\ "***********************************************\n" - logging.warn(self.msg) + logging.warning(self.msg) cu.user_message(self.msg) - raise ValueError(self.msg) + raise ValueError(self.msg) x_offset = shift[x_dim] y_offset = shift[y_dim] @@ -136,15 +136,15 @@ def pre_process(self): (x_center, y_center, list_fact) = self.load_metadata_txt( file_path) x_center = x_center - x_offset - y_center = y_center - y_offset + y_center = y_center - y_offset except IOError: self.msg = "\n*****************************************\n"\ "!!! ERROR !!! -> Can't open this file: %s \n"\ "*****************************************\n\ - " % str(file_path) - logging.warn(self.msg) + " % str(file_path) + logging.warning(self.msg) cu.user_message(self.msg) - raise ValueError(self.msg) + raise ValueError(self.msg) data_shape = data.get_shape() self.height, self.width = data_shape[y_dim], data_shape[x_dim] @@ -166,14 +166,14 @@ def pre_process(self): "!!! ERROR !!! -> You need to increase the preview size"\ " for this plugin to work \n\n"\ "*****************************************\n" - logging.warn(self.msg) + logging.warning(self.msg) cu.user_message(self.msg) - raise ValueError(self.msg) + raise ValueError(self.msg) self.indices = np.reshape(yd_mat, (-1, 1)),\ np.reshape(xd_mat, (-1, 1)) - def process_frames(self, data): + def process_frames(self, data): mat_corrected = np.reshape(map_coordinates( data[0], self.indices, order=1, mode='reflect'), (self.height, self.width)) diff --git a/savu/plugins/corrections/distortion_correction_deprecated.py b/savu/plugins/corrections/distortion_correction_deprecated.py deleted file mode 100644 index 48c011993..000000000 --- a/savu/plugins/corrections/distortion_correction_deprecated.py +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: distortion_correction_deprecated - :platform: Unix - :synopsis: A plugin to apply a distortion correction - -.. moduleauthor:: Nicola Wadeson - -""" - -import numpy as np - -from savu.plugins.filters.base_filter import BaseFilter -from savu.plugins.driver.cpu_plugin import CpuPlugin -from savu.plugins.utils import register_plugin -from savu.data.plugin_list import CitationInformation -import unwarp - - -@register_plugin -class DistortionCorrectionDeprecated(BaseFilter, CpuPlugin): - """ - A plugin to apply radial distortion correction. - - :param polynomial_coeffs: Parameters of the radial distortion \ - function. Default: (1.00015076, 1.9289e-6, -2.4325e-8, 1.00439e-11, -3.99352e-15). - :param centre_from_top: The centre of distortion in pixels from the top \ - of the image. Default: 995.24. - :param centre_from_left: The centre of distortion in pixels from the left \ - of the image. Default: 1283.25. - :u*param crop_edges: When applied to previewed/cropped data, the result \ - may contain zeros around the edges, which can be removed by \ - cropping the edges by a specified number of pixels. Default: 0 - """ - - def __init__(self): - super(DistortionCorrectionDeprecated, self).__init__("DistortionCorrectionDeprecated") - - def pre_process(self): - in_pData = self.get_plugin_in_datasets()[0] - data = self.get_in_datasets()[0] - - name = data.get_name() - shift = self.exp.meta_data.get(name + '_preview_starts') - step = self.exp.meta_data.get(name + '_preview_steps') - - det_y = data.get_data_dimension_by_axis_label('detector_y') - det_x = data.get_data_dimension_by_axis_label('detector_x') - - # check stepping as should not be > 1 - self.step_check = \ - True if max([step[i] for i in [det_y, det_x]]) > 1 else False - - # If the data is cropped then the centre of distortion must be shifted - # accordingly, e.g if preview is [:, a:b, c:d] then shift is (a, c) - - centre = np.array([self.parameters['centre_from_left'], - self.parameters['centre_from_top']]) - - centre[0] -= shift[det_x] - centre[1] -= shift[det_y] - - # pass two empty arrays of frame chunk size - unwarp.setcoeff(*self.parameters['polynomial_coeffs']) - unwarp.setctr(*centre) - plugin_data_shape = in_pData.get_shape() - temp_array = np.empty(plugin_data_shape, dtype=np.float32) - unwarp.setup(temp_array, temp_array) - - self.new_slice = [slice(None)] * 3 - orig_shape = self.get_in_datasets()[0].get_shape() - for ddir in self.core_dims: - self.new_slice[ddir] = \ - slice(self.crop, orig_shape[ddir] - self.crop) - - def process_frames(self, data): - result = np.empty_like(data[0]) - unwarp.run(data[0], result) - return result[self.new_slice] - - def post_process(self): - unwarp.cleanup() - - def setup(self): - # set up the output dataset that is created by the plugin - in_dataset, out_dataset = self.get_datasets() - # set information relating to the plugin data - in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('PROJECTION', self.get_max_frames()) - - # copy all required information from in_dataset[0] - self.shape = list(in_dataset[0].get_shape()) - self.core_dims = in_pData[0].meta_data.get('core_dims') - self.crop = self.parameters['crop_edges'] - - for ddir in self.core_dims: - self.shape[ddir] = self.shape[ddir] - 2 * self.crop - out_dataset[0].create_dataset(patterns=in_dataset[0], - axis_labels=in_dataset[0], - shape=tuple(self.shape)) - out_pData[0].plugin_data_setup('PROJECTION', self.get_max_frames()) - - def get_max_frames(self): - return 'multiple' - - def executive_summary(self): - if self.step_check: - msg = "\n\tWARNING: Incompatibility with loader 'preview' "\ - "parameters. \n\tThis plugin will currently produce "\ - "incorrect results if a \n\tdetector dimension has step "\ - "length greater than 1.\n\tPlease remove the stepping or "\ - "remove the plugin." - return [msg] - else: - return ["Nothing to Report"] - - def get_citation_information(self): - cite_info = CitationInformation() - cite_info.description = \ - ("The distortion correction used in this processing chain is taken\ - from this work.") - cite_info.bibtex = \ - ("@article{Vo:15,\n" + - "title={Radial lens distortion correction with sub-pixel accuracy \ - for X-ray micro-tomography},\n" + - "author={Nghia T. Vo and Robert C. Atwood and \ - Michael Drakopoulos},\n" + - "journal={Optics. Express},\n" + - "volume={23},\n" + - "number={25},\n" + - "pages={32859--32868},\n" + - "year={2015},\n" + - "publisher={OSA Publishing}" + - "}") - cite_info.doi = "doi: DOI: 10.1364/OE.23.032859" - return cite_info diff --git a/savu/plugins/corrections/mtf_deconvolution.py b/savu/plugins/corrections/mtf_deconvolution.py index ee4cdb0d4..1baceb43e 100644 --- a/savu/plugins/corrections/mtf_deconvolution.py +++ b/savu/plugins/corrections/mtf_deconvolution.py @@ -65,14 +65,14 @@ def check_file_path(self, file_path): file_ext = ".tif" if file_path is None: msg = "!!! Please provide a file path to the MTF !!!" - logging.warn(msg) + logging.warning(msg) cu.user_message(msg) raise ValueError(msg) else: if not os.path.isfile(file_path): msg = "!!! No such file: %s !!!"\ " Please check the file path" %str(file_path) - logging.warn(msg) + logging.warning(msg) cu.user_message(msg) raise ValueError(msg) else: @@ -109,7 +109,7 @@ def pre_process(self): "!!! ERROR !!! -> Can't open this file: %s \n"\ "*****************************************\n\ " % str(file_path) - logging.warn(msg) + logging.warning(msg) cu.user_message(msg) raise ValueError(msg) else: @@ -120,7 +120,7 @@ def pre_process(self): "!!! ERROR !!! -> Can't open this file: %s \n"\ "*****************************************\n\ " % str(file_path) - logging.warn(msg) + logging.warning(msg) cu.user_message(msg) raise ValueError(msg) @@ -132,7 +132,7 @@ def pre_process(self): "!!! ERROR !!!-> Projection shape: ({0},{1}) is not the same as "\ "the mtf shape: ({2},{3})".format( self.height, self.width, height_mtf, width_mtf) - logging.warn(msg) + logging.warning(msg) cu.user_message(msg) raise ValueError(msg) @@ -169,4 +169,3 @@ def get_citation_information(self): "}") cite_info.doi = "doi: DOI: 10.1117/12.2530324" return cite_info - \ No newline at end of file diff --git a/savu/plugins/corrections/xrd_absorption_approximation.py b/savu/plugins/corrections/xrd_absorption_approximation.py index f240fe32b..19fa37881 100644 --- a/savu/plugins/corrections/xrd_absorption_approximation.py +++ b/savu/plugins/corrections/xrd_absorption_approximation.py @@ -61,7 +61,7 @@ def pre_process(self): theta = mData.get('rotation_angle') self.dtheta = theta[1]-theta[0] if np.abs(self.dtheta) > 10.0: - logging.warn('Theta step is greater than 10 degrees! Watch out!') + logging.warning('Theta step is greater than 10 degrees! Watch out!') self.npix_displacement = \ self.parameters['azimuthal_offset']//self.dtheta logging.debug('This gives a pixel offset of %s' diff --git a/savu/plugins/driver/gpu_plugin.py b/savu/plugins/driver/gpu_plugin.py index 6bd87eb52..6285dfb71 100644 --- a/savu/plugins/driver/gpu_plugin.py +++ b/savu/plugins/driver/gpu_plugin.py @@ -27,7 +27,7 @@ import numpy as np import pynvml as pv from mpi4py import MPI -from itertools import chain, izip +from itertools import chain from savu.plugins.driver.plugin_driver import PluginDriver from savu.plugins.driver.basic_driver import BasicDriver @@ -48,7 +48,7 @@ def _run_plugin(self, exp, transport): processes = copy.copy(expInfo.get("processes")) process = expInfo.get("process") - gpu_processes = [False]*len(processes) + gpu_processes = [False] * len(processes) idx = [i for i in range(len(processes)) if 'GPU' in processes[i]] for i in idx: gpu_processes[i] = True @@ -65,8 +65,8 @@ def _run_plugin(self, exp, transport): idx = [i for i in range(len(ranks)) if new_processes[i] == 'GPU0'] diff = np.diff(np.array(idx)) if len(idx) > 1 else 1 split = np.max(diff) if not isinstance(diff, int) else len(ranks) - split_ranks = [ranks[n:n+split] for n in range(0, len(ranks), split)] - ranks = list(chain.from_iterable(izip(*split_ranks))) + split_ranks = [ranks[n:n + split] for n in range(0, len(ranks), split)] + ranks = list(chain.from_iterable(zip(*split_ranks))) self.__create_new_communicator(ranks, exp, process) @@ -102,4 +102,4 @@ def __calculate_GPU_index(self, nNodes): pv.nvmlInit() nGPUs = int(pv.nvmlDeviceGetCount()) rank = self.new_comm.Get_rank() - return int(rank/nNodes) % nGPUs + return int(rank / nNodes) % nGPUs diff --git a/savu/plugins/driver/iterative_plugin.py b/savu/plugins/driver/iterative_plugin.py index 0bddaf2d8..e347ec75c 100644 --- a/savu/plugins/driver/iterative_plugin.py +++ b/savu/plugins/driver/iterative_plugin.py @@ -46,7 +46,7 @@ def _run_plugin(self, exp, transport): self.__set_original_datasets() while not self._ip_complete: - print "Iteration", self._ip_iteration, "..." + print ("Iteration", self._ip_iteration, "...") self.__set_datasets() # change the pattern in this function? self._run_plugin_instances(transport, self.get_communicator()) if transport.no_processing: @@ -59,12 +59,12 @@ def _run_plugin(self, exp, transport): def __set_datasets(self): params = self.parameters - if self._ip_iteration in self._ip_data_dict.keys(): + if self._ip_iteration in list(self._ip_data_dict.keys()): params['in_datasets'] = self._ip_data_dict[self._ip_iteration][0] params['out_datasets'] = self._ip_data_dict[self._ip_iteration][1] elif self._ip_iteration > 0: p = [params['in_datasets'], params['out_datasets']] - for s1, s2 in self._ip_data_dict['iterating'].iteritems(): + for s1, s2 in self._ip_data_dict['iterating'].items(): a = [0, p[0].index(s1)] if s1 in p[0] else [1, p[1].index(s1)] b = [0, p[0].index(s2)] if s2 in p[0] else [1, p[1].index(s2)] p[a[0]][a[1]], p[b[0]][b[1]] = p[b[0]][b[1]], p[a[0]][a[1]] @@ -79,14 +79,14 @@ def __set_datasets(self): # params = self.parameters # if self._ip_iteration in self._ip_pattern_dict.keys(): # # initial attempt at recalculating every time -# params['in_datasets'] = +# params['in_datasets'] = def get_iteration(self): return self._ip_iteration def __finalise_datasets(self): - for s1, s2 in self._ip_data_dict['iterating'].iteritems(): + for s1, s2 in self._ip_data_dict['iterating'].items(): name = s1.get_name() name = name if 'itr_clone' not in name else s2.get_name() final_dataset = s1 if s1 in self.parameters['out_datasets'] else s2 diff --git a/savu/plugins/driver/multi_threaded_plugin.py b/savu/plugins/driver/multi_threaded_plugin.py index 50d463ae6..6096673c2 100644 --- a/savu/plugins/driver/multi_threaded_plugin.py +++ b/savu/plugins/driver/multi_threaded_plugin.py @@ -41,7 +41,7 @@ def get_mem_multiply(self): def _run_plugin(self, exp, transport): process = exp.meta_data.get("process") - nCores = len(self.processes)/self.nNodes + nCores = len(self.processes) // self.nNodes masters = self._get_masters(self.processes) self.__create_new_communicator(masters, exp) @@ -49,8 +49,7 @@ def _run_plugin(self, exp, transport): if process in masters: self.parameters['available_CPUs'] = nCores - self.parameters['available_GPUs'] = \ - len([p for p in self.processes if 'GPU' in p])/self.nNodes + self.parameters['available_GPUs'] = len([p for p in self.processes if 'GPU' in p]) // self.nNodes self._run_plugin_instances(transport, communicator=self.new_comm) self.__free_communicator() diff --git a/savu/plugins/driver/plugin_driver.py b/savu/plugins/driver/plugin_driver.py index 8d73ec53d..7fb9213e9 100644 --- a/savu/plugins/driver/plugin_driver.py +++ b/savu/plugins/driver/plugin_driver.py @@ -49,7 +49,7 @@ def _run_plugin_instances(self, transport, communicator=MPI.COMM_WORLD): param_idx = self.__calc_param_indices(extra_dims) out_data_dims = [len(d.get_shape()) for d in out_data] - param_dims = [range(d - len(extra_dims), d) for d in out_data_dims] + param_dims = [list(range(d - len(extra_dims), d)) for d in out_data_dims] if extra_dims: init_vars = self.__get_local_dict() @@ -76,7 +76,7 @@ def __get_local_dict(self): class. """ from savu.plugins.plugin import Plugin plugin = Plugin() - copy_keys = vars(self).viewkeys() - vars(plugin).viewkeys() + copy_keys = vars(self).keys() - vars(plugin).keys() copy_dict = {} for key in copy_keys: copy_dict[key] = getattr(self, key) @@ -84,7 +84,7 @@ def __get_local_dict(self): def __reset_local_vars(self, copy_dict): """ Resets the class variables in copy_dict. """ - for key, value in copy_dict.iteritems(): + for key, value in copy_dict.items(): setattr(self, key, value) def __calc_param_indices(self, dims): @@ -92,7 +92,7 @@ def __calc_param_indices(self, dims): for i in range(len(dims)): chunk = int(np.prod(dims[0:i])) repeat = int(np.prod(dims[i+1:])) - idx = np.ravel(np.kron(range(dims[i]), np.ones((repeat, chunk)))) + idx = np.ravel(np.kron(list(range(dims[i])), np.ones((repeat, chunk)))) indices_list.append(idx.astype(int)) return np.transpose(np.array(indices_list)) diff --git a/savu/plugins/filters/denoising/ccpi_denoising_cpu.py b/savu/plugins/filters/denoising/ccpi_denoising_cpu.py index bec6c954b..fe1045de7 100644 --- a/savu/plugins/filters/denoising/ccpi_denoising_cpu.py +++ b/savu/plugins/filters/denoising/ccpi_denoising_cpu.py @@ -28,6 +28,7 @@ from ccpi.filters.regularisers import PatchSelect, NLTV from savu.data.plugin_list import CitationInformation + @register_plugin class CcpiDenoisingCpu(Plugin, CpuPlugin): """ @@ -74,47 +75,47 @@ def setup(self): out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') def pre_process(self): - # Ccpi-RGL toolkit modules - self.device = 'cpu' + # Ccpi-RGL toolkit modules + self.device = 'cpu' if (self.parameters['method'] == 'ROF_TV'): # set parameters for the ROF-TV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'tolerance_constant': self.parameters['tolerance_constant'] } + 'regularisation_parameter': self.parameters['reg_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'FGP_TV'): # set parameters for the FGP-TV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'tolerance_constant': self.parameters['tolerance_constant'],\ - 'methodTV': 0 ,\ - 'nonneg': 0 } + 'regularisation_parameter': self.parameters['reg_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'tolerance_constant': self.parameters['tolerance_constant'], \ + 'methodTV': 0, \ + 'nonneg': 0} if (self.parameters['method'] == 'SB_TV'): # set parameters for the SB-TV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'tolerance_constant': self.parameters['tolerance_constant'],\ - 'methodTV': 0 } + 'regularisation_parameter': self.parameters['reg_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'tolerance_constant': self.parameters['tolerance_constant'], \ + 'methodTV': 0} if (self.parameters['method'] == 'TGV'): # set parameters for the TGV method - self.pars = {'algorithm': self.parameters['method'],\ - 'regularisation_parameter' : self.parameters['reg_par'],\ - 'alpha1' : self.parameters['alpha1'],\ - 'alpha0': self.parameters['alpha0'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'LipshitzConstant' :self.parameters['lipshitz_constant'],\ - 'tolerance_constant': self.parameters['tolerance_constant']} + self.pars = {'algorithm': self.parameters['method'], \ + 'regularisation_parameter': self.parameters['reg_par'], \ + 'alpha1': self.parameters['alpha1'], \ + 'alpha0': self.parameters['alpha0'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'LipshitzConstant': self.parameters['lipshitz_constant'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'LLT_ROF'): # set parameters for the LLT-ROF method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'regularisation_parameterLLT':self.parameters['reg_parLLT'], \ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'tolerance_constant': self.parameters['tolerance_constant']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'regularisation_parameterLLT': self.parameters['reg_parLLT'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'NDF'): # set parameters for the NDF method if (self.parameters['penalty_type'] == 'huber'): @@ -131,123 +132,125 @@ def pre_process(self): penaltyNDF = 4 if (self.parameters['penalty_type'] == 'constrhuber'): # Threshold-constrained huber diffusion - penaltyNDF = 5 + penaltyNDF = 5 self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'edge_parameter':self.parameters['edge_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'penalty_type': penaltyNDF,\ - 'tolerance_constant': self.parameters['tolerance_constant']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'edge_parameter': self.parameters['edge_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'penalty_type': penaltyNDF, \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'Diff4th'): # set parameters for the DIFF4th method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'edge_parameter':self.parameters['edge_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'tolerance_constant': self.parameters['tolerance_constant']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'edge_parameter': self.parameters['edge_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'NLTV'): # set parameters for the NLTV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'edge_parameter':self.parameters['edge_par'],\ - 'number_of_iterations': self.parameters['max_iterations']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'edge_parameter': self.parameters['edge_par'], \ + 'number_of_iterations': self.parameters['max_iterations']} return self.pars - #print "The full data shape is", self.get_in_datasets()[0].get_shape() - #print "Example is", self.parameters['example'] + + # print "The full data shape is", self.get_in_datasets()[0].get_shape() + # print "Example is", self.parameters['example'] def process_frames(self, data): import numpy as np - #input_temp = data[0] - #indices = np.where(np.isnan(input_temp)) - #input_temp[indices] = 0.0 - #self.pars['input'] = input_temp + # input_temp = data[0] + # indices = np.where(np.isnan(input_temp)) + # input_temp[indices] = 0.0 + # self.pars['input'] = input_temp input_temp = np.nan_to_num(data[0]) - input_temp[input_temp > 10**15] = 0.0 + input_temp[input_temp > 10 ** 15] = 0.0 self.pars['input'] = input_temp - #self.pars['input'] = np.nan_to_num(data[0]) + # self.pars['input'] = np.nan_to_num(data[0]) # Running Ccpi-RGLTK modules on GPU if (self.parameters['method'] == 'ROF_TV'): - (im_res,infogpu) = ROF_TV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['tolerance_constant'], - self.device) + (im_res, infogpu) = ROF_TV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['tolerance_constant'], + self.device) if (self.parameters['method'] == 'FGP_TV'): - (im_res,infogpu) = FGP_TV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['number_of_iterations'], - self.pars['tolerance_constant'], - self.pars['methodTV'], - self.pars['nonneg'], self.device) + (im_res, infogpu) = FGP_TV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['number_of_iterations'], + self.pars['tolerance_constant'], + self.pars['methodTV'], + self.pars['nonneg'], self.device) if (self.parameters['method'] == 'SB_TV'): - (im_res,infogpu) = SB_TV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['number_of_iterations'], - self.pars['tolerance_constant'], - self.pars['methodTV'], self.device) + (im_res, infogpu) = SB_TV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['number_of_iterations'], + self.pars['tolerance_constant'], + self.pars['methodTV'], self.device) if (self.parameters['method'] == 'TGV'): - (im_res,infogpu) = TGV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['alpha1'], - self.pars['alpha0'], - self.pars['number_of_iterations'], - self.pars['LipshitzConstant'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = TGV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['alpha1'], + self.pars['alpha0'], + self.pars['number_of_iterations'], + self.pars['LipshitzConstant'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'LLT_ROF'): - (im_res,infogpu) = LLT_ROF(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['regularisation_parameterLLT'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = LLT_ROF(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['regularisation_parameterLLT'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'NDF'): - (im_res,infogpu) = NDF(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['edge_parameter'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['penalty_type'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = NDF(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['edge_parameter'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['penalty_type'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'DIFF4th'): - (im_res,infogpu) = Diff4th(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['edge_parameter'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = Diff4th(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['edge_parameter'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'NLTV'): - pars_NLTV = {'algorithm' : PatchSelect, \ - 'input' : self.pars['input'],\ + pars_NLTV = {'algorithm': PatchSelect, \ + 'input': self.pars['input'], \ 'searchwindow': 9, \ - 'patchwindow': 2,\ - 'neighbours' : 17 ,\ - 'edge_parameter':self.pars['edge_parameter']} + 'patchwindow': 2, \ + 'neighbours': 17, \ + 'edge_parameter': self.pars['edge_parameter']} H_i, H_j, Weights = PatchSelect(pars_NLTV['input'], pars_NLTV['searchwindow'], pars_NLTV['patchwindow'], pars_NLTV['neighbours'], pars_NLTV['edge_parameter'], self.device) - parsNLTV_init = {'algorithm' : NLTV, \ - 'input' : pars_NLTV['input'],\ + parsNLTV_init = {'algorithm': NLTV, \ + 'input': pars_NLTV['input'], \ 'H_i': H_i, \ - 'H_j': H_j,\ - 'H_k' : 0,\ - 'Weights' : Weights,\ - 'regularisation_parameter': self.pars['regularisation_parameter'],\ + 'H_j': H_j, \ + 'H_k': 0, \ + 'Weights': Weights, \ + 'regularisation_parameter': self.pars['regularisation_parameter'], \ 'iterations': self.pars['number_of_iterations']} im_res = NLTV(parsNLTV_init['input'], - parsNLTV_init['H_i'], - parsNLTV_init['H_j'], - parsNLTV_init['H_k'], - parsNLTV_init['Weights'], - parsNLTV_init['regularisation_parameter'], - parsNLTV_init['iterations']) - del H_i,H_j,Weights - #print "calling process frames", data[0].shape + parsNLTV_init['H_i'], + parsNLTV_init['H_j'], + parsNLTV_init['H_k'], + parsNLTV_init['Weights'], + parsNLTV_init['regularisation_parameter'], + parsNLTV_init['iterations']) + del H_i, H_j, Weights + # print "calling process frames", data[0].shape return im_res + def post_process(self): pass @@ -255,7 +258,8 @@ def get_citation_information(self): cite_info1 = CitationInformation() cite_info1.name = 'citation1' cite_info1.description = \ - ("The CCPi-Regularisation toolkit provides a set of variational regularisers (denoisers) which can be embedded in a plug-and-play fashion into proximal splitting methods for image reconstruction. CCPi-RGL comes with algorithms that can satisfy various prior expectations of the reconstructed object, for example being piecewise-constant or piecewise-smooth nature.") + ( + "The CCPi-Regularisation toolkit provides a set of variational regularisers (denoisers) which can be embedded in a plug-and-play fashion into proximal splitting methods for image reconstruction. CCPi-RGL comes with algorithms that can satisfy various prior expectations of the reconstructed object, for example being piecewise-constant or piecewise-smooth nature.") cite_info1.bibtex = \ ("@article{kazantsev2019,\n" + "title={CCPi-Regularisation Toolkit for computed tomographic image reconstruction with proximal splitting algorithms},\n" + @@ -286,228 +290,230 @@ def get_citation_information(self): if (self.parameters['method'] == 'ROF_TV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' - cite_info2.description = ("Rudin-Osher-Fatemi explicit PDE minimisation method for smoothed Total Variation regulariser") + cite_info2.description = ( + "Rudin-Osher-Fatemi explicit PDE minimisation method for smoothed Total Variation regulariser") cite_info2.bibtex = \ - ("@article{ROF1992,\n" + - "title={Nonlinear total variation based noise removal algorithms},\n" + - "author={L. Rudin, S. Osher, E. Fatemi},\n" + - "journal={Physica D.},\n" + - "volume={60},\n" + - "number={},\n" + - "pages={259--268},\n" + - "year={1992},\n" + - "publisher={Elsevier}\n" + - "}") + ("@article{ROF1992,\n" + + "title={Nonlinear total variation based noise removal algorithms},\n" + + "author={L. Rudin, S. Osher, E. Fatemi},\n" + + "journal={Physica D.},\n" + + "volume={60},\n" + + "number={},\n" + + "pages={259--268},\n" + + "year={1992},\n" + + "publisher={Elsevier}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Nonlinear total variation based noise removal algorithms\n" + - "%A Rudin, L.\n" + - "%A Osher, S.\n" + - "%A Fatemi, Fatemi\n" + - "%J Physica D.\n" + - "%V 60\n" + - "%N \n" + - "%P 259--268\n" + - "%@ \n" + - "%D 1992\n" + - "%I Elsevier\n") + ("%0 Journal Article\n" + + "%T Nonlinear total variation based noise removal algorithms\n" + + "%A Rudin, L.\n" + + "%A Osher, S.\n" + + "%A Fatemi, Fatemi\n" + + "%J Physica D.\n" + + "%V 60\n" + + "%N \n" + + "%P 259--268\n" + + "%@ \n" + + "%D 1992\n" + + "%I Elsevier\n") cite_info2.doi = "doi: 10.1016/0167-2789(92)90242-F" if (self.parameters['method'] == 'FGP_TV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Fast-Gradient-Projection algorithm for Total Variation regulariser") cite_info2.bibtex = \ - ("@article{FGP2009,\n" + - "title={Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems},\n" + - "author={Amir and Beck, Mark and Teboulle},\n" + - "journal={IEEE Transactions on Image Processing},\n" + - "volume={18},\n" + - "number={11},\n" + - "pages={2419--2434},\n" + - "year={2009},\n" + - "publisher={IEEE}\n" + - "}") + ("@article{FGP2009,\n" + + "title={Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems},\n" + + "author={Amir and Beck, Mark and Teboulle},\n" + + "journal={IEEE Transactions on Image Processing},\n" + + "volume={18},\n" + + "number={11},\n" + + "pages={2419--2434},\n" + + "year={2009},\n" + + "publisher={IEEE}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems\n" + - "%A Beck, Amir\n" + - "%A Teboulle, Mark.\n" + - "%J IEEE Transactions on Image Processing\n" + - "%V 18\n" + - "%N 11\n" + - "%P 2419--2434\n" + - "%@ \n" + - "%D 2009\n" + - "%I IEEE\n") + ("%0 Journal Article\n" + + "%T Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems\n" + + "%A Beck, Amir\n" + + "%A Teboulle, Mark.\n" + + "%J IEEE Transactions on Image Processing\n" + + "%V 18\n" + + "%N 11\n" + + "%P 2419--2434\n" + + "%@ \n" + + "%D 2009\n" + + "%I IEEE\n") cite_info2.doi = "doi: 10.1109/TIP.2009.2028250" if (self.parameters['method'] == 'SB_TV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("The Split Bregman approach for Total Variation regulariser") cite_info2.bibtex = \ - ("@article{SBTV2009,\n" + - "title={The split Bregman method for L1-regularized problems},\n" + - "author={Tom and Goldstein, Stanley and Osher},\n" + - "journal={SIAM journal on imaging sciences},\n" + - "volume={2},\n" + - "number={2},\n" + - "pages={323--343},\n" + - "year={2009},\n" + - "publisher={SIAM}\n" + - "}") + ("@article{SBTV2009,\n" + + "title={The split Bregman method for L1-regularized problems},\n" + + "author={Tom and Goldstein, Stanley and Osher},\n" + + "journal={SIAM journal on imaging sciences},\n" + + "volume={2},\n" + + "number={2},\n" + + "pages={323--343},\n" + + "year={2009},\n" + + "publisher={SIAM}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T The split Bregman method for L1-regularized problems\n" + - "%A Goldstein, Tom\n" + - "%A Osher, Stanley.\n" + - "%J SIAM journal on imaging sciences\n" + - "%V 2\n" + - "%N 2\n" + - "%P 323--343\n" + - "%@ \n" + - "%D 2009\n" + - "%I SIAM\n") + ("%0 Journal Article\n" + + "%T The split Bregman method for L1-regularized problems\n" + + "%A Goldstein, Tom\n" + + "%A Osher, Stanley.\n" + + "%J SIAM journal on imaging sciences\n" + + "%V 2\n" + + "%N 2\n" + + "%P 323--343\n" + + "%@ \n" + + "%D 2009\n" + + "%I SIAM\n") cite_info2.doi = "doi: 10.1137/080725891" if (self.parameters['method'] == 'TGV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Total generalized variation regulariser for piecewise-smooth recovery") cite_info2.bibtex = \ - ("@article{TGV2010,\n" + - "title={Total generalized variation},\n" + - "author={Kristian and Bredies, Karl and Kunisch, Thomas and Pock},\n" + - "journal={SIAM journal on imaging sciences},\n" + - "volume={3},\n" + - "number={3},\n" + - "pages={492--526},\n" + - "year={2010},\n" + - "publisher={SIAM}\n" + - "}") + ("@article{TGV2010,\n" + + "title={Total generalized variation},\n" + + "author={Kristian and Bredies, Karl and Kunisch, Thomas and Pock},\n" + + "journal={SIAM journal on imaging sciences},\n" + + "volume={3},\n" + + "number={3},\n" + + "pages={492--526},\n" + + "year={2010},\n" + + "publisher={SIAM}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Total generalized variation\n" + - "%A Bredies, Kristian\n" + - "%A Kunisch, Kurl.\n" + - "%A Pock, Thomas.\n" + - "%J SIAM journal on imaging sciences\n" + - "%V 3\n" + - "%N 3\n" + - "%P 492--526\n" + - "%@ \n" + - "%D 2010\n" + - "%I SIAM\n") + ("%0 Journal Article\n" + + "%T Total generalized variation\n" + + "%A Bredies, Kristian\n" + + "%A Kunisch, Kurl.\n" + + "%A Pock, Thomas.\n" + + "%J SIAM journal on imaging sciences\n" + + "%V 3\n" + + "%N 3\n" + + "%P 492--526\n" + + "%@ \n" + + "%D 2010\n" + + "%I SIAM\n") cite_info2.doi = "doi: 10.1137/080725891" if (self.parameters['method'] == 'LLT_ROF'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Combination for ROF model and LLT for piecewise-smooth recovery") cite_info2.bibtex = \ - ("@article{ROFLLT2017,\n" + - "title={Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data},\n" + - "author={Daniil and Kazantsev, Enyu and Guo, Andre and Phillion, Philip and Withers, Peter and Lee},\n" + - "journal={Measurement Science and Technology},\n" + - "volume={28},\n" + - "number={9},\n" + - "pages={094004},\n" + - "year={2017},\n" + - "publisher={IoP}\n" + - "}") + ("@article{ROFLLT2017,\n" + + "title={Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data},\n" + + "author={Daniil and Kazantsev, Enyu and Guo, Andre and Phillion, Philip and Withers, Peter and Lee},\n" + + "journal={Measurement Science and Technology},\n" + + "volume={28},\n" + + "number={9},\n" + + "pages={094004},\n" + + "year={2017},\n" + + "publisher={IoP}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data\n" + - "%A Kazantsev, Daniil\n" + - "%A Enyu, Guo.\n" + - "%A Phillion, Andre.\n" + - "%A Withers, Philip.\n" + - "%A Lee, Peter.\n" + - "%J Measurement Science and Technology\n" + - "%V 28\n" + - "%N 9\n" + - "%P 094004\n" + - "%@ \n" + - "%D 2017\n" + - "%I IoP\n") + ("%0 Journal Article\n" + + "%T Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data\n" + + "%A Kazantsev, Daniil\n" + + "%A Enyu, Guo.\n" + + "%A Phillion, Andre.\n" + + "%A Withers, Philip.\n" + + "%A Lee, Peter.\n" + + "%J Measurement Science and Technology\n" + + "%V 28\n" + + "%N 9\n" + + "%P 094004\n" + + "%@ \n" + + "%D 2017\n" + + "%I IoP\n") cite_info2.doi = "doi: 10.1088/1361-6501" if (self.parameters['method'] == 'NDF'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Nonlinear or linear duffison as a regulariser ") cite_info2.bibtex = \ - ("@article{NDF1990,\n" + - "title={Scale-space and edge detection using anisotropic diffusion},\n" + - "author={Pietro and Perona, Jitendra and Malik},\n" + - "journal={IEEE Transactions on pattern analysis and machine intelligence},\n" + - "volume={12},\n" + - "number={7},\n" + - "pages={629--639},\n" + - "year={1990},\n" + - "publisher={IEEE}\n" + - "}") + ("@article{NDF1990,\n" + + "title={Scale-space and edge detection using anisotropic diffusion},\n" + + "author={Pietro and Perona, Jitendra and Malik},\n" + + "journal={IEEE Transactions on pattern analysis and machine intelligence},\n" + + "volume={12},\n" + + "number={7},\n" + + "pages={629--639},\n" + + "year={1990},\n" + + "publisher={IEEE}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Scale-space and edge detection using anisotropic diffusion\n" + - "%A Pietro, Perona\n" + - "%A Jitendra, Malik.\n" + - "%J IEEE Transactions on pattern analysis and machine intelligence\n" + - "%V 12\n" + - "%N 7\n" + - "%P 629--639\n" + - "%@ \n" + - "%D 1990\n" + - "%I IEEE\n") + ("%0 Journal Article\n" + + "%T Scale-space and edge detection using anisotropic diffusion\n" + + "%A Pietro, Perona\n" + + "%A Jitendra, Malik.\n" + + "%J IEEE Transactions on pattern analysis and machine intelligence\n" + + "%V 12\n" + + "%N 7\n" + + "%P 629--639\n" + + "%@ \n" + + "%D 1990\n" + + "%I IEEE\n") cite_info2.doi = "doi: 10.1109/34.56205" if (self.parameters['method'] == 'DIFF4th'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Anisotropic diffusion of higher order for piecewise-smooth recovery") cite_info2.bibtex = \ - ("@article{ADF2011,\n" + - "title={An anisotropic fourth-order diffusion filter for image noise removal},\n" + - "author={Mohammad Reza and Hajiaboli},\n" + - "journal={International Journal of Computer Vision},\n" + - "volume={92},\n" + - "number={2},\n" + - "pages={177--191},\n" + - "year={2011},\n" + - "publisher={Springer}\n" + - "}") + ("@article{ADF2011,\n" + + "title={An anisotropic fourth-order diffusion filter for image noise removal},\n" + + "author={Mohammad Reza and Hajiaboli},\n" + + "journal={International Journal of Computer Vision},\n" + + "volume={92},\n" + + "number={2},\n" + + "pages={177--191},\n" + + "year={2011},\n" + + "publisher={Springer}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Anisotropic diffusion of higher order for piecewise-smooth recovery\n" + - "%A Mohammad Reza, Hajiaboli\n" + - "%J International Journal of Computer Vision\n" + - "%V 92\n" + - "%N 2\n" + - "%P 177--191\n" + - "%@ \n" + - "%D 2011\n" + - "%I Springer\n") + ("%0 Journal Article\n" + + "%T Anisotropic diffusion of higher order for piecewise-smooth recovery\n" + + "%A Mohammad Reza, Hajiaboli\n" + + "%J International Journal of Computer Vision\n" + + "%V 92\n" + + "%N 2\n" + + "%P 177--191\n" + + "%@ \n" + + "%D 2011\n" + + "%I Springer\n") cite_info2.doi = "doi: 10.1007/s11263-010-0330-1" if (self.parameters['method'] == 'NLTV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' - cite_info2.description = ("Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing") + cite_info2.description = ( + "Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing") cite_info2.bibtex = \ - ("@article{abd2008,\n" + - "title={Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing},\n" + - "author={Abderrahim and Lezoray and Bougleux},\n" + - "journal={IEEE Trans. Image Processing},\n" + - "volume={17},\n" + - "number={7},\n" + - "pages={1047--1060},\n" + - "year={2008},\n" + - "publisher={IEEE}\n" + - "}") + ("@article{abd2008,\n" + + "title={Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing},\n" + + "author={Abderrahim and Lezoray and Bougleux},\n" + + "journal={IEEE Trans. Image Processing},\n" + + "volume={17},\n" + + "number={7},\n" + + "pages={1047--1060},\n" + + "year={2008},\n" + + "publisher={IEEE}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing\n" + - "%A Abderrahim, Lezoray, Bougleux\n" + - "%J IEEE Trans. Image Processing\n" + - "%V 17\n" + - "%N 7\n" + - "%P 1047--1060\n" + - "%@ \n" + - "%D 2008\n" + - "%I IEEE\n") + ("%0 Journal Article\n" + + "%T Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing\n" + + "%A Abderrahim, Lezoray, Bougleux\n" + + "%J IEEE Trans. Image Processing\n" + + "%V 17\n" + + "%N 7\n" + + "%P 1047--1060\n" + + "%@ \n" + + "%D 2008\n" + + "%I IEEE\n") cite_info2.doi = "doi: 10.1109/TIP.2008.924284" return [cite_info1, cite_info2] diff --git a/savu/plugins/filters/denoising/ccpi_denoising_gpu.py b/savu/plugins/filters/denoising/ccpi_denoising_gpu.py index f6b0b482b..8a50577ce 100644 --- a/savu/plugins/filters/denoising/ccpi_denoising_gpu.py +++ b/savu/plugins/filters/denoising/ccpi_denoising_gpu.py @@ -29,6 +29,7 @@ from ccpi.filters.regularisers import PatchSelect, NLTV from savu.data.plugin_list import CitationInformation + @register_plugin class CcpiDenoisingGpu(Plugin, GpuPlugin): """ @@ -81,42 +82,42 @@ def pre_process(self): if (self.parameters['method'] == 'ROF_TV'): # set parameters for the ROF-TV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'tolerance_constant': self.parameters['tolerance_constant'] } + 'regularisation_parameter': self.parameters['reg_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'FGP_TV'): # set parameters for the FGP-TV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'tolerance_constant': self.parameters['tolerance_constant'],\ - 'methodTV': 0 ,\ - 'nonneg': 0 } + 'regularisation_parameter': self.parameters['reg_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'tolerance_constant': self.parameters['tolerance_constant'], \ + 'methodTV': 0, \ + 'nonneg': 0} if (self.parameters['method'] == 'SB_TV'): # set parameters for the SB-TV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'tolerance_constant': self.parameters['tolerance_constant'],\ - 'methodTV': 0 } + 'regularisation_parameter': self.parameters['reg_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'tolerance_constant': self.parameters['tolerance_constant'], \ + 'methodTV': 0} if (self.parameters['method'] == 'TGV'): # set parameters for the TGV method - self.pars = {'algorithm': self.parameters['method'],\ - 'regularisation_parameter' : self.parameters['reg_par'],\ - 'alpha1' : self.parameters['alpha1'],\ - 'alpha0': self.parameters['alpha0'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'LipshitzConstant' :self.parameters['lipshitz_constant'],\ - 'tolerance_constant': self.parameters['tolerance_constant']} + self.pars = {'algorithm': self.parameters['method'], \ + 'regularisation_parameter': self.parameters['reg_par'], \ + 'alpha1': self.parameters['alpha1'], \ + 'alpha0': self.parameters['alpha0'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'LipshitzConstant': self.parameters['lipshitz_constant'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'LLT_ROF'): # set parameters for the LLT-ROF method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'regularisation_parameterLLT':self.parameters['reg_parLLT'], \ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'tolerance_constant': self.parameters['tolerance_constant']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'regularisation_parameterLLT': self.parameters['reg_parLLT'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'NDF'): # set parameters for the NDF method if (self.parameters['penalty_type'] == 'huber'): @@ -135,121 +136,123 @@ def pre_process(self): # Threshold-constrained huber diffusion penaltyNDF = 5 self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'edge_parameter':self.parameters['edge_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'penalty_type': penaltyNDF,\ - 'tolerance_constant': self.parameters['tolerance_constant']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'edge_parameter': self.parameters['edge_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'penalty_type': penaltyNDF, \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'Diff4th'): # set parameters for the Diff4th method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'edge_parameter':self.parameters['edge_par'],\ - 'number_of_iterations': self.parameters['max_iterations'],\ - 'time_marching_parameter': self.parameters['time_step'],\ - 'tolerance_constant': self.parameters['tolerance_constant']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'edge_parameter': self.parameters['edge_par'], \ + 'number_of_iterations': self.parameters['max_iterations'], \ + 'time_marching_parameter': self.parameters['time_step'], \ + 'tolerance_constant': self.parameters['tolerance_constant']} if (self.parameters['method'] == 'NLTV'): # set parameters for the NLTV method self.pars = {'algorithm': self.parameters['method'], \ - 'regularisation_parameter':self.parameters['reg_par'],\ - 'edge_parameter':self.parameters['edge_par'],\ - 'number_of_iterations': self.parameters['max_iterations']} + 'regularisation_parameter': self.parameters['reg_par'], \ + 'edge_parameter': self.parameters['edge_par'], \ + 'number_of_iterations': self.parameters['max_iterations']} return self.pars - #print "The full data shape is", self.get_in_datasets()[0].get_shape() - #print "Example is", self.parameters['example'] + # print "The full data shape is", self.get_in_datasets()[0].get_shape() + # print "Example is", self.parameters['example'] + def process_frames(self, data): import numpy as np - #input_temp = data[0] - #indices = np.where(np.isnan(input_temp)) - #input_temp[indices] = 0.0 - #self.pars['input'] = input_temp + # input_temp = data[0] + # indices = np.where(np.isnan(input_temp)) + # input_temp[indices] = 0.0 + # self.pars['input'] = input_temp input_temp = np.nan_to_num(data[0]) - input_temp[input_temp > 10**15] = 0.0 + input_temp[input_temp > 10 ** 15] = 0.0 self.pars['input'] = input_temp - #self.pars['input'] = np.nan_to_num(data[0]) - + # self.pars['input'] = np.nan_to_num(data[0]) + # Running Ccpi-RGLTK modules on GPU if (self.parameters['method'] == 'ROF_TV'): - (im_res,infogpu) = ROF_TV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['tolerance_constant'], - self.device) + (im_res, infogpu) = ROF_TV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['tolerance_constant'], + self.device) if (self.parameters['method'] == 'FGP_TV'): - (im_res,infogpu) = FGP_TV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['number_of_iterations'], - self.pars['tolerance_constant'], - self.pars['methodTV'], - self.pars['nonneg'], self.device) + (im_res, infogpu) = FGP_TV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['number_of_iterations'], + self.pars['tolerance_constant'], + self.pars['methodTV'], + self.pars['nonneg'], self.device) if (self.parameters['method'] == 'SB_TV'): - (im_res,infogpu) = SB_TV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['number_of_iterations'], - self.pars['tolerance_constant'], - self.pars['methodTV'], self.device) + (im_res, infogpu) = SB_TV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['number_of_iterations'], + self.pars['tolerance_constant'], + self.pars['methodTV'], self.device) if (self.parameters['method'] == 'TGV'): - (im_res,infogpu) = TGV(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['alpha1'], - self.pars['alpha0'], - self.pars['number_of_iterations'], - self.pars['LipshitzConstant'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = TGV(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['alpha1'], + self.pars['alpha0'], + self.pars['number_of_iterations'], + self.pars['LipshitzConstant'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'LLT_ROF'): - (im_res,infogpu) = LLT_ROF(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['regularisation_parameterLLT'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = LLT_ROF(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['regularisation_parameterLLT'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'NDF'): - (im_res,infogpu) = NDF(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['edge_parameter'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['penalty_type'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = NDF(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['edge_parameter'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['penalty_type'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'DIFF4th'): - (im_res,infogpu) = Diff4th(self.pars['input'], - self.pars['regularisation_parameter'], - self.pars['edge_parameter'], - self.pars['number_of_iterations'], - self.pars['time_marching_parameter'], - self.pars['tolerance_constant'], self.device) + (im_res, infogpu) = Diff4th(self.pars['input'], + self.pars['regularisation_parameter'], + self.pars['edge_parameter'], + self.pars['number_of_iterations'], + self.pars['time_marching_parameter'], + self.pars['tolerance_constant'], self.device) if (self.parameters['method'] == 'NLTV'): - pars_NLTV = {'algorithm' : PatchSelect, \ - 'input' : self.pars['input'],\ + pars_NLTV = {'algorithm': PatchSelect, \ + 'input': self.pars['input'], \ 'searchwindow': 9, \ - 'patchwindow': 2,\ - 'neighbours' : 17 ,\ - 'edge_parameter':self.pars['edge_parameter']} + 'patchwindow': 2, \ + 'neighbours': 17, \ + 'edge_parameter': self.pars['edge_parameter']} H_i, H_j, Weights = PatchSelect(pars_NLTV['input'], pars_NLTV['searchwindow'], pars_NLTV['patchwindow'], pars_NLTV['neighbours'], pars_NLTV['edge_parameter'], self.device) - parsNLTV_init = {'algorithm' : NLTV, \ - 'input' : pars_NLTV['input'],\ + parsNLTV_init = {'algorithm': NLTV, \ + 'input': pars_NLTV['input'], \ 'H_i': H_i, \ - 'H_j': H_j,\ - 'H_k' : 0,\ - 'Weights' : Weights,\ - 'regularisation_parameter': self.pars['regularisation_parameter'],\ + 'H_j': H_j, \ + 'H_k': 0, \ + 'Weights': Weights, \ + 'regularisation_parameter': self.pars['regularisation_parameter'], \ 'iterations': self.pars['number_of_iterations']} im_res = NLTV(parsNLTV_init['input'], - parsNLTV_init['H_i'], - parsNLTV_init['H_j'], - parsNLTV_init['H_k'], - parsNLTV_init['Weights'], - parsNLTV_init['regularisation_parameter'], - parsNLTV_init['iterations']) - del H_i,H_j,Weights - #print "calling process frames", data[0].shape + parsNLTV_init['H_i'], + parsNLTV_init['H_j'], + parsNLTV_init['H_k'], + parsNLTV_init['Weights'], + parsNLTV_init['regularisation_parameter'], + parsNLTV_init['iterations']) + del H_i, H_j, Weights + # print "calling process frames", data[0].shape return im_res + def post_process(self): pass @@ -257,7 +260,8 @@ def get_citation_information(self): cite_info1 = CitationInformation() cite_info1.name = 'citation1' cite_info1.description = \ - ("The CCPi-Regularisation toolkit provides a set of variational regularisers (denoisers) which can be embedded in a plug-and-play fashion into proximal splitting methods for image reconstruction. CCPi-RGL comes with algorithms that can satisfy various prior expectations of the reconstructed object, for example being piecewise-constant or piecewise-smooth nature.") + ( + "The CCPi-Regularisation toolkit provides a set of variational regularisers (denoisers) which can be embedded in a plug-and-play fashion into proximal splitting methods for image reconstruction. CCPi-RGL comes with algorithms that can satisfy various prior expectations of the reconstructed object, for example being piecewise-constant or piecewise-smooth nature.") cite_info1.bibtex = \ ("@article{kazantsev2019,\n" + "title={CCPi-Regularisation Toolkit for computed tomographic image reconstruction with proximal splitting algorithms},\n" + @@ -288,228 +292,230 @@ def get_citation_information(self): if (self.parameters['method'] == 'ROF_TV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' - cite_info2.description = ("Rudin-Osher-Fatemi explicit PDE minimisation method for smoothed Total Variation regulariser") + cite_info2.description = ( + "Rudin-Osher-Fatemi explicit PDE minimisation method for smoothed Total Variation regulariser") cite_info2.bibtex = \ - ("@article{ROF1992,\n" + - "title={Nonlinear total variation based noise removal algorithms},\n" + - "author={L. Rudin, S. Osher, E. Fatemi},\n" + - "journal={Physica D.},\n" + - "volume={60},\n" + - "number={},\n" + - "pages={259--268},\n" + - "year={1992},\n" + - "publisher={Elsevier}\n" + - "}") + ("@article{ROF1992,\n" + + "title={Nonlinear total variation based noise removal algorithms},\n" + + "author={L. Rudin, S. Osher, E. Fatemi},\n" + + "journal={Physica D.},\n" + + "volume={60},\n" + + "number={},\n" + + "pages={259--268},\n" + + "year={1992},\n" + + "publisher={Elsevier}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Nonlinear total variation based noise removal algorithms\n" + - "%A Rudin, L.\n" + - "%A Osher, S.\n" + - "%A Fatemi, Fatemi\n" + - "%J Physica D.\n" + - "%V 60\n" + - "%N \n" + - "%P 259--268\n" + - "%@ \n" + - "%D 1992\n" + - "%I Elsevier\n") + ("%0 Journal Article\n" + + "%T Nonlinear total variation based noise removal algorithms\n" + + "%A Rudin, L.\n" + + "%A Osher, S.\n" + + "%A Fatemi, Fatemi\n" + + "%J Physica D.\n" + + "%V 60\n" + + "%N \n" + + "%P 259--268\n" + + "%@ \n" + + "%D 1992\n" + + "%I Elsevier\n") cite_info2.doi = "doi: 10.1016/0167-2789(92)90242-F" if (self.parameters['method'] == 'FGP_TV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Fast-Gradient-Projection algorithm for Total Variation regulariser") cite_info2.bibtex = \ - ("@article{FGP2009,\n" + - "title={Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems},\n" + - "author={Amir and Beck, Mark and Teboulle},\n" + - "journal={IEEE Transactions on Image Processing},\n" + - "volume={18},\n" + - "number={11},\n" + - "pages={2419--2434},\n" + - "year={2009},\n" + - "publisher={IEEE}\n" + - "}") + ("@article{FGP2009,\n" + + "title={Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems},\n" + + "author={Amir and Beck, Mark and Teboulle},\n" + + "journal={IEEE Transactions on Image Processing},\n" + + "volume={18},\n" + + "number={11},\n" + + "pages={2419--2434},\n" + + "year={2009},\n" + + "publisher={IEEE}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems\n" + - "%A Beck, Amir\n" + - "%A Teboulle, Mark.\n" + - "%J IEEE Transactions on Image Processing\n" + - "%V 18\n" + - "%N 11\n" + - "%P 2419--2434\n" + - "%@ \n" + - "%D 2009\n" + - "%I IEEE\n") + ("%0 Journal Article\n" + + "%T Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems\n" + + "%A Beck, Amir\n" + + "%A Teboulle, Mark.\n" + + "%J IEEE Transactions on Image Processing\n" + + "%V 18\n" + + "%N 11\n" + + "%P 2419--2434\n" + + "%@ \n" + + "%D 2009\n" + + "%I IEEE\n") cite_info2.doi = "doi: 10.1109/TIP.2009.2028250" if (self.parameters['method'] == 'SB_TV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("The Split Bregman approach for Total Variation regulariser") cite_info2.bibtex = \ - ("@article{SBTV2009,\n" + - "title={The split Bregman method for L1-regularized problems},\n" + - "author={Tom and Goldstein, Stanley and Osher},\n" + - "journal={SIAM journal on imaging sciences},\n" + - "volume={2},\n" + - "number={2},\n" + - "pages={323--343},\n" + - "year={2009},\n" + - "publisher={SIAM}\n" + - "}") + ("@article{SBTV2009,\n" + + "title={The split Bregman method for L1-regularized problems},\n" + + "author={Tom and Goldstein, Stanley and Osher},\n" + + "journal={SIAM journal on imaging sciences},\n" + + "volume={2},\n" + + "number={2},\n" + + "pages={323--343},\n" + + "year={2009},\n" + + "publisher={SIAM}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T The split Bregman method for L1-regularized problems\n" + - "%A Goldstein, Tom\n" + - "%A Osher, Stanley.\n" + - "%J SIAM journal on imaging sciences\n" + - "%V 2\n" + - "%N 2\n" + - "%P 323--343\n" + - "%@ \n" + - "%D 2009\n" + - "%I SIAM\n") + ("%0 Journal Article\n" + + "%T The split Bregman method for L1-regularized problems\n" + + "%A Goldstein, Tom\n" + + "%A Osher, Stanley.\n" + + "%J SIAM journal on imaging sciences\n" + + "%V 2\n" + + "%N 2\n" + + "%P 323--343\n" + + "%@ \n" + + "%D 2009\n" + + "%I SIAM\n") cite_info2.doi = "doi: 10.1137/080725891" if (self.parameters['method'] == 'TGV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Total generalized variation regulariser for piecewise-smooth recovery") cite_info2.bibtex = \ - ("@article{TGV2010,\n" + - "title={Total generalized variation},\n" + - "author={Kristian and Bredies, Karl and Kunisch, Thomas and Pock},\n" + - "journal={SIAM journal on imaging sciences},\n" + - "volume={3},\n" + - "number={3},\n" + - "pages={492--526},\n" + - "year={2010},\n" + - "publisher={SIAM}\n" + - "}") + ("@article{TGV2010,\n" + + "title={Total generalized variation},\n" + + "author={Kristian and Bredies, Karl and Kunisch, Thomas and Pock},\n" + + "journal={SIAM journal on imaging sciences},\n" + + "volume={3},\n" + + "number={3},\n" + + "pages={492--526},\n" + + "year={2010},\n" + + "publisher={SIAM}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Total generalized variation\n" + - "%A Bredies, Kristian\n" + - "%A Kunisch, Kurl.\n" + - "%A Pock, Thomas.\n" + - "%J SIAM journal on imaging sciences\n" + - "%V 3\n" + - "%N 3\n" + - "%P 492--526\n" + - "%@ \n" + - "%D 2010\n" + - "%I SIAM\n") + ("%0 Journal Article\n" + + "%T Total generalized variation\n" + + "%A Bredies, Kristian\n" + + "%A Kunisch, Kurl.\n" + + "%A Pock, Thomas.\n" + + "%J SIAM journal on imaging sciences\n" + + "%V 3\n" + + "%N 3\n" + + "%P 492--526\n" + + "%@ \n" + + "%D 2010\n" + + "%I SIAM\n") cite_info2.doi = "doi: 10.1137/080725891" if (self.parameters['method'] == 'LLT_ROF'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Combination for ROF model and LLT for piecewise-smooth recovery") cite_info2.bibtex = \ - ("@article{ROFLLT2017,\n" + - "title={Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data},\n" + - "author={Daniil and Kazantsev, Enyu and Guo, Andre and Phillion, Philip and Withers, Peter and Lee},\n" + - "journal={Measurement Science and Technology},\n" + - "volume={28},\n" + - "number={9},\n" + - "pages={094004},\n" + - "year={2017},\n" + - "publisher={IoP}\n" + - "}") + ("@article{ROFLLT2017,\n" + + "title={Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data},\n" + + "author={Daniil and Kazantsev, Enyu and Guo, Andre and Phillion, Philip and Withers, Peter and Lee},\n" + + "journal={Measurement Science and Technology},\n" + + "volume={28},\n" + + "number={9},\n" + + "pages={094004},\n" + + "year={2017},\n" + + "publisher={IoP}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data\n" + - "%A Kazantsev, Daniil\n" + - "%A Enyu, Guo.\n" + - "%A Phillion, Andre.\n" + - "%A Withers, Philip.\n" + - "%A Lee, Peter.\n" + - "%J Measurement Science and Technology\n" + - "%V 28\n" + - "%N 9\n" + - "%P 094004\n" + - "%@ \n" + - "%D 2017\n" + - "%I IoP\n") + ("%0 Journal Article\n" + + "%T Model-based iterative reconstruction using higher-order regularization of dynamic synchrotron data\n" + + "%A Kazantsev, Daniil\n" + + "%A Enyu, Guo.\n" + + "%A Phillion, Andre.\n" + + "%A Withers, Philip.\n" + + "%A Lee, Peter.\n" + + "%J Measurement Science and Technology\n" + + "%V 28\n" + + "%N 9\n" + + "%P 094004\n" + + "%@ \n" + + "%D 2017\n" + + "%I IoP\n") cite_info2.doi = "doi: 10.1088/1361-6501" if (self.parameters['method'] == 'NDF'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Nonlinear or linear duffison as a regulariser ") cite_info2.bibtex = \ - ("@article{NDF1990,\n" + - "title={Scale-space and edge detection using anisotropic diffusion},\n" + - "author={Pietro and Perona, Jitendra and Malik},\n" + - "journal={IEEE Transactions on pattern analysis and machine intelligence},\n" + - "volume={12},\n" + - "number={7},\n" + - "pages={629--639},\n" + - "year={1990},\n" + - "publisher={IEEE}\n" + - "}") + ("@article{NDF1990,\n" + + "title={Scale-space and edge detection using anisotropic diffusion},\n" + + "author={Pietro and Perona, Jitendra and Malik},\n" + + "journal={IEEE Transactions on pattern analysis and machine intelligence},\n" + + "volume={12},\n" + + "number={7},\n" + + "pages={629--639},\n" + + "year={1990},\n" + + "publisher={IEEE}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Scale-space and edge detection using anisotropic diffusion\n" + - "%A Pietro, Perona\n" + - "%A Jitendra, Malik.\n" + - "%J IEEE Transactions on pattern analysis and machine intelligence\n" + - "%V 12\n" + - "%N 7\n" + - "%P 629--639\n" + - "%@ \n" + - "%D 1990\n" + - "%I IEEE\n") + ("%0 Journal Article\n" + + "%T Scale-space and edge detection using anisotropic diffusion\n" + + "%A Pietro, Perona\n" + + "%A Jitendra, Malik.\n" + + "%J IEEE Transactions on pattern analysis and machine intelligence\n" + + "%V 12\n" + + "%N 7\n" + + "%P 629--639\n" + + "%@ \n" + + "%D 1990\n" + + "%I IEEE\n") cite_info2.doi = "doi: 10.1109/34.56205" if (self.parameters['method'] == 'DIFF4th'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' cite_info2.description = ("Anisotropic diffusion of higher order for piecewise-smooth recovery") cite_info2.bibtex = \ - ("@article{ADF2011,\n" + - "title={An anisotropic fourth-order diffusion filter for image noise removal},\n" + - "author={Mohammad Reza and Hajiaboli},\n" + - "journal={International Journal of Computer Vision},\n" + - "volume={92},\n" + - "number={2},\n" + - "pages={177--191},\n" + - "year={2011},\n" + - "publisher={Springer}\n" + - "}") + ("@article{ADF2011,\n" + + "title={An anisotropic fourth-order diffusion filter for image noise removal},\n" + + "author={Mohammad Reza and Hajiaboli},\n" + + "journal={International Journal of Computer Vision},\n" + + "volume={92},\n" + + "number={2},\n" + + "pages={177--191},\n" + + "year={2011},\n" + + "publisher={Springer}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Anisotropic diffusion of higher order for piecewise-smooth recovery\n" + - "%A Mohammad Reza, Hajiaboli\n" + - "%J International Journal of Computer Vision\n" + - "%V 92\n" + - "%N 2\n" + - "%P 177--191\n" + - "%@ \n" + - "%D 2011\n" + - "%I Springer\n") + ("%0 Journal Article\n" + + "%T Anisotropic diffusion of higher order for piecewise-smooth recovery\n" + + "%A Mohammad Reza, Hajiaboli\n" + + "%J International Journal of Computer Vision\n" + + "%V 92\n" + + "%N 2\n" + + "%P 177--191\n" + + "%@ \n" + + "%D 2011\n" + + "%I Springer\n") cite_info2.doi = "doi: 10.1007/s11263-010-0330-1" if (self.parameters['method'] == 'NLTV'): cite_info2 = CitationInformation() cite_info2.name = 'citation2' - cite_info2.description = ("Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing") + cite_info2.description = ( + "Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing") cite_info2.bibtex = \ - ("@article{abd2008,\n" + - "title={Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing},\n" + - "author={Abderrahim and Lezoray and Bougleux},\n" + - "journal={IEEE Trans. Image Processing},\n" + - "volume={17},\n" + - "number={7},\n" + - "pages={1047--1060},\n" + - "year={2008},\n" + - "publisher={IEEE}\n" + - "}") + ("@article{abd2008,\n" + + "title={Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing},\n" + + "author={Abderrahim and Lezoray and Bougleux},\n" + + "journal={IEEE Trans. Image Processing},\n" + + "volume={17},\n" + + "number={7},\n" + + "pages={1047--1060},\n" + + "year={2008},\n" + + "publisher={IEEE}\n" + + "}") cite_info2.endnote = \ - ("%0 Journal Article\n" + - "%T Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing\n" + - "%A Abderrahim, Lezoray, Bougleux\n" + - "%J IEEE Trans. Image Processing\n" + - "%V 17\n" + - "%N 7\n" + - "%P 1047--1060\n" + - "%@ \n" + - "%D 2008\n" + - "%I IEEE\n") + ("%0 Journal Article\n" + + "%T Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing\n" + + "%A Abderrahim, Lezoray, Bougleux\n" + + "%J IEEE Trans. Image Processing\n" + + "%V 17\n" + + "%N 7\n" + + "%P 1047--1060\n" + + "%@ \n" + + "%D 2008\n" + + "%I IEEE\n") cite_info2.doi = "doi: 10.1109/TIP.2008.924284" return [cite_info1, cite_info2] diff --git a/savu/plugins/filters/denoising/ccpi_denoising_gpu_3D.py b/savu/plugins/filters/denoising/ccpi_denoising_gpu_3D.py index 331bafcb5..602f024ba 100644 --- a/savu/plugins/filters/denoising/ccpi_denoising_gpu_3D.py +++ b/savu/plugins/filters/denoising/ccpi_denoising_gpu_3D.py @@ -63,9 +63,11 @@ def __init__(self): def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') + + getall = ['VOLUME_XZ', 'voxel_y'] + in_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) out_dataset[0].create_dataset(in_dataset[0]) - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') + out_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) def pre_process(self): self.device = 'gpu' diff --git a/savu/plugins/filters/denoising/median_filter.py b/savu/plugins/filters/denoising/median_filter.py index b5f2d37b5..a83a63f8a 100644 --- a/savu/plugins/filters/denoising/median_filter.py +++ b/savu/plugins/filters/denoising/median_filter.py @@ -13,42 +13,64 @@ # limitations under the License. """ -.. module:: median_3x3_filter +.. module:: median filter from the Larix software :platform: Unix - :synopsis: A plugin to filter each frame with a 3x3 median filter + :synopsis: A plugin to apply 2D/3D median filter -.. moduleauthor:: Mark Basham +.. moduleauthor::Daniil Kazantsev """ -import logging - -from savu.plugins.filters.base_filter import BaseFilter +from savu.plugins.plugin import Plugin from savu.plugins.driver.cpu_plugin import CpuPlugin - -import scipy.signal.signaltools as sig - from savu.plugins.utils import register_plugin +import numpy as np +from larix.methods.misc import MEDIAN_FILT @register_plugin -class MedianFilter(BaseFilter, CpuPlugin): +class MedianFilter(Plugin, CpuPlugin): """ - A plugin to filter each frame with a 3x3 median filter + A plugin to apply 2D/3D median filter. The 3D capability is enabled\ + through padding. Note that the kernel_size in 2D will be kernel_size x kernel_size + and in 3D case kernel_size x kernel_size x kernel_size. - :u*param kernel_size: Kernel size for the filter. Default: (1, 3, 3). + :u*param kernel_size: Kernel size of the median filter. Default: 3. + :u*param dimension: dimensionality of the filter 2D/3D. Default: '3D'. :u*param pattern: pattern to apply this to. Default: "PROJECTION". """ def __init__(self): - logging.debug("Starting Median Filter") super(MedianFilter, self).__init__("MedianFilter") + def setup(self): + in_dataset, out_dataset = self.get_datasets() + out_dataset[0].create_dataset(in_dataset[0]) + in_pData, out_pData = self.get_plugin_datasets() + in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + def process_frames(self, data): - result = sig.medfilt(data[0], self.parameters['kernel_size']) + input_temp = np.float32(data[0]) + indices = np.where(np.isnan(input_temp)) + input_temp[indices] = 0.0 + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + input_temp =np.swapaxes(input_temp,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + input_temp =np.swapaxes(input_temp,0,1) + result = MEDIAN_FILT(input_temp.copy(order='C'), self.parameters['kernel_size']) + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + result =np.swapaxes(result,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + result =np.swapaxes(result,0,1) return result def set_filter_padding(self, in_data, out_data): - padding = (self.parameters['kernel_size'][0]-1)/2 + if (self.parameters['dimension'] == '3D'): + padding = (self.parameters['kernel_size']-1)/2 + else: + padding = 0 in_data[0].padding = {'pad_multi_frames': padding} out_data[0].padding = {'pad_multi_frames': padding} @@ -60,4 +82,3 @@ def nOutput_datasets(self): def get_plugin_pattern(self): return self.parameters['pattern'] - diff --git a/savu/plugins/filters/denoising/median_filter_deprecated.py b/savu/plugins/filters/denoising/median_filter_deprecated.py new file mode 100644 index 000000000..ed6cdca60 --- /dev/null +++ b/savu/plugins/filters/denoising/median_filter_deprecated.py @@ -0,0 +1,63 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: median_3x3_filter + :platform: Unix + :synopsis: A plugin to filter each frame with a 3x3 median filter + +.. moduleauthor:: Mark Basham + +""" +import logging + +from savu.plugins.filters.base_filter import BaseFilter +from savu.plugins.driver.cpu_plugin import CpuPlugin + +import scipy.signal.signaltools as sig + +from savu.plugins.utils import register_plugin + + +@register_plugin +class MedianFilterDeprecated(BaseFilter, CpuPlugin): + """ + A plugin to filter each frame with a 3x3 median filter + + :u*param kernel_size: Kernel size for the filter. Default: (1, 3, 3). + :u*param pattern: pattern to apply this to. Default: "PROJECTION". + """ + + def __init__(self): + logging.debug("Starting Median Filter") + super(MedianFilterDeprecated, self).__init__("MedianFilterDeprecated") + + def process_frames(self, data): + result = sig.medfilt(data[0], self.parameters['kernel_size']) + return result + + def set_filter_padding(self, in_data, out_data): + padding = (self.parameters['kernel_size'][0]-1) // 2 + in_data[0].padding = {'pad_multi_frames': padding} + out_data[0].padding = {'pad_multi_frames': padding} + + def nInput_datasets(self): + return 1 + + def nOutput_datasets(self): + return 1 + + def get_plugin_pattern(self): + return self.parameters['pattern'] + diff --git a/savu/plugins/filters/denoising/median_filter_gpu.py b/savu/plugins/filters/denoising/median_filter_gpu.py new file mode 100644 index 000000000..3ef88f278 --- /dev/null +++ b/savu/plugins/filters/denoising/median_filter_gpu.py @@ -0,0 +1,87 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: median filter (GPU) from the Larix software + :platform: Unix + :synopsis: A plugin to apply 2D/3D median filter (GPU) + +.. moduleauthor::Daniil Kazantsev + +""" +from savu.plugins.plugin import Plugin +from savu.plugins.driver.gpu_plugin import GpuPlugin +from savu.plugins.utils import register_plugin + +import numpy as np +from larix.methods.misc_gpu import MEDIAN_FILT_GPU + +@register_plugin +class MedianFilterGpu(Plugin, GpuPlugin): + """ + A plugin to apply 2D/3D median filter on a GPU. The 3D capability is enabled\ + through padding. Note that the kernel_size in 2D will be kernel_size x kernel_size + and in 3D case kernel_size x kernel_size x kernel_size. + + :u*param kernel_size: Kernel size of the median filter. Default: 3. + :u*param dimension: dimensionality of the filter 2D/3D. Default: '3D'. + :u*param pattern: pattern to apply this to. Default: "PROJECTION". + """ + + def __init__(self): + super(MedianFilterGpu, self).__init__('MedianFilterGpu') + self.GPU_index = None + self.res = False + self.start = 0 + + def setup(self): + in_dataset, out_dataset = self.get_datasets() + out_dataset[0].create_dataset(in_dataset[0]) + in_pData, out_pData = self.get_plugin_datasets() + in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + + def process_frames(self, data): + input_temp = np.float32(data[0]) + indices = np.where(np.isnan(input_temp)) + input_temp[indices] = 0.0 + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + input_temp =np.swapaxes(input_temp,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + input_temp =np.swapaxes(input_temp,0,1) + result = MEDIAN_FILT_GPU(input_temp.copy(order='C'), self.parameters['kernel_size']) + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + result =np.swapaxes(result,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + result =np.swapaxes(result,0,1) + return result + + def set_filter_padding(self, in_data, out_data): + if (self.parameters['dimension'] == '3D'): + padding = (self.parameters['kernel_size']-1)/2 + else: + padding = 0 + in_data[0].padding = {'pad_multi_frames': padding} + out_data[0].padding = {'pad_multi_frames': padding} + + def nInput_datasets(self): + return 1 + + def nOutput_datasets(self): + return 1 + + def get_plugin_pattern(self): + return self.parameters['pattern'] diff --git a/savu/plugins/filters/dezinger.py b/savu/plugins/filters/dezinger.py index d3769764f..d947f52d1 100644 --- a/savu/plugins/filters/dezinger.py +++ b/savu/plugins/filters/dezinger.py @@ -36,6 +36,7 @@ class Dezinger(BaseFilter, CpuPlugin): """ A plugin for cleaning x-ray strikes based on statistical evaluation of \ the near neighbourhood + :param outlier_mu: Threshold for defecting outliers, greater is less \ sensitive. Default: 10.0. :param kernel_size: Number of frames included in average. Default: 5. @@ -115,7 +116,7 @@ def raw_data(self): def set_filter_padding(self, in_data, out_data): in_data = in_data[0] - self.pad = (self.parameters['kernel_size'] - 1) / 2 + self.pad = (self.parameters['kernel_size'] - 1) // 2 in_data.padding = {'pad_multi_frames': self.pad} out_data[0].padding = {'pad_multi_frames': self.pad} diff --git a/savu/plugins/filters/dezinger_deprecated.py b/savu/plugins/filters/dezinger_deprecated.py new file mode 100644 index 000000000..c14e8ded6 --- /dev/null +++ b/savu/plugins/filters/dezinger_deprecated.py @@ -0,0 +1,129 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# $Id: dezing_filter.py 467 2016-02-16 11:40:42Z kny48981 $ + + +""" +.. module:: dezinger + :platform: Unix + :synopsis: A plugin to remove zingers + +.. moduleauthor:: Mark Basham + +""" + +import numpy as np +import dezing + +from savu.plugins.filters.base_filter import BaseFilter +from savu.plugins.driver.cpu_plugin import CpuPlugin +from savu.plugins.utils import register_plugin + + +@register_plugin +class DezingerDeprecated(BaseFilter, CpuPlugin): + """ + A plugin for cleaning x-ray strikes based on statistical evaluation of \ + the near neighbourhood + :param outlier_mu: Threshold for defecting outliers, greater is less \ + sensitive. Default: 10.0. + :param kernel_size: Number of frames included in average. Default: 5. + :param mode: output mode, 0=normal 5=zinger strength 6=zinger \ + yes/no. Default: 0. + """ + + def __init__(self): + super(DezingerDeprecated, self).__init__("DezingerDeprecated") + self.warnflag = 0 + self.errflag = 0 + + def pre_process(self): + # Apply dezing to dark and flat images + inData = self.get_in_datasets()[0] + dark = inData.data.dark() + flat = inData.data.flat() + self.data_size = inData.get_shape() + + pad_list = ((self.pad, self.pad), (0, 0), (0, 0)) + + # dezing the dark field print "*****in data shape in base filter", in_dataset[0].get_shape() + + if dark.size: + (retval, self.warnflag, self.errflag) = dezing.setup_size( + dark.shape, self.parameters['outlier_mu'], self.pad, + mode=self.parameters['mode']) + dark = self._dezing(np.pad(dark, pad_list, mode='edge')) + inData.data.update_dark(dark[self.pad:-self.pad]) + (retval, self.warnflag, self.errflag) = dezing.cleanup() + + # dezing the flat field + if flat.size: + (retval, self.warnflag, self.errflag) = dezing.setup_size( + flat.shape, self.parameters['outlier_mu'], + self.pad, mode=self.parameters['mode']) + flat = self._dezing(np.pad(flat, pad_list, mode='edge')) + inData.data.update_flat(flat[self.pad:-self.pad]) + (retval, self.warnflag, self.errflag) = dezing.cleanup() + + # setup dezing for data + self._dezing_setup(self.data_size) + + def _dezing_setup(self, shape): + (retval, self.warnflag, self.errflag) = \ + dezing.setup_size(shape, self.parameters['outlier_mu'], + self.pad, mode=self.parameters['mode']) + + def _process_calibration_frames(self, data): + nSlices = data.shape[self.proj_dim] - 2*self.pad + nSublists = int(np.ceil(nSlices/float(self.frame_limit))) + idx = np.array_split(np.arange(self.pad, nSlices+self.pad), nSublists) + idx = [np.arange(a[0]-self.pad, a[-1]+self.pad+1) for a in idx] + out_sl = np.tile([slice(None)]*3, [len(idx), 1]) + out_sl[:, self.proj_dim] = idx + result = np.empty_like(data) + for sl in out_sl: + result[tuple(sl)] = self._dezing(data[tuple(sl)]) + return result + + def _dezing(self, data): + result = np.empty_like(data) + (retval, self.warnflag, self.errflag) = dezing.run(data, result) + return result + + def process_frames(self, data): + return self._dezing(data[0]) + + def post_process(self): + (retval, self.warnflag, self.errflag) = dezing.cleanup() + + def get_max_frames(self): + return 'multiple' + + def raw_data(self): + return True + + def set_filter_padding(self, in_data, out_data): + in_data = in_data[0] + self.pad = (self.parameters['kernel_size'] - 1) / 2 + in_data.padding = {'pad_multi_frames': self.pad} + out_data[0].padding = {'pad_multi_frames': self.pad} + + def executive_summary(self): + if self.errflag != 0: + return(["ERRORS detected in dezing plugin, Check the detailed \ +log messages."]) + if self.warnflag != 0: + return(["WARNINGS detected in dezing plugin, Check the detailed \ +log messages."]) + return ["Nothing to Report"] diff --git a/install/2_0_install/__init__.py b/savu/plugins/filters/dezingers/__init__.py similarity index 100% rename from install/2_0_install/__init__.py rename to savu/plugins/filters/dezingers/__init__.py diff --git a/savu/plugins/filters/dezingers/dezinger.py b/savu/plugins/filters/dezingers/dezinger.py new file mode 100644 index 000000000..4252bd2e0 --- /dev/null +++ b/savu/plugins/filters/dezingers/dezinger.py @@ -0,0 +1,87 @@ +# Copyright 2020 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: a dezinger filter (based on the median) from the Larix software + :platform: Unix + :synopsis: A 2D/3D median-based dezinger plugin to apply to any data +.. moduleauthor::Daniil Kazantsev +""" +from savu.plugins.plugin import Plugin +from savu.plugins.driver.cpu_plugin import CpuPlugin +from savu.plugins.utils import register_plugin + +import numpy as np +from larix.methods.misc import MEDIAN_DEZING + +@register_plugin +class Dezinger(Plugin, CpuPlugin): + """ + A plugin to apply 2D/3D median-based dezinger. The 3D capability is enabled\ + through padding. Note that the kernel_size in 2D will be kernel_size x kernel_size + and in 3D case kernel_size x kernel_size x kernel_size. + + :u*param kernel_size: Kernel size of the median filter. Default: 3. + :param outlier_mu: Threshold for detecting outliers, greater is less \ + sensitive. If very small, dezinger acts like a median filter. Default: 1.0. + :u*param dimension: dimensionality of the filter 2D/3D. Default: '3D'. + :u*param pattern: pattern to apply this to. Default: "PROJECTION". + + :config_warn: The dezinger plugin should be applied to normalised data \ + (e.g. AFTER DarkFlatFieldCorrection) + """ + + def __init__(self): + super(Dezinger, self).__init__("Dezinger") + + def setup(self): + in_dataset, out_dataset = self.get_datasets() + out_dataset[0].create_dataset(in_dataset[0]) + in_pData, out_pData = self.get_plugin_datasets() + in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + + def process_frames(self, data): + input_temp = np.float32(data[0]) + indices = np.where(np.isnan(input_temp)) + input_temp[indices] = 0.0 + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + input_temp =np.swapaxes(input_temp,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + input_temp =np.swapaxes(input_temp,0,1) + result = MEDIAN_DEZING(input_temp.copy(order='C'), self.parameters['kernel_size'], self.parameters['outlier_mu']) + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + result =np.swapaxes(result,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + result =np.swapaxes(result,0,1) + return result + + def set_filter_padding(self, in_data, out_data): + if (self.parameters['dimension'] == '3D'): + padding = (self.parameters['kernel_size']-1)/2 + else: + padding = 0 + in_data[0].padding = {'pad_multi_frames': padding} + out_data[0].padding = {'pad_multi_frames': padding} + + def nInput_datasets(self): + return 1 + + def nOutput_datasets(self): + return 1 + + def get_plugin_pattern(self): + return self.parameters['pattern'] diff --git a/savu/plugins/filters/dezingers/dezinger_gpu.py b/savu/plugins/filters/dezingers/dezinger_gpu.py new file mode 100644 index 000000000..43949662e --- /dev/null +++ b/savu/plugins/filters/dezingers/dezinger_gpu.py @@ -0,0 +1,90 @@ +# Copyright 2020 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: a GPU dezinger filter (based on the median) from the Larix software + :platform: Unix + :synopsis: A 2D/3D median-based GPU dezinger plugin to apply to any data +.. moduleauthor::Daniil Kazantsev +""" +from savu.plugins.plugin import Plugin +from savu.plugins.driver.gpu_plugin import GpuPlugin +from savu.plugins.utils import register_plugin + +import numpy as np +from larix.methods.misc_gpu import MEDIAN_DEZING_GPU + +@register_plugin +class DezingerGpu(Plugin, GpuPlugin): + """ + A plugin to apply 2D/3D median-based dezinger on GPU. The 3D capability is enabled\ + through padding. Note that the kernel_size in 2D will be kernel_size x kernel_size + and in 3D case kernel_size x kernel_size x kernel_size. + + :u*param kernel_size: Kernel size of the median filter. Default: 3. + :param outlier_mu: Threshold for detecting outliers, greater is less \ + sensitive. If very small, dezinger acts like a median filter. Default: 1.0. + :u*param dimension: dimensionality of the filter 2D/3D. Default: '3D'. + :u*param pattern: pattern to apply this to. Default: "PROJECTION". + + :config_warn: The dezinger plugin should be applied to normalised data \ + (e.g. AFTER DarkFlatFieldCorrection) + """ + + def __init__(self): + super(DezingerGpu, self).__init__("DezingerGpu") + self.GPU_index = None + self.res = False + self.start = 0 + + def setup(self): + in_dataset, out_dataset = self.get_datasets() + out_dataset[0].create_dataset(in_dataset[0]) + in_pData, out_pData = self.get_plugin_datasets() + in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') + + def process_frames(self, data): + input_temp = np.float32(data[0]) + indices = np.where(np.isnan(input_temp)) + input_temp[indices] = 0.0 + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + input_temp =np.swapaxes(input_temp,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + input_temp =np.swapaxes(input_temp,0,1) + result = MEDIAN_DEZING_GPU(input_temp.copy(order='C'), self.parameters['kernel_size'], self.parameters['outlier_mu']) + if (self.parameters['dimension'] == '3D'): + if (self.parameters['pattern'] == 'VOLUME_XY'): + result =np.swapaxes(result,0,2) + if ((self.parameters['pattern'] == 'VOLUME_XZ') or (self.parameters['pattern'] == 'SINOGRAM')): + result =np.swapaxes(result,0,1) + return result + + def set_filter_padding(self, in_data, out_data): + if (self.parameters['dimension'] == '3D'): + padding = (self.parameters['kernel_size']-1)/2 + else: + padding = 0 + in_data[0].padding = {'pad_multi_frames': padding} + out_data[0].padding = {'pad_multi_frames': padding} + + def nInput_datasets(self): + return 1 + + def nOutput_datasets(self): + return 1 + + def get_plugin_pattern(self): + return self.parameters['pattern'] diff --git a/savu/plugins/filters/dezinger_simple.py b/savu/plugins/filters/dezingers/dezinger_simple_deprecated.py similarity index 95% rename from savu/plugins/filters/dezinger_simple.py rename to savu/plugins/filters/dezingers/dezinger_simple_deprecated.py index 27a32facf..0861150e6 100644 --- a/savu/plugins/filters/dezinger_simple.py +++ b/savu/plugins/filters/dezingers/dezinger_simple_deprecated.py @@ -33,7 +33,7 @@ @register_plugin -class DezingerSimple(BaseFilter, CpuPlugin): +class DezingerSimpleDeprecated(BaseFilter, CpuPlugin): """ A plugin for cleaning x-ray strikes based on statistical evaluation of \ the near neighbourhood @@ -44,7 +44,7 @@ class DezingerSimple(BaseFilter, CpuPlugin): """ def __init__(self): - super(DezingerSimple, self).__init__("DezingerSimple") + super(DezingerSimpleDeprecated, self).__init__("DezingerSimpleDeprecated") self.zinger_proportion = 0.0 self.frame_limit = 8 @@ -108,7 +108,7 @@ def set_filter_padding(self, in_data, out_data): self.kernel_size = ksize+1 if ksize % 2 == 0 else ksize in_data = in_data[0] - self.pad = (self.kernel_size - 1) / 2 + self.pad = (self.kernel_size - 1) // 2 self.data_size = in_data.get_shape() in_data.padding = {'pad_multi_frames': self.pad} out_data[0].padding = {'pad_multi_frames': self.pad} diff --git a/savu/plugins/filters/dezinger_sinogram.py b/savu/plugins/filters/dezingers/dezinger_sinogram_deprecated.py similarity index 95% rename from savu/plugins/filters/dezinger_sinogram.py rename to savu/plugins/filters/dezingers/dezinger_sinogram_deprecated.py index 884580a3c..0d9e97eb9 100644 --- a/savu/plugins/filters/dezinger_sinogram.py +++ b/savu/plugins/filters/dezingers/dezinger_sinogram_deprecated.py @@ -27,7 +27,7 @@ @register_plugin -class DezingerSinogram(Plugin, CpuPlugin): +class DezingerSinogramDeprecated(Plugin, CpuPlugin): """ Method to remove scratches in the reconstructed image caused by zingers :u*param tolerance: Threshold for detecting zingers, greater is less \ @@ -36,7 +36,7 @@ class DezingerSinogram(Plugin, CpuPlugin): """ def __init__(self): - super(DezingerSinogram, self).__init__("DezingerSinogram") + super(DezingerSinogramDeprecated, self).__init__("DezingerSinogramDeprecated") def setup(self): in_dataset, out_dataset = self.get_datasets() diff --git a/savu/plugins/filters/fresnel_filter.py b/savu/plugins/filters/fresnel_filter.py index 6fe3f96e3..fe36bdae3 100644 --- a/savu/plugins/filters/fresnel_filter.py +++ b/savu/plugins/filters/fresnel_filter.py @@ -57,12 +57,12 @@ def make_window(self, height, width, ratio, pattern): center_hei = int(np.ceil((height - 1) * 0.5)) center_wid = int(np.ceil((width - 1) * 0.5)) if pattern == "PROJECTION": - ulist = (1.0 * np.arange(0, width) - center_wid) / width - vlist = (1.0 * np.arange(0, height) - center_hei) / height + ulist = (1.0 * np.arange(0, width) - center_wid) // width + vlist = (1.0 * np.arange(0, height) - center_hei) // height u, v = np.meshgrid(ulist, vlist) - win2d = 1.0 + ratio*(u**2+v**2) + win2d = 1.0 + ratio * (u**2 + v**2) else: - ulist = (1.0 * np.arange(0, width) - center_wid) / width + ulist = (1.0 * np.arange(0, width) - center_wid) // width win1d = 1.0 + ratio * ulist**2 win2d = np.tile(win1d, (height, 1)) return win2d @@ -72,42 +72,48 @@ def apply_filter(self, mat, window, pattern, pad_width): if pattern == "PROJECTION": top_drop = 10 # To remove the time stamp at some data mat_pad = np.pad(mat[top_drop:], ( - (pad_width+top_drop, pad_width), \ - (pad_width, pad_width)), mode = "edge") - win_pad = np.pad(window, pad_width, \ - mode = "edge") - mat_dec = fft.ifft2(fft.fft2(-np.log(mat_pad)) / fft.ifftshift(win_pad)) + (pad_width + top_drop, pad_width), + (pad_width, pad_width)), mode="edge") + win_pad = np.pad(window, pad_width, + mode="edge") + mat_dec = fft.ifft2( + fft.fft2(-np.log(mat_pad)) / fft.ifftshift(win_pad)) mat_dec = np.abs( - mat_dec[pad_width:pad_width+nrow,pad_width:pad_width+ncol]) + mat_dec[pad_width:pad_width + nrow, pad_width:pad_width + ncol]) else: mat_pad = np.pad( -np.log(mat), ((0, 0), (pad_width, pad_width)), mode='edge') - win_pad = np.pad(window, ((0, 0), (pad_width, pad_width)), \ - mode = "edge") + win_pad = np.pad(window, ((0, 0), (pad_width, pad_width)), + mode="edge") mat_fft = np.fft.fftshift(fft.fft(mat_pad), axes=1) / win_pad mat_dec = fft.ifft(np.fft.ifftshift(mat_fft, axes=1)) - mat_dec = np.abs(mat_dec[:, pad_width:pad_width+ncol]) + mat_dec = np.abs(mat_dec[:, pad_width:pad_width + ncol]) return np.float32(np.exp(-mat_dec)) def pre_process(self): inData = self.get_in_datasets()[0] self.data_size = inData.get_shape() - (depth1, height1, width1) = self.data_size + if len(self.data_size) == 4: + (depth1, height1, width1, _) = self.data_size + else: + (depth1, height1, width1) = self.data_size ratio = self.parameters['ratio'] if self.pattern == "PROJECTION": - self.window = self.make_window(height1, width1, ratio, self.pattern) + self.window = self.make_window( + height1, width1, ratio, self.pattern) else: self.window = self.make_window(depth1, width1, ratio, self.pattern) self.pad_width = 150 - def process_frames(self, data): - mat_filt = self.apply_filter(data[0], self.window, self.pattern, self.pad_width) + def process_frames(self, data): + mat_filt = self.apply_filter( + data[0], self.window, self.pattern, self.pad_width) return mat_filt - def get_citation_information(self): - cite_info = CitationInformation() - cite_info.description = \ - ("The filter built is based on the Fresnel propagator") - cite_info.bibtex = () - cite_info.doi = " " - return cite_info + # def get_citation_information(self): + # cite_info = CitationInformation() + # cite_info.description = \ + # ("The filter built is based on the Fresnel propagator") + # cite_info.bibtex = () + # cite_info.doi = " " + # return cite_info diff --git a/savu/plugins/filters/image_interpolation.py b/savu/plugins/filters/image_interpolation.py index 0ea42b654..518041a82 100644 --- a/savu/plugins/filters/image_interpolation.py +++ b/savu/plugins/filters/image_interpolation.py @@ -22,13 +22,25 @@ """ import logging import numpy as np -from scipy.misc import imresize +# TODO replace imresize with PIL Image +# from scipy.misc import imresize +from PIL import Image from savu.plugins.filters.base_filter import BaseFilter from savu.plugins.driver.cpu_plugin import CpuPlugin from savu.plugins.utils import register_plugin, dawn_compatible + +def imresize(data, size, interp, mode): + """ + Provides an imresize implementation, as it is removed from scipy 1.3.0 + Uses PIL.Image, following docs advice from + https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imresize.html + """ + return np.array(Image.fromarray(data, mode).resize(size, interp)) + + @register_plugin @dawn_compatible class ImageInterpolation(BaseFilter, CpuPlugin): @@ -58,7 +70,7 @@ def setup(self): inshape = in_dataset[0].get_shape() imshape = inshape[-2:] restshape = inshape[:-2] - outshape = imresize(np.ones(imshape),self.parameters['size'],self.parameters['interp'], None).shape + outshape = imresize(np.ones(imshape), self.parameters['size'], self.parameters['interp'], None).shape outshape = restshape + outshape out_dataset[0].create_dataset(patterns=in_dataset[0], axis_labels=in_dataset[0], diff --git a/savu/plugins/filters/list_to_projections.py b/savu/plugins/filters/list_to_projections.py index e3e19e5e1..3d2cea2b2 100644 --- a/savu/plugins/filters/list_to_projections.py +++ b/savu/plugins/filters/list_to_projections.py @@ -43,7 +43,7 @@ class ListToProjections(BaseFilter, CpuPlugin): def __init__(self): logging.debug("interpolating projections") super(ListToProjections, self).__init__("ListToProjections") - + def pre_process(self): # assume all the projections are on the same axes in_datasets, _out_datasets = self.get_datasets() @@ -54,7 +54,7 @@ def pre_process(self): elif in_positions.ndim==2: positions = in_positions# assume they are the same for all postiions self.setup_grids(positions) - + def process_frames(self, data): meshgridx, meshgridy = self.meshgrids data = data[0] @@ -65,16 +65,16 @@ def process_frames(self, data): elif isinstance(self.parameters['fill_value'],int): self.fill_value = float(self.parameters['fill_value']) else: - logging.warn("I don't recognise your fill type of:%s , using 0 instead" % self.parameters['fill_value']) + logging.warning("I don't recognise your fill type of:%s , using 0 instead" % self.parameters['fill_value']) self.fill_value = 0 - + return griddata((self.x, self.y),data, (meshgridx, meshgridy),fill_value=self.fill_value)[1:,1:] def setup(self): logging.debug('setting up the interpolation') in_dataset, out_datasets = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() - + inshape = in_dataset[0].get_shape() in_datasets, _out_datasets = self.get_datasets() @@ -91,33 +91,33 @@ def setup(self): if len(proj_in_core_dirs)>1: raise IndexError("This plugin won't work since there are more than 1 core direction for the projection") - + outshape = list(inshape) proj_in_core_dirs = proj_in_core_dirs[0] outshape[proj_in_core_dirs] = out_projection_shape[0] outshape.insert(proj_in_core_dirs+1,out_projection_shape[1]) - + axis_labels = in_datasets[0].get_axis_labels() - axis_labels = [ix.keys()[0]+'.'+ix[ix.keys()[0]] for ix in axis_labels] + axis_labels = [list(ix.keys())[0]+'.'+ix[list(ix.keys())[0]] for ix in axis_labels] axis_labels[proj_in_core_dirs] = 'x.microns' axis_labels.insert(proj_in_core_dirs+1,'y.microns') proj_out_core_dirs = (proj_in_core_dirs, proj_in_core_dirs+1) - allDimsOut = range(len(outshape)) + allDimsOut = list(range(len(outshape))) proj_out_slice_dirs = list(set(allDimsOut)-set(list(proj_out_core_dirs))) - + reshaped_projections = out_datasets[0] reshaped_projections.create_dataset(shape=tuple(outshape), axis_labels=axis_labels) reshaped_projections.add_pattern("PROJECTION", core_dims=proj_out_core_dirs, slice_dims=proj_out_slice_dirs) in_patterns = in_datasets[0].get_data_patterns() - for pattern in in_patterns.keys(): + for pattern in list(in_patterns.keys()): if pattern != "PROJECTION": core_dir = in_patterns[pattern]['core_dims'] slice_dir = list(set(allDimsOut)-set(core_dir)) dim_info = {'core_dims': core_dir, 'slice_dims': slice_dir} reshaped_projections.add_pattern(pattern, **dim_info) out_pData[0].plugin_data_setup('PROJECTION', self.get_max_frames()) -# +# def setup_grids(self,positions): #print positions.shape x = positions[0,:] @@ -128,26 +128,25 @@ def setup_grids(self,positions): self.step_size_x = self.parameters['step_size_x'] else: abs_diff_x = abs(np.diff(x)) - abs_diff_x_masked = abs_diff_x[abs_diff_x>0.1] + abs_diff_x_masked = abs_diff_x[abs_diff_x > 0.1] self.step_size_x = min(abs_diff_x_masked) - + if self.parameters['step_size_y'] is not None: self.step_size_y = self.parameters['step_size_y'] else: abs_diff_y = abs(np.diff(y)) - abs_diff_y_masked = abs_diff_y[abs_diff_y>0.1] + abs_diff_y_masked = abs_diff_y[abs_diff_y > 0.1] self.step_size_y = min(abs_diff_y_masked) - + min_x = np.min(x) max_x = np.max(x) min_y = np.min(y) max_y = np.max(y) - nptsx = ((max_x - min_x) / self.step_size_x) +1 - nptsy = ((max_y - min_y) / self.step_size_y) +1 - grid_x = np.arange(min_x, max_x, (max_x-min_x)/ (nptsx)) - grid_y = np.arange(min_y, max_y, (max_y-min_y)/ (nptsy)) - self.meshgrids = np.meshgrid(grid_x, grid_y) - + nptsx = ((max_x - min_x) / self.step_size_x) + 1 + nptsy = ((max_y - min_y) / self.step_size_y) + 1 + grid_x = np.arange(min_x, max_x, (max_x - min_x) / nptsx) + grid_y = np.arange(min_y, max_y, (max_y - min_y) / nptsy) + self.meshgrids = np.meshgrid(grid_x, grid_y) def get_max_frames(self): return 'single' diff --git a/savu/plugins/filters/poly_background_estimator.py b/savu/plugins/filters/poly_background_estimator.py index 895347009..e2248f4f3 100644 --- a/savu/plugins/filters/poly_background_estimator.py +++ b/savu/plugins/filters/poly_background_estimator.py @@ -70,7 +70,7 @@ def setup(self): in_meta = self.get_in_meta_data()[0] # get the axis alabel = \ - in_dataset[0].data_info.get('axis_labels')[-1].keys()[0] + list(in_dataset[0].data_info.get('axis_labels')[-1].keys())[0] self.axis = in_meta.get(alabel) def get_max_frames(self): diff --git a/savu/plugins/filters/pymca.py b/savu/plugins/filters/pymca.py index 1c628f567..8185ba3b1 100644 --- a/savu/plugins/filters/pymca.py +++ b/savu/plugins/filters/pymca.py @@ -41,9 +41,9 @@ class Pymca(BaseFilter, CpuPlugin): """ def __init__(self): - logging.debug("fitting spectrum") + logging.debug("fitting spectrum") super(Pymca, self).__init__("Pymca") - + def pre_process(self): in_dataset, _out_datasets = self.get_datasets() in_d1 = in_dataset[0] @@ -59,7 +59,7 @@ def process_frames(self, data): op_stack = np.rollaxis(stack,0,3) except (AttributeError, KeyError) as e: op_stack = -np.ones((1,1,self.outputshape[-1])) - logging.warn("Error in fit:%s",e) + logging.warning("Error in fit:%s",e) op = op_stack[0,0] return op @@ -72,22 +72,22 @@ def setup(self): np.random.seed=1 dummy_spectrum = np.random.random((1, 1, spectra_shape)) c = self.setup_fit(dummy_spectrum)# seed it with junk, zeros made the matrix singular unsurprisingly and this bungles it. - + # temporary measure to stop the next line printing arrays to screen. c.processList()#_McaAdvancedFitBatch__processStack()# perform an initial fit to get the shapes fit_labels = c.outbuffer.labels('parameters') # and then take out the axis labels for the channels out_meta_data = out_datasets[0].meta_data out_meta_data.set("PeakElements",fit_labels) - + self.outputshape = rest_shape+(len(fit_labels),) # and this is the shape the thing will be # print "input shape is", in_dataset[0].get_shape() # print "the output shape in setup is"+str(outputshape) - + axis_labels = ['-1.PeakElements.label'] in_patterns = in_dataset[0].get_data_patterns() # pattern_list = ['SINOGRAM', 'PROJECTION'] - pattern_list = in_patterns.keys() + pattern_list = list(in_patterns.keys()) fitResult = out_datasets[0] @@ -99,12 +99,12 @@ def setup(self): # print "slice directions are:"+str(slice_directions) fitResult.add_pattern("CHANNEL", core_dims=(-1,), slice_dims=slice_directions) - + in_pData, out_pData = self.get_plugin_datasets() in_pData[0].plugin_data_setup(self.get_plugin_pattern(), self.get_max_frames()) out_pData[0].plugin_data_setup('CHANNEL', self.get_max_frames()) - - + + def get_max_frames(self): return 'single' @@ -117,7 +117,7 @@ def nOutput_datasets(self): def setup_fit(self,y): ''' takes a data shape and returns a fit-primed object - ''' + ''' outputdir=None # nope roifit=0# nope roiwidth=y.shape[1] #need this to pretend its an image @@ -130,18 +130,18 @@ def setup_fit(self,y): nosave=True, quiet=True) # prime the beauty b.pleaseBreak = 1 - + # temporary measure to stop the next line printing arrays to screen. b.processList() b.pleaseBreak = 0 return b - + def get_conf_path(self): path = self.parameters['config'] if path.split(os.sep)[0] == 'Savu': path = tu.get_test_data_path(path.split('/test_data/data')[1]) return path - + def get_dummyhdf_path(self): return tu.get_test_data_path('i18_test_data.nxs') diff --git a/savu/plugins/filters/strip_background.py b/savu/plugins/filters/strip_background.py index 3a5fd674b..c8abedd62 100644 --- a/savu/plugins/filters/strip_background.py +++ b/savu/plugins/filters/strip_background.py @@ -73,9 +73,9 @@ def process_frames(self, data): topedgerest = (x >= (npts-2*w)) & (x >= (npts-w)) for k in range(its): - aved[mainpart] = (filtered[mainpartbottom] + filtered[mainpart] + filtered[mainparttop])/3. # works - aved[bottomedgemain] = (filtered[bottomedgemain] + filtered[bottomedgerest])/2. - aved[topedgemain] = (filtered[topedgemain] + filtered[topedgerest])/2. + aved[mainpart] = (filtered[mainpartbottom] + filtered[mainpart] + filtered[mainparttop]) / 3.0 + aved[bottomedgemain] = (filtered[bottomedgemain] + filtered[bottomedgerest]) / 2.0 + aved[topedgemain] = (filtered[topedgemain] + filtered[topedgerest]) / 2.0 filtered[aved - -""" - diff --git a/savu/plugins/kinematics/stage_motion.py b/savu/plugins/kinematics/stage_motion.py index 1ecd0e50f..a28e8d04e 100644 --- a/savu/plugins/kinematics/stage_motion.py +++ b/savu/plugins/kinematics/stage_motion.py @@ -27,9 +27,12 @@ import time import logging +from typing import Union + from savu.plugins.plugin import Plugin from savu.plugins.utils import register_plugin from savu.plugins.driver.cpu_plugin import CpuPlugin +from savu.core.utils import ensure_string from pmacparser.pmac_parser import PMACParser @@ -61,7 +64,7 @@ def __init__(self): self.pvals = None self.num_datasets = self.NUM_DATASETS self.use_min_max = False - + def _check_parameters(self): use_min_max = self.parameters['use_min_max'] logging.debug("Config use min max: " + str(use_min_max)) @@ -93,20 +96,18 @@ def pre_process(self): self.out_pshape = out_pdata.get_shape() # Get the kinematic program to run and the static variables - program_from_data = \ - self.get_in_meta_data()[0].get_dictionary()['program'] - variables_from_data = \ - self.get_in_meta_data()[0].get_dictionary()['variables'] + program_from_data = self.get_in_meta_data()[0].get_dictionary()['program'] + variables_from_data = self.get_in_meta_data()[0].get_dictionary()['variables'] # Create the list of code lines from the kinematic program input code_lines = [] - for i in range(len(program_from_data)): - code_lines.append(str(program_from_data[i])) + for line in program_from_data: + code_lines.append(ensure_string(line)) # Set the static variables from the meta input for i in range(len(variables_from_data)): - self.variables[variables_from_data['Name'][i]] = \ - variables_from_data['Value'][i] + name = ensure_string(variables_from_data['Name'][i]) + self.variables[name] = variables_from_data['Value'][i] # Create the PMACParser instance self.parser = PMACParser(code_lines) @@ -161,7 +162,7 @@ def process_frames(self, data): for i in range(1, self.NUM_OUTPUT_Q_VARS + 1): if 'Q' + str(i) in parse_result: q_result = parse_result['Q' + str(i)] - + if not hasattr(q_result, 'size'): size = 1 else: @@ -270,5 +271,5 @@ def nInput_datasets(self): def nOutput_datasets(self): if self.use_min_max: self.parameters['out_datasets'].extend( - self.parameters['extra_out_datasets']) + self.parameters['extra_out_datasets']) return self.num_datasets diff --git a/savu/plugins/loaders/base_loader.py b/savu/plugins/loaders/base_loader.py index eab84f786..d1386ac80 100644 --- a/savu/plugins/loaders/base_loader.py +++ b/savu/plugins/loaders/base_loader.py @@ -58,7 +58,7 @@ def set_data_reduction_params(self, data_obj): self.data_mapping() data_obj.get_preview().set_preview(pDict['preview'], load=True) # update axis labels - #data_obj.amend_axis_label_values() + #data_obj.amend_axis_label_values() # set previewing for Related datasets #for data in data_obj.related.values(): # find common axes @@ -75,24 +75,24 @@ def get_NXapp(self, ltype, nx_file, entry): return self.hits def _visit_NXapp(self, name, obj): - if "NX_class" in obj.attrs.keys(): - if obj.attrs["NX_class"] in ["NXentry", "NXsubentry"]: - if "definition" in obj.keys(): - if obj["definition"].value == self.application: + if "NX_class" in list(obj.attrs.keys()): + if obj.attrs["NX_class"].decode("ascii") in ["NXentry", "NXsubentry"]: + if "definition" in list(obj.keys()): + if obj["definition"][()].decode("ascii") == self.application: self.hits.append(obj) def get_NXdata(self, nx_file, detector_list): nx_file['/'].visititems(self._visit_NXdata) for detector in detector_list: for nxdata in self.nxdata: - if detector in nxdata.keys() or detector in \ + if detector in list(nxdata.keys()) or detector in \ str(nxdata.name).split('/'): self.hits.append(nxdata) return self.hits def _visit_NXdata(self, name, obj): - if "NX_class" in obj.attrs.keys(): - if obj.attrs["NX_class"] in ["NXdata"]: + if "NX_class" in list(obj.attrs.keys()): + if obj.attrs["NX_class"].decode("ascii") in ["NXdata"]: self.hits.append(obj) def data_mapping(self): diff --git a/savu/plugins/loaders/full_field_loaders/image_loader.py b/savu/plugins/loaders/full_field_loaders/image_loader.py index 6f2c789c0..0859180be 100644 --- a/savu/plugins/loaders/full_field_loaders/image_loader.py +++ b/savu/plugins/loaders/full_field_loaders/image_loader.py @@ -23,15 +23,17 @@ """ import os -import h5py import tempfile +import warnings + +import h5py import numpy as np from savu.data.data_structures.data_types.data_plus_darks_and_flats \ import NoImageKey +from savu.data.data_structures.data_types.image_data import ImageData from savu.plugins.loaders.base_loader import BaseLoader from savu.plugins.utils import register_plugin -from savu.data.data_structures.data_types.image_data import ImageData @register_plugin @@ -94,14 +96,14 @@ def _set_darks_and_flats(self, dObj, path): # read dark and flat images fpath, ffix = self._get_path(self.parameters['flat_prefix'], path) flat = ImageData(fpath, dObj, [fdim], None, ffix) - + if self.parameters['dark_prefix']: dpath, dfix = self._get_path(self.parameters['dark_prefix'], path) dark = ImageData(dpath, dObj, [fdim], None, dfix) else: shape = dObj.get_shape() dark = np.zeros([1] + [shape[i] for i in [1, 2]], dtype=flat.dtype) - + dObj.data._set_dark_path(dark) dObj.data._set_flat_path(flat) dObj.data._set_dark_and_flat() @@ -124,11 +126,12 @@ def set_rotation_angles(self, data_obj): else: try: exec("angles = " + angles) - except: + except Exception as e: + warnings.warn("Could not execute statement: {}".format(e)) try: angles = np.loadtxt(angles) - except: - raise Exception('Cannot set angles in loader.') + except Exception as e: + raise Exception('Cannot set angles in loader. Error: {}'.format(e)) n_angles = len(angles) data_angles = data_obj.data.get_shape()[self.parameters['frame_dim']] diff --git a/savu/plugins/loaders/full_field_loaders/lfov_loader.py b/savu/plugins/loaders/full_field_loaders/lfov_loader.py new file mode 100644 index 000000000..318d1ea15 --- /dev/null +++ b/savu/plugins/loaders/full_field_loaders/lfov_loader.py @@ -0,0 +1,144 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: Large field of view loader + :platform: Unix + :synopsis: A class for loading multiple standard tomography scans. + +.. moduleauthor:: Nicola Wadeson + +""" + +import copy +import numpy as np +import glob + +from savu.plugins.utils import register_plugin +from savu.plugins.loaders.full_field_loaders.multi_nxtomo_loader import \ + MultiNxtomoLoader + + +@register_plugin +class LfovLoader(MultiNxtomoLoader): + """ + A class to load 2 scans in Nexus/hdf format into one dataset. + + :u*param file_name: The shared part of the name of each file\ + (not including .nxs). Default: 'projection'. + :param data_path: Path to the data inside the \ + file. Default: 'entry/data/data'. + :param order: Order of datasets used for stitching. Default: [1, 0]. + :param row_offset: Offsets of row indices between datasets. Default: [0, -1]. + + :*param stack_or_cat: Stack or concatenate the data\ + (4D and 3D respectively). Default: 'stack'. + :*param stack_or_cat_dim: Dimension to stack or concatenate. Default: 3. + :*param axis_label: New axis label, if required, in the form\ + 'name.units'. Default: 'scan.number'. + """ + + def __init__(self, name='LfovLoader'): + super(LfovLoader, self).__init__(name) + + def _update_preview(self, preview, offset): + """ + Add extra sinograms to the preview if there are not enough to stitch + at least one frame after taking into account the offset between images. + + Parameters + ---------- + preview : list + A Savu preview data list. + + Returns + ------- + None. + + """ + if not offset or not preview: + return preview + dObj = self.exp.index['in_data']['tomo'] + + # Revert the data shape to before previewing was applied + dObj.set_shape(dObj.get_original_shape()) + preview = dObj.get_preview().get_integer_entries(preview) + sino_slice_dim = dObj.get_data_dimension_by_axis_label("detector_y") + max_sino_idx = dObj.data.shape[sino_slice_dim] + sl = list(map(int, preview[sino_slice_dim].split(":"))) + sl_0 = sl[0] + offset + sl_1 = sl[1] + offset + if (max_sino_idx >= sl_0 >= 0) and (max_sino_idx >= sl_1 >= 0): + sl[0] = sl_0 + sl[1] = sl_1 + preview[sino_slice_dim] = ":".join(map(str, sl)) + self.parameters['preview'][sino_slice_dim] = preview[sino_slice_dim] + return preview + + def _get_order_list(self): + order = self.parameters['order'] + if order[0] < order[-1]: + order_list = np.arange(order[0], order[1] + 1) + else: + order_list = np.arange(order[0], order[1] - 1, -1) + return order_list + + def _get_file_list(self, order_list): + shared_name = self.parameters["file_name"] + file_path = copy.copy(self.exp.meta_data.get('data_file')) + self.exp.meta_data.set('data_file', file_path) + + if shared_name is None: + file_list = self._find_files(file_path, "/*.hdf") + if len(file_list) == 0: + file_list = self._find_files(file_path, "/*.nxs") + else: + file_list = self._find_files(file_path, "/*" + shared_name + "*") + + if len(order_list) != len(file_list): + raise ValueError( + "Number of files found in the folder is not the same as the" + +" requested number") + return file_list + + def _find_files(self, base, name): + return sorted(glob.glob(base + name)) if base else [] + + def _get_data_objects(self, nxtomo): + order_list = self._get_order_list() + file_list = self._get_file_list(order_list) + dark_folder, dark_key, dark_scale = self.parameters['dark'] + flat_folder, flat_key, flat_scale = self.parameters['flat'] + dark_list = self._find_files(dark_folder, "/*dark*") + flat_list = self._find_files(flat_folder, "/*flat*") + offset = self.parameters['row_offset'] + + data_obj_list = [] + for i in order_list: + self.exp.meta_data.set('data_file', file_list[i]) + # update darks and flats + if dark_folder is not None: + nxtomo.parameters['dark'] = [ + dark_list[i], dark_key, dark_scale] + if flat_folder is not None: + nxtomo.parameters['flat'] = [ + flat_list[i], flat_key, flat_scale] + nxtomo.setup() + # update preview + if offset[i] != 0: + nxtomo.parameters['preview'] = \ + self._update_preview(nxtomo.parameters['preview'], offset[i]) + data_obj_list.append(self.exp.index['in_data']['tomo']) + self.exp.index['in_data'] = {} + return data_obj_list diff --git a/savu/plugins/loaders/full_field_loaders/mrc_loader.py b/savu/plugins/loaders/full_field_loaders/mrc_loader.py index 2a34fbb44..fb15056fa 100644 --- a/savu/plugins/loaders/full_field_loaders/mrc_loader.py +++ b/savu/plugins/loaders/full_field_loaders/mrc_loader.py @@ -88,7 +88,7 @@ def _set_rotation_angles(self, data_obj): angles = np.linspace(0, 180, data_obj.data.get_shape()[0]) else: try: - exec("angles = " + angles) + angles = eval(angles) except: try: angles = np.loadtxt(angles) diff --git a/savu/plugins/loaders/full_field_loaders/multi_nxtomo_loader.py b/savu/plugins/loaders/full_field_loaders/multi_nxtomo_loader.py index 6af7a06dc..e13d8b4ea 100644 --- a/savu/plugins/loaders/full_field_loaders/multi_nxtomo_loader.py +++ b/savu/plugins/loaders/full_field_loaders/multi_nxtomo_loader.py @@ -42,12 +42,18 @@ class MultiNxtomoLoader(BaseLoader): (not including .nxs). Default: None. :param data_path: Path to the data inside the \ file. Default: 'entry1/tomo_entry/data/data'. + :param dark: Optional path to the dark field data file, nxs path and \ + scale value. Default: [None, None, 1]. + :param flat: Optional Path to the flat field data file, nxs path and \ + scale value. Default: [None, None, 1]. :param stack_or_cat: Stack or concatenate the data\ (4D and 3D respectively). Default: 'stack'. :param stack_or_cat_dim: Dimension to stack or concatenate. Default: 3. :param axis_label: New axis label, if required, in the form\ 'name.units'. Default: 'scan.number'. :param range: The start and end of file numbers. Default: [0, 10]. + :param angles: A python statement to be evaluated or a file. Default: None. + """ def __init__(self, name='MultiNxtomoLoader'): @@ -76,22 +82,28 @@ def setup(self): self._extend_axis_label_values(data_obj_list, data_obj) else: self._setup_4d(data_obj) - # may want to add this as a parameter... - self._set_nD_rotation_angle(data_obj_list, data_obj) - #print "setting the final data shape", data_obj.data.get_shape() data_obj.set_original_shape(data_obj.data.get_shape()) self.set_data_reduction_params(data_obj) - + # Must do this here after preview has been applied + if stack_or_cat == 'stack': + self._set_nD_rotation_angle(data_obj_list, data_obj) + def _get_nxtomo(self): nxtomo = NxtomoLoader() nxtomo.exp = self.exp nxtomo._populate_default_parameters() - return nxtomo + + # update nxtomo parameters with any common keys + shared_keys = set(nxtomo.parameters.keys()).intersection( + set(self.parameters.keys())) + for key in shared_keys: + nxtomo.parameters[key] = self.parameters[key] + return nxtomo def _get_data_objects(self, nxtomo): rrange = self.parameters['range'] - file_list = range(rrange[0], rrange[1]+1) + file_list = list(range(rrange[0], rrange[1]+1)) file_path = copy.copy(self.exp.meta_data.get('data_file')) file_name = '' if self.parameters['file_name'] is None else\ self.parameters['file_name'] @@ -126,9 +138,14 @@ def _setup_4d(self, data_obj): data_obj.add_pattern('SINOGRAM', core_dims=(detX, rot), slice_dims=(detY, extra)) + data_obj.add_pattern('PROJECTION_STACK', core_dims=(detX, detY), + slice_dims=(extra, rot)) + data_obj.add_pattern('SINOGRAM_STACK', core_dims=(detX, rot), + slice_dims=(extra, detY)) + def _extend_axis_label_values(self, data_obj_list, data_obj): dim = self.parameters['stack_or_cat_dim'] - axis_name = data_obj.get_axis_labels()[dim].keys()[0].split('.')[0] + axis_name = list(data_obj.get_axis_labels()[dim].keys())[0].split('.')[0] new_values = np.zeros(data_obj.data.get_shape()[dim]) inc = len(data_obj_list[0].meta_data.get(axis_name)) @@ -140,7 +157,8 @@ def _extend_axis_label_values(self, data_obj_list, data_obj): data_obj.meta_data.set(axis_name, new_values) def _set_nD_rotation_angle(self, data_obj_list, data_obj): - rot_dim_len = data_obj.data.get_shape()[ + shape = data_obj.get_shape() + rot_dim_len = data_obj.get_shape()[ data_obj.get_data_dimension_by_axis_label('rotation_angle')] new_values = np.zeros([rot_dim_len, len(data_obj_list)]) for i in range(len(data_obj_list)): diff --git a/savu/plugins/loaders/full_field_loaders/nxtomo_loader.py b/savu/plugins/loaders/full_field_loaders/nxtomo_loader.py index 8e3d87437..8a028fa70 100644 --- a/savu/plugins/loaders/full_field_loaders/nxtomo_loader.py +++ b/savu/plugins/loaders/full_field_loaders/nxtomo_loader.py @@ -59,7 +59,7 @@ def __init__(self, name='NxtomoLoader'): self.warnings = [] def log_warning(self, msg): - logging.warn(msg) + logging.warning(msg) self.warnings.append(msg) def setup(self): @@ -78,7 +78,7 @@ def setup(self): self.__setup_4d(data_obj) self.__setup_3d_to_4d(data_obj, self.nFrames) else: - if len(data_obj.data.shape) is 3: + if len(data_obj.data.shape) == 3: self._setup_3d(data_obj) else: self.__setup_4d(data_obj) @@ -89,7 +89,7 @@ def setup(self): control = self._get_h5_path( data_obj.backing_file, 'entry1/tomo_entry/control/data') data_obj.meta_data.set("control", control[...]) - except: + except Exception: self.log_warning("No Control information available") nAngles = len(data_obj.meta_data.get('rotation_angle')) @@ -110,9 +110,9 @@ def __get_nFrames(self, dObj): if self.parameters['3d_to_4d'] is True: try: # for backwards compatibility - exec("n_frames = " + self.parameters['angles']) + n_frames = eval(self.parameters["angles"], {"builtins": None, "np": np}) return np.array(n_frames).shape[0] - except: + except Exception: raise Exception("Please specify the angles, or the number of " "frames per scan (via 3d_to_4d param) in the loader.") if isinstance(self.parameters['3d_to_4d'], int): @@ -182,7 +182,7 @@ def __find_dark_and_flat(self, data_obj, flat=None, dark=None): self.parameters['ignore_flats'] else None try: image_key = data_obj.backing_file[ - 'entry1/tomo_entry/instrument/detector/image_key'][...] + self.parameters['image_key_path']][...] data_obj.data = \ ImageKey(data_obj, image_key, 0, ignore=ignore) except KeyError: @@ -234,12 +234,12 @@ def _set_rotation_angles(self, data_obj): angles = 'entry1/tomo_entry/data/rotation_angle' nxs_angles = self.__get_angles_from_nxs_file(data_obj, angles) - + if nxs_angles is None: try: - exec("angles = " + angles) + angles = eval(angles) except Exception as e: - logging.warn(e.message) + logging.warning(e.message) try: angles = np.loadtxt(angles) except Exception as e: @@ -268,7 +268,7 @@ def _get_data_file(self): def __check_angles(self, data_obj, n_angles): data_angles = data_obj.data.get_shape()[0] if data_angles != n_angles: - # FIXME problem with this + # FIXME problem with this if self.nFrames > 1: rot_angles = data_obj.meta_data.get("rotation_angle") try: diff --git a/savu/plugins/loaders/hdf5_template_loader.py b/savu/plugins/loaders/hdf5_template_loader.py index accb84317..c17c05a5c 100644 --- a/savu/plugins/loaders/hdf5_template_loader.py +++ b/savu/plugins/loaders/hdf5_template_loader.py @@ -48,13 +48,13 @@ def __init__(self, name='Hdf5TemplateLoader'): super(Hdf5TemplateLoader, self).__init__(name) def set_data(self, dObj, data): - path = data['path'] if 'path' in data.keys() else None + path = data['path'] if 'path' in list(data.keys()) else None if not path: emsg = 'Please specify the path to the data in the h5 file.' raise Exception(emsg) file_path = self.exp.meta_data.get("data_file") if 'file' not in \ - data.keys() else data['file'] + list(data.keys()) else data['file'] file_path = self.update_value(dObj, file_path) dObj.backing_file = h5py.File(file_path, 'r') @@ -65,12 +65,12 @@ def set_data(self, dObj, data): def _stitch_data(self, dObj, path, data): stype, dim = self._get_stitching_info(data) - remove = data['remove'] if 'remove' in data.keys() else None + remove = data['remove'] if 'remove' in list(data.keys()) else None group_name, data_name = os.path.split(path) # find all files with the given name group = dObj.backing_file.require_group(group_name) - matches = fnmatch.filter(group.keys(), data_name) + matches = fnmatch.filter(list(group.keys()), data_name) number = [] for m in matches: @@ -101,9 +101,9 @@ def _stitch_data(self, dObj, path, data): return dObj def _get_stitching_info(self, data): - if 'stack' in data.keys(): + if 'stack' in list(data.keys()): return 'stack', data['stack'] - elif 'cat' in data.keys(): + elif 'cat' in list(data.keys()): return 'cat', data['cat'] else: msg = 'Please specify the dimension to stack or concatenate.' diff --git a/savu/plugins/loaders/image_template_loader.py b/savu/plugins/loaders/image_template_loader.py index 013e59040..08d2c72e7 100644 --- a/savu/plugins/loaders/image_template_loader.py +++ b/savu/plugins/loaders/image_template_loader.py @@ -43,8 +43,8 @@ def __init__(self, name='ImageTemplateLoader'): super(ImageTemplateLoader, self).__init__(name) def set_data(self, dObj, data): - folder = data['folder'] if 'folder' in data.keys() else None - shape = data['shape'] if 'shape' in data.keys() else None + folder = data['folder'] if 'folder' in list(data.keys()) else None + shape = data['shape'] if 'shape' in list(data.keys()) else None if not folder: raise Exception('Please specify the path to the folder of images.') @@ -55,6 +55,6 @@ def set_data(self, dObj, data): file_path = self.exp.meta_data.get("data_file") dObj.backing_file = h5py.File(file_path, 'r') shape = tuple(self.update_value(dObj, shape)) - dObj.data = ImageData(folder, dObj, range(len(shape)), shape=shape) + dObj.data = ImageData(folder, dObj, list(range(len(shape))), shape=shape) dObj.set_shape(dObj.data.get_shape()) return dObj diff --git a/savu/plugins/loaders/mapping_loaders/base_multi_modal_loader.py b/savu/plugins/loaders/mapping_loaders/base_multi_modal_loader.py index 781b4cb67..64fa71936 100644 --- a/savu/plugins/loaders/mapping_loaders/base_multi_modal_loader.py +++ b/savu/plugins/loaders/mapping_loaders/base_multi_modal_loader.py @@ -63,30 +63,30 @@ def _check_for_monitor_data(self, data_obj, entry): self.exp.meta_data.set('control', control) logging.debug('adding the ion chamber to the meta data') else: - logging.warn('No ion chamber information. Leaving this blank') + logging.warning('No ion chamber information. Leaving this blank') def set_motors(self, data_obj, entry, ltype): - labels = list(entry['data'].attrs['axes']) + labels = [e.decode("ascii") for e in entry['data'].attrs['axes']] motors = [entry['data/' + e] for e in labels] units = self._get_attrs(motors, 'units', 'unit') self._mtype = self._get_attrs(motors, 'transformation_type', 'None') self._set_axis_labels(data_obj, motors, labels, units) def _get_attrs(self, entries, key, default): - return [e.attrs[key] if key in e.attrs.keys() else + return [e.attrs[key].decode("ascii") if key in list(e.attrs.keys()) else default for e in entries] def _set_axis_labels(self, dObj, motors, labels, units): trans = self.get_motor_dims('translation') rot_dim = self._mtype.index('rotation') - angles = motors[rot_dim].value + angles = motors[rot_dim][()] labels[rot_dim] = 'rotation_angle' self._set_meta_data(dObj, 'rotation_angle', angles) if trans: - self._set_meta_data(dObj, 'x', motors[trans[-1]].value) + self._set_meta_data(dObj, 'x', motors[trans[-1]][()]) labels[trans[-1]] = 'x' if len(trans) > 1: - self._set_meta_data(dObj, 'y', motors[trans[-2]].value) + self._set_meta_data(dObj, 'y', motors[trans[-2]][()]) labels[trans[-2]] = 'y' labels = [labels[i] + '.' + units[i] for i in range(len(labels))] dObj.set_axis_labels(*tuple(labels)) @@ -99,7 +99,7 @@ def get_motor_dims(self, key): return [i for i in range(len(self._mtype)) if self._mtype[i] == key] def add_patterns_based_on_acquisition(self, data_obj, ltype): - dims = range(len(self._mtype)) + dims = list(range(len(self._mtype))) proj_dims = tuple(self.get_motor_dims('translation')) if proj_dims: diff --git a/savu/plugins/loaders/mapping_loaders/i08_loaders/i08_fluo_loader.py b/savu/plugins/loaders/mapping_loaders/i08_loaders/i08_fluo_loader.py index c60edbc1d..6d1c5b3c1 100644 --- a/savu/plugins/loaders/mapping_loaders/i08_loaders/i08_fluo_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i08_loaders/i08_fluo_loader.py @@ -83,7 +83,7 @@ def setup(self): # print "the labels are:"+str(labels) data_obj.set_axis_labels(*tuple(scan_axis)) - dims = range(len(data_obj.get_shape())) + dims = list(range(len(data_obj.get_shape()))) spec_core = (-1,) # it will always be this # print spec_core diff --git a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_fluo_loader.py b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_fluo_loader.py index 23c2770eb..dacdb009b 100644 --- a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_fluo_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_fluo_loader.py @@ -38,7 +38,7 @@ class I13FluoLoader(BaseLoader): :param theta_step: The theta step. Default:1.0. :param theta_start: The theta start. Default: -90.0. :param theta_end: The theta end. Default: 90.0. - :param mono_energy: The mono energy. Default: 11.8. + :param mono_energy: The mono energy. Default: 11.8. """ def __init__(self, name='I13FluoLoader'): @@ -71,13 +71,13 @@ def setup(self): labels.append('rotation_angle.degrees') data_obj.meta_data.set('rotation_angle', rotation_angle) x = \ - data_obj.backing_file['entry1/instrument/lab_sxy/lab_sx'].value + data_obj.backing_file['entry1/instrument/lab_sxy/lab_sx'][()] data_obj.meta_data.set('x', x) # axis label - + ### set the y y = \ - data_obj.backing_file['entry1/instrument/lab_sxy/lab_sy'].value + data_obj.backing_file['entry1/instrument/lab_sxy/lab_sy'][()] pos = np.zeros((2,len(y[0]))) pos[0,:] = x[0] pos[1,:] = y[0] @@ -91,11 +91,11 @@ def setup(self): # print "the labels are:"+str(labels) data_obj.set_axis_labels(*tuple(labels)) - - dims = range(len(data_obj.get_shape())) + + dims = list(range(len(data_obj.get_shape()))) spec_core = (-1,) # it will always be this # print spec_core - + spec_slice = tuple(dims[:-1]) # print spec_slice logging.debug("is a spectrum") @@ -106,9 +106,9 @@ def setup(self): logging.debug("the spectrum slices are:"+str(spec_slice)) data_obj.add_pattern("SPECTRUM_STACK", core_dims=spec_core[:-1], slice_dims=(-2,)+spec_slice) - - - + + + positions_label = (data_obj.get_data_dimension_by_axis_label('xy', contains=True),) rotation_label = (data_obj.get_data_dimension_by_axis_label('rotation_angle', contains=True),) @@ -116,10 +116,10 @@ def setup(self): sino_cores = rotation_label + positions_label data_obj.add_pattern("SINOGRAM", core_dims=sino_cores, slice_dims = tuple(set(dims)-set(sino_cores))) - + data_obj.add_pattern("4D_SCAN", core_dims=tuple(set(dims)-set(rotation_label)), slice_dims=rotation_label) - + # data_obj.add_pattern("SINOGRAM", core_dir=(0,1), # slice_dir=(2,3)) # data_obj.add_pattern("PROJECTION", core_dir=(0,3), diff --git a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_ptycho_loader.py b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_ptycho_loader.py index 081da3232..88476fef6 100644 --- a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_ptycho_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_ptycho_loader.py @@ -59,15 +59,15 @@ def setup(self): # print data_obj.data.shape data_obj.set_shape(data_obj.data.shape) try: - control = data_obj.backing_file['/entry1/instrument/ionc_i/ionc_i'].value + control = data_obj.backing_file['/entry1/instrument/ionc_i/ionc_i'][()] # this is global since it is to do with the beam exp.meta_data.set("control", control) logging.debug('adding the ion chamber to the meta data') except: - logging.warn('No ion chamber information. Leaving this blank') - + logging.warning('No ion chamber information. Leaving this blank') + self.exp.meta_data.set("mono_energy", self.parameters['mono_energy']) - + labels = [] ### set the rotation rotation_angle = None @@ -77,20 +77,20 @@ def setup(self): data_obj.meta_data.set('rotation_angle', rotation_angle) # try: -# rotation_angle = data_obj.backing_file['entry1/instrument/t1_theta/t1_theta'].value +# rotation_angle = data_obj.backing_file['entry1/instrument/t1_theta/t1_theta'][()] # if rotation_angle.ndim > 1: # rotation_angle = rotation_angle[:, 0] # # axis label # labels.append('rotation_angle.degrees') -# +# # data_obj.meta_data.set('rotation_angle', rotation_angle) # except KeyError: # logging.debug("Not a tomography!") ### GET THE AXES ### - x = data_obj.backing_file['entry1/instrument/lab_sxy/lab_sx'].value*1e-6 + x = data_obj.backing_file['entry1/instrument/lab_sxy/lab_sx'][()]*1e-6 data_obj.meta_data.set('x', x) - y = data_obj.backing_file['entry1/instrument/lab_sxy/lab_sy'].value*1e-6 + y = data_obj.backing_file['entry1/instrument/lab_sxy/lab_sy'][()]*1e-6 data_obj.meta_data.set('y', y) if rotation_angle is not None and len(x.shape)>1: pos = np.zeros((x.shape[0],2,x.shape[1])) @@ -105,12 +105,12 @@ def setup(self): ### NOW DO THE LABELS labels.append('xy.metres') - + labels.extend(['detectorX.pixel','detectorY.pixel']) logging.debug('The labels are: %s',labels) - data_obj.set_axis_labels(*tuple(labels)) - dims = range(len(data_obj.get_shape())) + data_obj.set_axis_labels(*tuple(labels)) + dims = list(range(len(data_obj.get_shape()))) diff_core = (-2,-1) # it will always be this diff_slice = tuple(dims[:-2]) logging.debug("is a diffraction") @@ -122,15 +122,15 @@ def setup(self): rotation_label = (data_obj.get_data_dimension_by_axis_label('rotation_angle', contains=True),) sino_cores = rotation_label + positions_label data_obj.add_pattern("SINOGRAM", core_dims=sino_cores, slice_dims=tuple(set(dims)-set(sino_cores))) - + data_obj.add_pattern("PROJECTION", core_dims=positions_label, slice_dims=tuple(set(dims)-set(positions_label))) - - + + data_obj.add_pattern("DIFFRACTION", core_dims=diff_core, slice_dims=diff_slice) - + data_obj.add_pattern("4D_SCAN", core_dims=tuple(set(dims)-set(rotation_label)), slice_dims=rotation_label) - + self.set_data_reduction_params(data_obj) diff --git a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_loader.py b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_loader.py index aa2e2f167..4d62e83e8 100644 --- a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_loader.py @@ -54,7 +54,7 @@ def setup(self): #print sh ### set the rotation rotation_angle = \ - data_obj.backing_file['entry1/merlin_sw_hdf/t1_theta'].value.astype(float)[:,0] + data_obj.backing_file['entry1/merlin_sw_hdf/t1_theta'][()].astype(float)[:,0] #print rotation_angle.shape data_obj.meta_data.set('rotation_angle', rotation_angle) data_obj.set_axis_labels('rotation_angle.degrees', @@ -64,6 +64,6 @@ def setup(self): data_obj.add_pattern('SINOGRAM', core_dims=(0,1),slice_dims=()) # data_obj.add_pattern('PROJECTION', core_dir=(0,), slice_dir=(1,2,3)) # data_obj.add_pattern('SPECTRUM', core_dir=(3,), slice_dir=(0,1,2)) - + data_obj.set_shape(sh) self.set_data_reduction_params(data_obj) diff --git a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_monitor_loader.py b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_monitor_loader.py index 0c46ca5ea..ff742ae3e 100644 --- a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_monitor_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_monitor_loader.py @@ -54,7 +54,7 @@ def setup(self): #print sh ### set the rotation rotation_angle = \ - data_obj.backing_file['entry1/merlin_sw_hdf/t1_theta'].value.astype(float)[:,0] + data_obj.backing_file['entry1/merlin_sw_hdf/t1_theta'][()].astype(float)[:,0] #print rotation_angle.shape data_obj.meta_data.set('rotation_angle', rotation_angle) data_obj.set_axis_labels('rotation_angle.degrees', @@ -64,6 +64,6 @@ def setup(self): data_obj.add_pattern('SINOGRAM', core_dims=(0,1),slice_dims=()) # data_obj.add_pattern('PROJECTION', core_dir=(0,), slice_dir=(1,2,3)) # data_obj.add_pattern('SPECTRUM', core_dir=(3,), slice_dir=(0,1,2)) - + data_obj.set_shape(sh) self.set_data_reduction_params(data_obj) diff --git a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_xrf_loader.py b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_xrf_loader.py index 9a9ae380a..ee7b90c30 100644 --- a/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_xrf_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i13_loaders/i13_stxm_xrf_loader.py @@ -52,28 +52,28 @@ def setup(self): data_obj.data = data_obj.backing_file['/entry1/xmapMca/fullSpectrum'] sh = data_obj.data.shape #print sh - + if self.parameters['is_map']: lab_sxy = data_obj.backing_file['entry1/instrument/lab_sxy/'] - data_obj.meta_data.set('xy', (lab_sxy['lab_sx'].value,lab_sxy['lab_sy'].value)) + data_obj.meta_data.set('xy', (lab_sxy['lab_sx'][()],lab_sxy['lab_sy'][()])) data_obj.set_axis_labels('xy.microns','ch.unit', 'spectrum.eV') data_obj.add_pattern('PROJECTION', core_dims=(0,),slice_dims=(1,2)) data_obj.add_pattern('SPECTRUM', core_dims=(2,), slice_dims=(0,1)) else: ### set the rotation rotation_angle = \ - data_obj.backing_file['entry1/merlin_sw_hdf/t1_theta'].value.astype(float) + data_obj.backing_file['entry1/merlin_sw_hdf/t1_theta'][()].astype(float) if rotation_angle.ndim>1: rotation_angle = rotation_angle[:,0] #print rotation_angle.shape data_obj.meta_data.set('rotation_angle', rotation_angle) data_obj.set_axis_labels('rotation_angle.degrees', 'x.pixel','ch.unit', 'spectrum.eV') - + data_obj.add_pattern('PROJECTION', core_dims=(1,),slice_dims=(0,2,3)) data_obj.add_pattern('SINOGRAM', core_dims=(0,1),slice_dims=(2,3)) # data_obj.add_pattern('PROJECTION', core_dims=(0,), slice_dims=(1,2,3)) data_obj.add_pattern('SPECTRUM', core_dims=(3,), slice_dims=(0,1,2)) - + data_obj.set_shape(sh) self.set_data_reduction_params(data_obj) diff --git a/savu/plugins/loaders/mapping_loaders/i14_loaders/i14_fluo_loader.py b/savu/plugins/loaders/mapping_loaders/i14_loaders/i14_fluo_loader.py index a881a0390..7ae094775 100644 --- a/savu/plugins/loaders/mapping_loaders/i14_loaders/i14_fluo_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i14_loaders/i14_fluo_loader.py @@ -31,7 +31,7 @@ class I14FluoLoader(BaseLoader): """ A class to load i14s xrf data - :param mono_path: The mono energy. Default: '/entry/instrument/beamline/DCM/dcm_energy'. + :param mono_path: The mono energy. Default: '/entry/instrument/beamline/DCM/dcm_energy'. """ def __init__(self, name='I14FluoLoader'): @@ -80,15 +80,15 @@ def setup(self): data_obj.meta_data.set('mono_energy',mono_energy) except KeyError: - logging.warn("Monochromator value not found at %s, are you sure this is correct? Continuing anyway..." % self.parameters['mono_path']) + logging.warning("Monochromator value not found at %s, are you sure this is correct? Continuing anyway..." % self.parameters['mono_path']) # axis label # print "the labels are:"+str(labels) data_obj.set_axis_labels(*tuple(scan_axis)) - dims = range(len(data_obj.get_shape())) + dims = list(range(len(data_obj.get_shape()))) spec_core = (-1,) # it will always be this # print spec_core - + spec_slice = tuple(dims[:-1]) logging.debug("is a spectrum") diff --git a/savu/plugins/loaders/mapping_loaders/i22_loaders/i22_tomo_loader.py b/savu/plugins/loaders/mapping_loaders/i22_loaders/i22_tomo_loader.py index c8aace844..3f38a9aa2 100644 --- a/savu/plugins/loaders/mapping_loaders/i22_loaders/i22_tomo_loader.py +++ b/savu/plugins/loaders/mapping_loaders/i22_loaders/i22_tomo_loader.py @@ -47,7 +47,7 @@ def setup(self): h5py.File(exp.meta_data.get("data_file"), 'r') data_obj.data = data_obj.backing_file['entry/result/data'] data_obj.set_shape(data_obj.data.shape) - logging.warn('the data as shape %s' % str(data_obj.data.shape)) + logging.warning('the data as shape %s' % str(data_obj.data.shape)) data_obj.set_axis_labels('y.units', 'x.units', 'rotation_angle.degrees', 'Q.angstrom^-1') @@ -56,10 +56,10 @@ def setup(self): data_obj.add_pattern('SPECTRUM', core_dims=(3,), slice_dims=(0, 1, 2)) mData = data_obj.meta_data - mData.set("Q", data_obj.backing_file['entry/result/q'].value) + mData.set("Q", data_obj.backing_file['entry/result/q'][()]) mData.set("x", np.arange(data_obj.data.shape[1])) mData.set("y", np.arange(data_obj.data.shape[0])) mData.set("rotation_angle", data_obj.backing_file[ - 'entry/result/theta'].value) + 'entry/result/theta'][()]) self.set_data_reduction_params(data_obj) diff --git a/savu/plugins/loaders/mapping_loaders/mm_loader.py b/savu/plugins/loaders/mapping_loaders/mm_loader.py index 97e62b63e..56900d015 100644 --- a/savu/plugins/loaders/mapping_loaders/mm_loader.py +++ b/savu/plugins/loaders/mapping_loaders/mm_loader.py @@ -51,18 +51,18 @@ def __init__(self, name='MmLoader'): self.xrd_keys = self.set_params(xrd(), 'xrd') self.stxm_keys = self.set_params(stxm(), 'stxm') self.mon_keys = self.set_params(mon(), 'monitor') - for key, value in self.dict.iteritems(): + for key, value in self.dict.items(): self.parameters[key] = value def set_params(self, inst, name): inst._populate_default_parameters() - copy_keys = inst.parameters.viewkeys() - self.dict.viewkeys() + copy_keys = inst.parameters.keys() - self.dict.keys() for key in copy_keys: self.parameters[key] = inst.parameters[key] return list(copy_keys) def separate_params(self, name, keys): - all_keys = self.dict.keys() + keys + all_keys = list(self.dict.keys()) + keys new_dict = {} for key in [k for k in all_keys if k != 'name']: new_dict[key] = self.parameters[key] @@ -94,9 +94,9 @@ def __set_names(self): def __set_preview(self): preview_dict = {} preview = self.parameters['preview'] - for name in self.name_dict.values(): + for name in list(self.name_dict.values()): preview_dict[name] = preview[name] if isinstance(preview, dict) \ - and name in preview.keys() else preview if \ + and name in list(preview.keys()) else preview if \ isinstance(preview, list) else [] self.parameters['preview'] = preview_dict @@ -119,7 +119,7 @@ def _data_loader(self, inst, name, key): # Delete the data object if it has already been created. if name in self.exp.index['in_data']: del self.exp.index['in_data'][name] - logging.warn(warn_str) + logging.warning(warn_str) except: raise diff --git a/savu/plugins/loaders/mapping_loaders/nxfluo_loader.py b/savu/plugins/loaders/mapping_loaders/nxfluo_loader.py index 78f992980..89f9bb75b 100644 --- a/savu/plugins/loaders/mapping_loaders/nxfluo_loader.py +++ b/savu/plugins/loaders/mapping_loaders/nxfluo_loader.py @@ -50,9 +50,9 @@ def setup(self): gain = self.parameters["fluo_gain"] energy = np.arange(self.parameters["fluo_offset"], gain*npts, gain) mono_path = fluo_entry.name + '/instrument/monochromator/energy' - mono_energy = data_obj.backing_file[mono_path].value + mono_energy = data_obj.backing_file[mono_path][()] monitor_path = fluo_entry.name + '/monitor/data' - monitor = data_obj.backing_file[monitor_path].value + monitor = data_obj.backing_file[monitor_path][()] data_obj.meta_data.set("energy", energy) data_obj.meta_data.set("mono_energy", mono_energy) diff --git a/savu/plugins/loaders/mapping_loaders/nxptycho_loader.py b/savu/plugins/loaders/mapping_loaders/nxptycho_loader.py index b9b9c8803..73d9b4529 100644 --- a/savu/plugins/loaders/mapping_loaders/nxptycho_loader.py +++ b/savu/plugins/loaders/mapping_loaders/nxptycho_loader.py @@ -56,23 +56,23 @@ def setup(self): labels = [] ### set the rotation rotation_angle = \ - data_obj.backing_file[stxm_entry.name + '/data/theta'].value + data_obj.backing_file[stxm_entry.name + '/data/theta'][()] if rotation_angle.ndim > 1: rotation_angle = rotation_angle[:, 0] # axis label labels.append('rotation_angle.degrees') - + data_obj.meta_data.set('rotation_angle', rotation_angle) - + ### set the x x = \ - data_obj.backing_file[stxm_entry.name + '/data/lab_sxy/lab_sx'].value*1e-6 + data_obj.backing_file[stxm_entry.name + '/data/lab_sxy/lab_sx'][()]*1e-6 data_obj.meta_data.set('x', x) # axis label - + ### set the y y = \ - data_obj.backing_file[stxm_entry.name + '/data/lab_sxy/lab_sy'].value*1e-6 + data_obj.backing_file[stxm_entry.name + '/data/lab_sxy/lab_sy'][()]*1e-6 pos = np.zeros((2,len(y))) pos[0,:] = y pos[1,:] = x @@ -85,11 +85,11 @@ def setup(self): #print labels data_obj.set_axis_labels(*tuple(labels)) - - dims = range(len(data_obj.get_shape())) + + dims = list(range(len(data_obj.get_shape()))) diff_core = (-2,-1) # it will always be this #print diff_core - + diff_slice = tuple(dims[:-2]) #print diff_slice logging.debug("is a diffraction") @@ -97,8 +97,8 @@ def setup(self): logging.debug("the diffraction slices are:"+str(diff_slice)) data_obj.add_pattern("DIFFRACTION", core_dims=diff_core, slice_dims=diff_slice) - + data_obj.add_pattern("4D_SCAN", core_dims=(1,2,3), slice_dims=(0,)) - + self.set_data_reduction_params(data_obj) diff --git a/savu/plugins/loaders/mapping_loaders/nxxrd_loader.py b/savu/plugins/loaders/mapping_loaders/nxxrd_loader.py index 9dd0e24ed..ca35c98b3 100644 --- a/savu/plugins/loaders/mapping_loaders/nxxrd_loader.py +++ b/savu/plugins/loaders/mapping_loaders/nxxrd_loader.py @@ -51,7 +51,7 @@ def setup(self): data_obj, xrd_entry = \ self.multi_modal_setup('NXxrd', path, self.parameters['name']) mono_energy = data_obj.backing_file[ - xrd_entry.name + '/instrument/monochromator/energy'].value + xrd_entry.name + '/instrument/monochromator/energy'][()] self.exp.meta_data.set("mono_energy", mono_energy) self._get_calibration_info(data_obj) @@ -62,7 +62,7 @@ def _add_diffraction_pattern(self, dObj): detX = dObj.get_data_dimension_by_axis_label('detector_x') detY = dObj.get_data_dimension_by_axis_label('detector_y') cdims = (detX, detY) - all_dims = range(len(dObj.get_shape())) + all_dims = list(range(len(dObj.get_shape()))) sdims = tuple(set(all_dims).difference(cdims)) dObj.add_pattern("DIFFRACTION", core_dims=cdims, slice_dims=sdims) @@ -80,48 +80,48 @@ def _get_calibration_info(self, data_obj): logging.debug('.... its the legacy version pre-DAWN 2.0') except KeyError: emsg = "We don't know what type of calibration file this is" - logging.warn(emsg) + logging.warning(emsg) cfile.close() def _set_calibration_new(self, mData, det_str, cfile): xpix_entry = det_str + '/detector_module/fast_pixel_direction' - xpix = cfile[xpix_entry].value*self.mm + xpix = cfile[xpix_entry][()]*self.mm mData.set("x_pixel_size", xpix) - beam_center_x = cfile[det_str + '/beam_center_x'].value*self.mm + beam_center_x = cfile[det_str + '/beam_center_x'][()]*self.mm mData.set("beam_center_x", beam_center_x) - beam_center_y = cfile[det_str + '/beam_center_y'].value*self.mm + beam_center_y = cfile[det_str + '/beam_center_y'][()]*self.mm mData.set("beam_center_y", beam_center_y) - distance = cfile[det_str + '/distance'].value*self.mm + distance = cfile[det_str + '/distance'][()]*self.mm mData.set("distance", distance) wentry = '/entry1/calibration_sample/beam/incident_wavelength' - wlength = cfile[wentry].value*self.angstrom + wlength = cfile[wentry][()]*self.angstrom mData.set("incident_wavelength", wlength) - yaw = -cfile[det_str + '/transformations/euler_b'].value + yaw = -cfile[det_str + '/transformations/euler_b'][()] mData.set("yaw", yaw) - roll = cfile[det_str + '/transformations/euler_c'].value-180.0 + roll = cfile[det_str + '/transformations/euler_c'][()]-180.0 mData.set("roll", roll) def _set_calibration_legacy(self, mData, det_str, cfile): - xpix = cfile[det_str + '/x_pixel_size'].value*self.mm + xpix = cfile[det_str + '/x_pixel_size'][()]*self.mm mData.set("x_pixel_size", xpix) - beam_center_x = cfile[det_str + '/beam_center_x'].value*xpix + beam_center_x = cfile[det_str + '/beam_center_x'][()]*xpix mData.set("beam_center_x", beam_center_x) - beam_center_y = cfile[det_str + '/beam_center_y'].value*xpix + beam_center_y = cfile[det_str + '/beam_center_y'][()]*xpix mData.set("beam_center_y", beam_center_y) - distance = cfile[det_str + '/distance'].value*self.mm + distance = cfile[det_str + '/distance'][()]*self.mm mData.set("distance", distance) wl_entry = '/entry/calibration_sample/beam/incident_wavelength' - wavelength = cfile[wl_entry].value*self.angstrom + wavelength = cfile[wl_entry][()]*self.angstrom mData.set("incident_wavelength", wavelength) orien = cfile[det_str + '/detector_orientation'][...].reshape((3, 3)) diff --git a/savu/plugins/loaders/mapping_loaders/p2r_fly_scan_detector_loader.py b/savu/plugins/loaders/mapping_loaders/p2r_fly_scan_detector_loader.py index fbe7db8ea..f2c87021d 100644 --- a/savu/plugins/loaders/mapping_loaders/p2r_fly_scan_detector_loader.py +++ b/savu/plugins/loaders/mapping_loaders/p2r_fly_scan_detector_loader.py @@ -81,7 +81,7 @@ def setup(self): control = data_obj.backing_file['entry1/tomo_entry/control/data'] data_obj.meta_data.set("control", control[...]) except: - logging.warn("No Control information available") + logging.warning("No Control information available") nAngles = len(data_obj.meta_data.get('rotation_angle')) self.__check_angles(data_obj, nAngles) @@ -193,11 +193,11 @@ def __set_rotation_angles(self, data_obj): angles = data_obj.backing_file[entry][ (data_obj.data.get_image_key()) == 0, ...] except KeyError: - logging.warn("No rotation angle entry found in input file.") + logging.warning("No rotation angle entry found in input file.") angles = np.linspace(0, 180, data_obj.get_shape()[0]) else: try: - exec("angles = " + angles) + angles = eval(angles) except: try: angles = np.loadtxt(angles) diff --git a/savu/plugins/loaders/mapping_loaders/txm_loader.py b/savu/plugins/loaders/mapping_loaders/txm_loader.py index a2923fc3d..6477d065b 100644 --- a/savu/plugins/loaders/mapping_loaders/txm_loader.py +++ b/savu/plugins/loaders/mapping_loaders/txm_loader.py @@ -55,7 +55,7 @@ def setup(self): #print sh ### set the rotation rotation_angle = \ - data_obj.backing_file['entry1/theta'].value.astype(float) + data_obj.backing_file['entry1/theta'][()].astype(float) #print rotation_angle.shape data_obj.meta_data.set('rotation_angle', rotation_angle) data_obj.set_axis_labels('rotation_angle.degrees', @@ -66,8 +66,8 @@ def setup(self): slice_dims=(0,)) data_obj.add_pattern('SINOGRAM', core_dims=(0, 2), slice_dims=(1,)) - + data_obj.set_shape(sh) self.set_data_reduction_params(data_obj) - + #print data_obj.get_data_patterns() diff --git a/savu/plugins/loaders/multi_savu_loader.py b/savu/plugins/loaders/multi_savu_loader.py index a19d71df8..2c8edfcdf 100644 --- a/savu/plugins/loaders/multi_savu_loader.py +++ b/savu/plugins/loaders/multi_savu_loader.py @@ -28,7 +28,7 @@ from savu.plugins.loaders.base_loader import BaseLoader from savu.plugins.utils import register_plugin -from savu.plugins.loaders.savu_loader import SavuLoader +from savu.plugins.loaders.savu_nexus_loader import SavuNexusLoader from savu.data.data_structures.data_types.stitch_data import StitchData @@ -90,7 +90,7 @@ def _set_patterns(self, data_obj, savu_obj): def _get_data_objects(self, savu): rrange = self.parameters['range'] - file_list = range(rrange[0], rrange[1]+1) + file_list = list(range(rrange[0], rrange[1]+1)) file_path = copy.copy(self.exp.meta_data.get('data_file')) file_name = '' if self.parameters['file_name'] is None else\ self.parameters['file_name'] diff --git a/savu/plugins/loaders/random_hdf5_loader.py b/savu/plugins/loaders/random_hdf5_loader.py index 5e672f53b..45efb166d 100644 --- a/savu/plugins/loaders/random_hdf5_loader.py +++ b/savu/plugins/loaders/random_hdf5_loader.py @@ -93,8 +93,8 @@ def __get_backing_file(self, data_obj): patterns = data_obj.get_data_patterns() p_name = patterns[self.parameters['pattern']] if \ - self.parameters['pattern'] is not None else patterns.keys()[0] - p_name = patterns.keys()[0] + self.parameters['pattern'] is not None else list(patterns.keys())[0] + p_name = list(patterns.keys())[0] p_dict = patterns[p_name] p_dict['max_frames_transfer'] = 1 nnext = {p_name: p_dict} @@ -108,7 +108,7 @@ def __get_backing_file(self, data_obj): self.exp._barrier() - slice_dirs = nnext.values()[0]['slice_dims'] + slice_dirs = list(nnext.values())[0]['slice_dims'] nDims = len(dset.shape) total_frames = np.prod([dset.shape[i] for i in slice_dirs]) sub_size = \ @@ -143,7 +143,7 @@ def __get_start_slice_list(self, slice_dirs, shape, n_frames): n_processes = len(self.exp.get('processes')) rank = self.exp.get('process') frames = np.array_split(np.arange(n_frames), n_processes)[rank] - f_range = range(0, frames[0]) if len(frames) else [] + f_range = list(range(0, frames[0])) if len(frames) else [] sl = [slice(0, 1) if i in slice_dirs else slice(None) for i in range(len(shape))] idx = 0 @@ -175,7 +175,7 @@ def _set_rotation_angles(self, data_obj, n_entries): angles = np.linspace(0, 180, n_entries) else: try: - exec("angles = " + angles) + angles = eval(angles) except: raise Exception('Cannot set angles in loader.') diff --git a/savu/plugins/loaders/savu_nexus_loader.py b/savu/plugins/loaders/savu_nexus_loader.py index 693fdff7d..96005902b 100644 --- a/savu/plugins/loaders/savu_nexus_loader.py +++ b/savu/plugins/loaders/savu_nexus_loader.py @@ -32,6 +32,8 @@ from savu.plugins.utils import register_plugin from savu.plugins.loaders.base_loader import BaseLoader +from savu.core.utils import ensure_string + @register_plugin class SavuNexusLoader(BaseLoader): @@ -66,7 +68,7 @@ def setup(self): datasets = self._update_plugin_numbers(datasets) exp_dict = self.exp.meta_data.get_dictionary() - if 'checkpoint_loader' in exp_dict.keys(): + if 'checkpoint_loader' in list(exp_dict.keys()): self.__checkpoint_reload(nxsfile, datasets) else: self.__reload(nxsfile, datasets) @@ -85,12 +87,12 @@ def __checkpoint_reload(self, nxsfile, datasets): self._create_datasets(nxsfile, datasets, 'in_data') # update input data meta data - for name in self.exp.index['in_data'].keys(): + for name in list(self.exp.index['in_data'].keys()): self.__update_metadata('in_data', name) if level == 'subplugin': # update output data meta data - for name in self.exp.index['out_data'].keys(): + for name in list(self.exp.index['out_data'].keys()): self.__update_metadata('out_data', name) def __get_parameter_datasets(self, datasets): @@ -136,18 +138,17 @@ def _read_nexus_file(self, nxsfile, datasets): return datasets def _is_nxdata(self, value): - check = 'NX_class' in value.attrs.keys() and\ - value.attrs['NX_class'] == 'NXdata' + check = 'NX_class' in value.attrs.keys() and ensure_string(value.attrs['NX_class']) == 'NXdata' return check def _get_dataset_info(self, key, value): import unicodedata - key = unicodedata.normalize('NFKD', key).encode('ascii', 'ignore') + key = unicodedata.normalize('NFKD', key) ksplit = key.split('-') if len(ksplit) == 1 and ''.join(key.split('_')[0:2]) == 'finalresult': name = '_'.join(key.split('_')[2:]) - pos = 'final' # arbitrarily large number + pos = 'final' else: name = ''.join(ksplit[2:]) pos = ksplit[0] @@ -170,7 +171,7 @@ def _last_unique_datasets(self, datasets, final=None, names=None): def _create_datasets(self, nxsfile, datasets, dtype): data_objs = [] - for name, group in datasets.iteritems(): + for name, group in datasets.items(): self.__set_preview_params(name) dObj = self._create_dataset(name, dtype) self._set_data_type(dObj, group, nxsfile.filename) @@ -183,7 +184,7 @@ def _create_datasets(self, nxsfile, datasets, dtype): def __set_preview_params(self, name): if isinstance(self._all_preview_params, dict): self.parameters['preview'] = self._all_preview_params[name] if \ - name in self._all_preview_params.keys() else [] + name in list(self._all_preview_params.keys()) else [] def _set_data_type(self, dObj, group, nxs_filename): link = group.get(group.attrs['signal'], getlink=True) @@ -215,7 +216,6 @@ def _set_data_type(self, dObj, group, nxs_filename): dObj.data._base_post_clone_updates(dObj.data, extras) def _get_data(self, entry, key): - plist = self.exp.meta_data.plugin_list if isinstance(entry[key], h5py.Group): ddict = {} for subkey in entry[key]: @@ -223,8 +223,8 @@ def _get_data(self, entry, key): return ddict else: try: - value = plist._byteify(json.loads(entry[key][()][0])) - except: + value = json.loads(entry[key][()][0]) + except Exception: value = cu._savu_decoder(entry[key][()]) return value @@ -239,26 +239,28 @@ def _read_nexus_group(self, group, dObj): def _add_axis_labels(self, dObj, group): axes = group.attrs['axes'] ordered_axes = [None]*len(axes) - for i in range(len(axes)): - ordered_axes[group.attrs['_'.join((axes[i], 'indices'))]] = axes[i] - axis_labels = [] - for a in axes: - dObj.meta_data.set(a, group[a][:]) - axis_labels.append('.'.join((a, group[a].attrs['units']))) + + for ax in axes: + ax = ensure_string(ax) + ordered_axes[group.attrs['_'.join((ax, 'indices'))]] = ax + dObj.meta_data.set(ax, group[ax][:]) + units = ensure_string(group[ax].attrs['units']) + axis_labels.append('.'.join((ax, units))) + dObj.set_axis_labels(*axis_labels) def _add_patterns(self, dObj, group): patterns = group['patterns'] - for key, value in patterns.iteritems(): + for key, value in patterns.items(): dObj.add_pattern(key, core_dims=value['core_dims'], slice_dims=value['slice_dims']) def _add_meta_data(self, dObj, group): def get_meta_data_entries(name, obj): - for key, val in obj.attrs.iteritems(): + for key, val in obj.attrs.items(): if val == 'NXdata': - dObj.meta_data.set(name.split('/'), obj.values()[0][...]) + dObj.meta_data.set(name.split('/'), list(obj.values())[0][...]) group['meta_data'].visititems(get_meta_data_entries) def _update_plugin_numbers(self, datasets): @@ -278,6 +280,6 @@ def __apply_previewing(self, dObj): preview = self._all_preview_params if isinstance(preview, dict): name = dObj.get_name() - if name in self._all_preview_params.keys(): + if name in list(self._all_preview_params.keys()): self.parameters['preview'] = self._all_preview_params[name] self.set_data_reduction_params(dObj) diff --git a/savu/plugins/loaders/utils/yaml_utils.py b/savu/plugins/loaders/utils/yaml_utils.py index 69a90af5f..b755a34a2 100644 --- a/savu/plugins/loaders/utils/yaml_utils.py +++ b/savu/plugins/loaders/utils/yaml_utils.py @@ -45,7 +45,7 @@ class OrderedDumper(Dumper): def _dict_representer(dumper, data): return dumper.represent_mapping( yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, - data.items()) + list(data.items())) OrderedDumper.add_representer(OrderedDict, _dict_representer) def represent_none(self, _): diff --git a/savu/plugins/loaders/yaml_converter.py b/savu/plugins/loaders/yaml_converter.py index 66770bada..560c05ab9 100644 --- a/savu/plugins/loaders/yaml_converter.py +++ b/savu/plugins/loaders/yaml_converter.py @@ -26,7 +26,7 @@ import h5py import yaml import copy -import collections +import collections.abc as collections import numpy as np # used in exec so do not delete from ast import literal_eval @@ -80,7 +80,7 @@ def _add_template_updates(self, ddict): all_entries = ddict.pop('all', {}) for key, value in all_entries: for entry in ddict: - if key in entry.keys(): + if key in list(entry.keys()): entry[key] = value for entry in self.parameters['template_param']: @@ -89,7 +89,7 @@ def _add_template_updates(self, ddict): return ddict def _check_for_imports(self, ddict): - if 'import' in ddict.keys(): + if 'import' in list(ddict.keys()): for imp in ddict['import']: name = False if len(imp.split()) > 1: @@ -98,7 +98,7 @@ def _check_for_imports(self, ddict): globals()[mod.__name__ if not name else name] = mod def _check_for_inheritance(self, ddict, inherit, override=False): - if 'inherit' in ddict.keys(): + if 'inherit' in list(ddict.keys()): idict = ddict['inherit'] idict = idict if isinstance(idict, list) else [idict] for i in idict: @@ -117,14 +117,14 @@ def __override(self, inherit, ddict, override): if 'override' in ddict: isoverride = ddict.pop('override') if override: - for old, new in override.iteritems(): + for old, new in override.items(): ddict[new] = ddict.pop(old) - if new in inherit.keys(): + if new in list(inherit.keys()): self._update(ddict[new], inherit[new]) return ddict, isoverride def _update(self, d, u): - for k, v in u.iteritems(): + for k, v in u.items(): if isinstance(v, collections.Mapping): d[k] = self._update(d.get(k, {}), v) else: @@ -132,7 +132,7 @@ def _update(self, d, u): return d def _set_entries(self, ddict): - entries = ddict.keys() + entries = list(ddict.keys()) for name in entries: self.get_description(ddict[name], name) @@ -140,11 +140,11 @@ def get_description(self, entry, name, metadata=True): # set params first as we may need them subsequently if 'params' in entry: self._set_params(entry['params']) - # --------------- check for data entry ----------------------------- - if 'data' in entry.keys(): + if 'data' in list(entry.keys()): data_obj = self.exp.create_data_object("in_data", name) data_obj = self.set_data(data_obj, entry['data']) + else: emsg = 'Please specify the data information in the yaml file.' raise Exception(emsg) @@ -154,13 +154,13 @@ def get_description(self, entry, name, metadata=True): def _get_meta_data_descriptions(self, entry, data_obj): # --------------- check for axis label information ----------------- - if 'axis_labels' in entry.keys(): + if 'axis_labels' in list(entry.keys()): self._set_axis_labels(data_obj, entry['axis_labels']) else: raise Exception('Please specify the axis labels in the yaml file.') # --------------- check for data access patterns ------------------- - if 'patterns' in entry.keys(): + if 'patterns' in list(entry.keys()): self._set_patterns(data_obj, entry['patterns']) else: raise Exception('Please specify the patterns in the yaml file.') @@ -169,7 +169,7 @@ def _get_meta_data_descriptions(self, entry, data_obj): if 'metadata' in entry: self._set_metadata(data_obj, entry['metadata']) self.set_data_reduction_params(data_obj) - + if 'exp_metadata' in entry: self._set_metadata(data_obj, entry['exp_metadata'], exp=True) @@ -183,15 +183,17 @@ def _set_keywords(self, dObj): return {'dfile': filepath, 'dshape': shape} def __get_wildcard_values(self, dObj): - if 'wildcard_values' in dObj.data_info.get_dictionary().keys(): + if 'wildcard_values' in list(dObj.data_info.get_dictionary().keys()): return dObj.data_info.get('wildcard_values') return None - def update_value(self, dObj, value): + def update_value(self, dObj, value, itr=0): + import pdb # setting the keywords if dObj is not None: dshape = dObj.get_shape() dfile = dObj.backing_file + globals()['dfile'] = dfile wildcard = self.__get_wildcard_values(dObj) if isinstance(value, str): @@ -199,30 +201,46 @@ def update_value(self, dObj, value): if len(split) > 1: value = self._convert_string(dObj, split[1]) try: - exec('value = ' + value) - except: - raise Exception("\nError converting value %s\n" % value) + value = eval(value, globals(), locals()) + value = self._convert_bytes(value) + except Exception as e: + msg = (f"Error evaluating value: '{value}' \n %s" % e) + try: + value = value.replace("index(", "index(b") + value = eval(value, globals(), locals()) + value = self._convert_bytes(value) + except: + value = eval(value, globals(), locals()) + raise Exception(msg) return value def _convert_string(self, dObj, string): - for old, new in self.parameters.iteritems(): + for old, new in self.parameters.items(): if old in string: if isinstance(new, str): split = new.split('$') if len(split) > 1: new = split[1] - elif isinstance(new, str): + elif isinstance(new, str): # nothing left to split new = "'%s'" % new string = self._convert_string( dObj, string.replace(old, str(new))) return string + def _convert_bytes(self, value): + # convert bytes to str - for back compatability + if isinstance(value, bytes): + return value.decode("ascii") + if isinstance(value, np.ndarray) and isinstance(value[0], bytes): + return value.astype(str) + return value + def _set_params(self, params): # Update variable parameters that are revealed in the template params = self._update_template_params(params) self.parameters.update(params) # find files, open and add to the namespace then delete file params - files = [k for k in params.keys() if k.endswith('file')] + files = [k for k in list(params.keys()) if k.endswith('file')] for f in files: param = params[f] try: @@ -246,20 +264,20 @@ def _check_for_test_data(self, f, param): del self.parameters[f] def _update_template_params(self, params): - for k, v in params.iteritems(): + for k, v in params.items(): v = pu.is_template_param(v) if v is not False: params[k] = \ - self.parameters[k] if k in self.parameters.keys() else v[1] + self.parameters[k] if k in list(self.parameters.keys()) else v[1] return params def _set_axis_labels(self, dObj, labels): - dims = range(len(labels.keys())) - axis_labels = [None]*len(labels.keys()) + dims = list(range(len(list(labels.keys())))) + axis_labels = [None]*len(list(labels.keys())) for d in dims: self._check_label_entry(labels[d]) l = labels[d] - for key in l.keys(): + for key in list(l.keys()): l[key] = self.update_value(dObj, l[key]) axis_labels[l['dim']] = (l['name'] + '.' + l['units']) if l['value'] is not None: @@ -275,7 +293,7 @@ def _check_label_entry(self, label): axis labels") def _set_patterns(self, dObj, patterns): - for key, dims in patterns.iteritems(): + for key, dims in patterns.items(): core_dims = self.__get_tuple( self.update_value(dObj, dims['core_dims'])) slice_dims = self.__get_tuple( @@ -287,6 +305,6 @@ def __get_tuple(self, val): def _set_metadata(self, dObj, mdata, exp=False): populate = dObj.exp if exp else dObj - for key, value in mdata.iteritems(): + for key, value in mdata.items(): value = self.update_value(dObj, value['value']) populate.meta_data.set(key, value) diff --git a/savu/plugins/plugin.py b/savu/plugins/plugin.py index 273943861..fcf24e19d 100644 --- a/savu/plugins/plugin.py +++ b/savu/plugins/plugin.py @@ -55,14 +55,13 @@ def __init__(self, name="Plugin"): self.pcount = 0 self.exp = None self.check = False - + def initialise(self, params, exp, check=False): - self.check=check + self.check = check self.exp = exp - self._populate_default_parameters() self._set_parameters(copy.deepcopy(params)) self._main_setup() - + def _main_setup(self): """ Performs all the required plugin setup. @@ -70,12 +69,9 @@ def _main_setup(self): in/out_dataset strings in ``self.parameters`` with the relevant data objects. It then creates PluginData objects for each of these datasets. """ - # Don't do this step if loaders haven't been loaded yet - if self.exp and self.exp.index['in_data']: - self._set_plugin_datasets() + self._set_plugin_datasets() self._reset_process_frames_counter() self.setup() - self.set_filter_padding(*(self.get_plugin_datasets())) self._finalise_plugin_datasets() self._finalise_datasets() @@ -161,7 +157,7 @@ def _add_item(self, item_list, not_list): self.parameters_desc[item['name']] = item['desc'] def delete_parameter_entry(self, param): - if param in self.parameters.keys(): + if param in list(self.parameters.keys()): del self.parameters[param] del self.parameters_types[param] del self.parameters_desc[param] @@ -183,6 +179,8 @@ def _set_parameters(self, parameters): plugin, or None if no customisation is required. """ self.initialise_parameters() + # reverse sorting added on Python 3 conversion to make the behaviour + # similar (hopefully the same) as on Python 2 for key in parameters.keys(): if key in self.parameters.keys(): value = self.__convert_multi_params(parameters[key], key) @@ -212,14 +210,14 @@ def __convert_multi_params(self, value, key): raise RuntimeError( 'No values for tuned parameter "{}", ' 'ensure start:stop:step; values are valid.'.format(key)) - if type(value[0]) != dtype: + if not isinstance(value[0], dtype): try: value.remove('') - except: + except Exception: pass if isinstance(value[0], str): value = [ast.literal_eval(i) for i in value] - value = map(dtype, value) + value = list(map(dtype, value)) label = key + '_params.' + type(value[0]).__name__ self.multi_params_dict[len(self.multi_params_dict)] = \ {'label': label, 'values': value} @@ -378,7 +376,7 @@ def set_global_frame_index(self, frame_idx): def get_global_frame_index(self): """ Get the global frame index. """ return self.global_index - + def set_current_slice_list(self, sl): self.slice_list = sl diff --git a/savu/plugins/plugin_datasets.py b/savu/plugins/plugin_datasets.py index f818ad717..7e2cd4e0f 100644 --- a/savu/plugins/plugin_datasets.py +++ b/savu/plugins/plugin_datasets.py @@ -41,7 +41,7 @@ def __init__(self, *args, **kwargs): self.variable_data_flag = False self.multi_params_dict = {} self.extra_dims = [] - self._max_itemsize = 0 + self._max_itemsize = 0 def __get_data_objects(self, dtype): """ Get the data objects associated with the plugin from the experiment @@ -60,7 +60,7 @@ def __get_data_objects(self, dtype): return data_objs def _clone_datasets(self): - for data_obj in self.exp.index['out_data'].values(): + for data_obj in list(self.exp.index['out_data'].values()): if data_obj.raw and data_obj.data: data_obj.raw.create_next_instance(data_obj) # data_obj.clone = True @@ -71,7 +71,7 @@ def _finalise_datasets(self): data._finalise_patterns() def _finalise_plugin_datasets(self): - if 'dawn_runner' in self.exp.meta_data.get_dictionary().keys(): + if 'dawn_runner' in list(self.exp.meta_data.get_dictionary().keys()): return in_pData, out_pData = self.get_plugin_datasets() @@ -82,7 +82,7 @@ def _finalise_plugin_datasets(self): params[pData] = pData._get_plugin_data_size_params() max_bytes = 0 - for key, value in params.iteritems(): + for key, value in params.items(): if value['transfer_bytes'] > max_bytes: max_data = key max_bytes = value['transfer_bytes'] @@ -153,40 +153,45 @@ def _set_plugin_dataset_names(self): params = self.parameters orig_in = copy.copy(params['in_datasets']) in_names = self._set_in_dataset_names(params) - params['in_datasets'] = in_names # case that an extra in_dataset is added in the plugin in_names = orig_in if len(orig_in) and \ - len(in_names) > len(orig_in) else in_names - params['out_datasets'] = self._set_out_dataset_names(params, in_names) + len(in_names) > len(orig_in) else in_names + self._set_out_dataset_names(params, in_names) + # update the entry in the process list + data_dict = {'in_datasets': params['in_datasets'], + 'out_datasets': params['out_datasets']} + idx = self.exp.meta_data.get('nPlugin') + self.exp.meta_data.plugin_list._update_datasets(idx, data_dict) def _set_in_dataset_names(self, params): - names = params['in_datasets'] if 'in_datasets' in params.keys() else [] - names = ['all'] if len(names) == 0 else names - nIn = self.nInput_datasets() - return self.check_nDatasets(names, nIn, 'in_data') - + dIn = params['in_datasets'] + dIn = dIn if isinstance(dIn, list) else [dIn] + dIn = self.exp._set_all_datasets('in_data') if len(dIn) ==0 else dIn + params['in_datasets'] = dIn + nIn = self.nInput_datasets() # datasets many be added dynamically here + return self.check_nDatasets(params['in_datasets'], nIn, 'in_data') + def _set_out_dataset_names(self, params, in_names): - names = params['out_datasets'] if 'out_datasets' in params.keys() else [] - names = (copy.copy(in_names) if len(names) == 0 else names) + dOut = params['out_datasets'] if 'out_datasets' in params.keys() else [] + dOut = dOut if isinstance(dOut, list) else [dOut] + dOut = (copy.copy(in_names) if len(dOut) == 0 else dOut) clones = self.nClone_datasets() - params['out_datasets'] = names + params['out_datasets'] = dOut nOut = self.nOutput_datasets() - names = params['out_datasets'] - names = self.check_nDatasets(names, nOut, "out_data", clones=clones) + names = self.check_nDatasets(params['out_datasets'], nOut, + "out_data", clones=clones) if clones: - names.extend(['itr_clone' + str(i) for i in range(clones)]) + dOut.extend(['itr_clone' + str(i) for i in range(clones)]) for i in range(len(names)): new = names[i].split('in_datasets') if len(new) == 2: names[i] = in_names[int(list(new[1])[1])] + params["out_datasets"] = names return names def check_nDatasets(self, names, nSets, dtype, clones=0): - names = self.exp._set_all_datasets(dtype) if 'all' in names[0] else names - names = ([names] if type(names) is not list else names) nSets = len(self.parameters[dtype + 'sets']) if nSets=='var' else nSets - if len(names) is not (nSets - clones): if nSets == 0: names = [] @@ -201,7 +206,8 @@ def _set_plugin_datasets(self): """ Populate ``self.parameters`` in/out_datasets and plugin_in/out_datasets with the relevant objects (Data or PluginData). """ - self._set_plugin_dataset_names() + if not self.exp._get_dataset_names_complete(): + self._set_plugin_dataset_names() self.parameters['in_datasets'] = self.__set_in_datasets() self.parameters['out_datasets'] = self.__set_out_datasets() self.parameters['plugin_in_datasets'] = \ diff --git a/savu/plugins/ptychography/base_ptycho.py b/savu/plugins/ptychography/base_ptycho.py index ace52ce45..ba5a10ad6 100644 --- a/savu/plugins/ptychography/base_ptycho.py +++ b/savu/plugins/ptychography/base_ptycho.py @@ -41,7 +41,7 @@ def __init__(self, name): def setup(self): self.exp.log(self.name + " Setting up the ptycho") in_dataset, out_dataset = self.get_datasets() - + in_meta_data = in_dataset[0].meta_data# grab the positions from the metadata logging.debug('getting the positions...') self.positions = in_meta_data.get('xy') # get the positions and bind them @@ -55,7 +55,7 @@ def setup(self): ### PROBE ### probe = out_dataset[0] # probe_shape = in_dataset[0].get_shape()[-2:] + (self.get_num_probe_modes(),) - + self.set_size_probe(in_dataset[0].get_shape()[-2:]) logging.debug("##### PROBE #####") #print("probe shape is:%s",str(self.get_size_probe())) @@ -71,12 +71,12 @@ def setup(self): logging.debug("##### OBJECT #####") #print("object shape is:%s",str(object_shape)) # print object_labels - + object_trans.create_dataset(axis_labels=object_labels, shape=object_shape) # create the dataset - + self.object_pattern_setup(object_labels, object_trans) - + ### POSITIONS ### logging.debug('##### POSITIONS #####') positions = out_dataset[2] @@ -86,9 +86,9 @@ def setup(self): #print "positions shape",positions_shape positions.create_dataset(axis_labels=position_labels, shape=positions_shape) - - rest_pos = range(len(position_labels)) - + + rest_pos = list(range(len(position_labels))) + pos_md = \ {'core_dims':tuple(set(rest_pos) - set([0])), 'slice_dims':(0,)} positions.add_pattern("CHANNEL", **pos_md) @@ -104,7 +104,7 @@ def setup(self): ''' The below methods influence the set-up and can be over-ridden depending on which software package we are using - + ''' def get_plugin_pattern(self): @@ -124,10 +124,10 @@ def get_num_probe_modes(self): def get_num_object_modes(self): return 1 - + def get_positions(self): return self.positions - + def get_pixel_size(self): return 30e-9 @@ -146,19 +146,19 @@ def set_size_object(self, dataset,positions, pobj=33e-9): def get_size_object(self): return self.obj_shape - + def set_size_probe(self,val): self.probe_size = (1,)+val + (self.get_num_probe_modes(),) - + def get_size_probe(self): ''' returns tuple ''' return self.probe_size - + def get_max_frames(self): return 'single' - + def get_output_axis_units(self): return 'nm' @@ -168,11 +168,11 @@ def probe_pattern_setup(self, probe_labels, probe): I've created the TIMESERIES because we could in theory have a time series of spectra probe_patterns: PROJECTION, TIMESERIES (for each projection), SPECTRUM (for each energy) object_patterns: PROJECTION, SINOGRAM, SPECTRUM (for each energy) - position_patterns: 1D_METADATA - + position_patterns: 1D_METADATA + ''' probe_dims = len(probe_labels) # the number of dimensions from the axis labels - rest_probe = range(probe_dims) # all the dimensions we have + rest_probe = list(range(probe_dims)) # all the dimensions we have self.set_projection_pattern(probe, rest_probe) self.set_probe_rotation_patterns(probe, rest_probe) self.set_probe_energy_patterns(probe, rest_probe) @@ -183,12 +183,12 @@ def object_pattern_setup(self, object_labels, object_trans): I've created the TIMESERIES because we could in theory have a time series of spectra probe_patterns: PROJECTION, TIMESERIES (for each projection), SPECTRUM (for each energy) object_patterns: PROJECTION, SINOGRAM, SPECTRUM (for each energy) - position_patterns: 1D_METADATA - + position_patterns: 1D_METADATA + ''' obj_dims = len(object_labels) # the number of dimensions from the axis labels # print "object has "+str(obj_dims)+"dimensions" - rest_obj = range(obj_dims) # all the dimensions we have + rest_obj = list(range(obj_dims)) # all the dimensions we have self.set_projection_pattern(object_trans, rest_obj) self.set_object_rotation_patterns(object_trans, rest_obj) self.set_object_energy_patterns(object_trans, rest_obj) @@ -196,7 +196,7 @@ def object_pattern_setup(self, object_labels, object_trans): def setup_axis_labels(self, in_dataset): ''' This is where we set up the axis labels - the 4D scan will contain labels that are: 'xy', 'detectorX', 'detectorY', but the data + the 4D scan will contain labels that are: 'xy', 'detectorX', 'detectorY', but the data itself may be scanned in energy or rotation or something else. We want to remove all the above, and amend them to be the following (preferably with additional scan axes at the front): probe: 'x','y','mode_idx' @@ -205,14 +205,14 @@ def setup_axis_labels(self, in_dataset): ''' PATTERN_LABELS = ['xy', 'detectorX', 'detectorY'] in_labels = in_dataset[0].data_info.get('axis_labels') # this is a list of dictionarys - existing_labels = [d.keys()[0] for d in in_labels] # this just gets the axes names + existing_labels = [list(d.keys())[0] for d in in_labels] # this just gets the axes names logging.debug('The existing labels are:%s, we will remove:%s' % (existing_labels, PATTERN_LABELS)) logging.debug('removing these labels from the list') core_labels_raw = [l for l in existing_labels if l not in PATTERN_LABELS] # removes them from the list core_labels = [l + '.' + in_labels[0][l] for l in core_labels_raw] # add the units in for the ones we are keeping # now we just have to add the new ones to this. trans_units = self.get_output_axis_units() - + probe_labels = list(core_labels) # take a copy probe_labels.extend(['mode_idx.number','x.' + trans_units, 'y.' + trans_units, ]) logging.debug('the labels for the probe are:%s' % str(probe_labels)) @@ -231,7 +231,7 @@ def set_probe_rotation_patterns(self, probe, rest_probe): try: rot_axis = probe.get_data_dimension_by_axis_label('rotation_angle', contains=True) # get the rotation axis except Exception as e: - logging.warn(str(e) + 'we were looking for "rotation_angle"') + logging.warning(str(e) + 'we were looking for "rotation_angle"') logging.debug('This is not a tomography, so no time series for the probe') else: # print('the rotation axis is:%s' % str(rot_axis)) @@ -244,7 +244,7 @@ def set_probe_energy_patterns(self, probe, rest_probe): try: energy_axis = probe.get_data_dimension_by_axis_label('energy', contains=True) # get an energy axis except Exception as e: - logging.warn(str(e) + 'we were looking for "energy"') + logging.warning(str(e) + 'we were looking for "energy"') logging.debug('This is not spectro-microscopy, so no spectrum/timeseries for the probe') else: probe_spec = {'core_dims':tuple(energy_axis), 'slice_dims':tuple(set(rest_probe) - set([energy_axis]))} @@ -265,7 +265,7 @@ def set_object_energy_patterns(self, object_trans, rest_obj): try: energy_axis = object_trans.get_data_dimension_by_axis_label('energy', contains=True) # get an energy axis except Exception as e: - logging.warn(str(e) + 'we were looking for "energy"') + logging.warning(str(e) + 'we were looking for "energy"') logging.debug('This is not spectro-microscopy, so no spectrum for the object') else: obj_spec = {'core_dims':tuple(energy_axis), 'slice_dims':tuple(set(rest_obj) - set([energy_axis]))} @@ -277,7 +277,7 @@ def set_object_rotation_patterns(self, object_trans, rest_obj): try: rot_axis = object_trans.get_data_dimension_by_axis_label('rotation_angle', contains=True) # get the rotation axis except Exception as e: - logging.warn(str(e) + 'we were looking for "rotation_angle"') + logging.warning(str(e) + 'we were looking for "rotation_angle"') logging.debug('This is not a tomography, so no sinograms for the object transmission') else: x_axis = object_trans.get_data_dimension_by_axis_label('x', contains=True) # get the x axis diff --git a/savu/plugins/ptychography/ptypy_batch.py b/savu/plugins/ptychography/ptypy_batch.py index be64b7736..d40160959 100644 --- a/savu/plugins/ptychography/ptypy_batch.py +++ b/savu/plugins/ptychography/ptypy_batch.py @@ -46,8 +46,8 @@ def __init__(self): def pre_process(self): b = Ptycho.load_run(self.parameters['ptyr_file'], False) # load in the run but without the data p = b.p - existing_scan = copy(p.scans[p.scans.keys()[0]]) - del p.scans[p.scans.keys()[0]] + existing_scan = copy(p.scans[list(p.scans.keys())[0]]) + del p.scans[list(p.scans.keys())[0]] p.scans.savu = existing_scan p.scans.savu.data.source = 'savu' p.scans.savu.data.recipe = u.Param() diff --git a/savu/plugins/reconstructions/astra_recons/astra_recon_gpu.py b/savu/plugins/reconstructions/astra_recons/astra_recon_gpu.py index cc9dcaf1e..2dfc284c8 100644 --- a/savu/plugins/reconstructions/astra_recons/astra_recon_gpu.py +++ b/savu/plugins/reconstructions/astra_recons/astra_recon_gpu.py @@ -15,24 +15,24 @@ """ .. module:: astra_recon_gpu :platform: Unix - :synopsis: Wrapper around the Astra toolbox for gpu reconstruction + :synopsis: Wrapper around the Astra toolbox for gpu reconstruction using vector geometry .. moduleauthor:: Mark Basham """ import astra import numpy as np -from savu.plugins.reconstructions.astra_recons.base_astra_recon \ - import BaseAstraRecon +from savu.plugins.reconstructions.astra_recons.base_astra_vector_recon \ + import BaseAstraVectorRecon from savu.plugins.driver.gpu_plugin import GpuPlugin from savu.data.plugin_list import CitationInformation from savu.plugins.utils import register_plugin @register_plugin -class AstraReconGpu(BaseAstraRecon, GpuPlugin): +class AstraReconGpu(BaseAstraVectorRecon, GpuPlugin): """ - A Plugin to run the astra reconstruction + A Plugin to run the astra reconstruction (GPU) for vector geometry :u*param res_norm: Output the residual norm at each iteration\ (Error in the solution - iterative solvers only). Default: False. @@ -71,32 +71,73 @@ def astra_setup(self): if not options_list.count(self.parameters['algorithm']): raise Exception("Unknown Astra GPU algorithm.") - def setup_3D(self): - pData = self.get_plugin_in_datasets()[0] - self.sino_dim_detX = \ - pData.get_data_dimension_by_axis_label('x', contains=True) - self.det_rot = \ - pData.get_data_dimension_by_axis_label('angle', contains=True) - self.sino_shape = pData.get_shape() - self.nDims = len(self.sino_shape) -# self.nCols = self.sino_shape[self.sino_dim_detX] - self.slice_dir = pData.get_slice_dimension() - self.slice_func = self.slice_sino(self.nDims) - l = self.sino_shape[self.sino_dim_detX] - c = np.linspace(-l/2.0, l/2.0, l) - x, y = np.meshgrid(c, c) - self.mask_id = False - mask = np.array((x**2 + y**2 < (l/2.0)**2), dtype=np.float) - self.mask = np.transpose( - np.tile(mask, (self.get_max_frames(), 1, 1)), (1, 0, 2)) - self.manual_mask = True if not self.parameters['sino_pad'] else False - - def astra_3D_recon(self, sino, cors, angles, vol_shape, init): + def astra_2D_vector_recon(self, data): + sino = data[0] + cor, angles, vol_shape, init = self.get_frame_params() + angles = np.deg2rad(angles) + if self.res: + res = np.zeros(self.len_res) + # create volume geom + vol_geom = astra.create_vol_geom(vol_shape) + # create projection geom + det_width = sino.shape[self.dim_detX] + half_det_width = 0.5*det_width + cor_astra = half_det_width - cor + # set parallel beam vector geometry + vectors = self.vec_geom_init2D(angles, 1.0, cor_astra-0.5) + try: + #vector geometry (astra > 1.9v) + proj_geom = astra.create_proj_geom('parallel_vec', det_width, vectors) + except: + print('Warning: using scalar geometry since the Astra version <1.9 does not support the vector one for 2D') + proj_geom = astra.create_proj_geom('parallel', 1.0, det_width, angles) + sino = np.transpose(sino, (self.dim_rot, self.dim_detX)) + + # Create a data object to hold the sinogram data + sino_id = astra.data2d.create('-sino', proj_geom, sino) + + # create reconstruction id + if init is not None: + rec_id = astra.data2d.create('-vol', vol_geom, init) + else: + rec_id = astra.data2d.create('-vol', vol_geom) + +# if self.mask_id: +# self.mask_id = astra.data2d.create('-vol', vol_geom, self.mask) + # setup configuration options + cfg = self.set_config(rec_id, sino_id, proj_geom, vol_geom) + # create algorithm id + alg_id = astra.algorithm.create(cfg) + # run algorithm + if self.res: + for j in range(self.iters): + # Run a single iteration + astra.algorithm.run(alg_id, 1) + res[j] = astra.algorithm.get_res_norm(alg_id) + else: + astra.algorithm.run(alg_id, self.iters) + # get reconstruction matrix + + if self.manual_mask is not False: + recon = self.manual_mask*astra.data2d.get(rec_id) + else: + recon = astra.data2d.get(rec_id) + + # delete geometry + self.delete(alg_id, sino_id, rec_id, False) + return [recon, res] if self.res else recon + + def astra_3D_vector_recon(self, data): + #def astra_3D_vector_recon(self, sino, cors, angles, vol_shape, init): # while len(cors) is not self.sino_shape[self.slice_dir]: # cors.append(0) - proj_id = False + sino = data[0] + cor, angles, vol_shape, init = self.get_frame_params() + half_det_width = 0.5*sino.shape[self.sino_dim_detX] + cor_astra = half_det_width - cor[0] + sslice = [slice(None)]*self.nDims - recon = np.zeros(self.vol_shape) + recon = np.zeros(vol_shape) recon = np.expand_dims(recon, axis=self.slice_dir) if self.res: res = np.zeros((self.vol_shape[self.slice_dir], self.iters)) @@ -110,19 +151,19 @@ def astra_3D_recon(self, sino, cors, angles, vol_shape, init): # centre_pad = (0, 0) if '3D' in self.alg else \ # self.array_pad(cor, sino.shape[self.dim_detX]) - pad_sino = self.pad_sino(self.slice_func(sino, sslice), cors) - nDets = pad_sino.shape[self.slice_dir] - trans = (self.slice_dir, self.det_rot, self.sino_dim_detX) - pad_sino = np.transpose(pad_sino, trans) + #pad_sino = self.pad_sino(self.slice_func(sino, sslice), cors) + #nDets = pad_sino.shape[self.slice_dir] + #trans = (self.slice_dir, self.det_rot, self.sino_dim_detX) + #pad_sino = np.transpose(pad_sino, trans) # create projection geom - vectors = self.create_3d_vector_geom(angles, cors, - sino.shape[self.sino_dim_detX]) - proj_geom = astra.create_proj_geom('parallel3d_vec', nDets, - pad_sino.shape[self.sino_dim_detX], - vectors) + #vectors3D = self.create_3d_vector_geom(angles, cor, sino.shape[self.sino_dim_detX]) + # define astra vector geometry (default) + vectors3D = self.vec_geom_init3D(np.deg2rad(angles), 1.0, 1.0, cor_astra-0.5) + proj_geom = astra.create_proj_geom('parallel3d_vec', sino.shape[self.sino_dim_detY], sino.shape[self.sino_dim_detX], + vectors3D) # create sinogram id - sino_id = astra.data3d.create("-sino", proj_geom, pad_sino) + sino_id = astra.data3d.create("-sino", proj_geom, np.swapaxes(sino, 0, 1)) # create reconstruction id if init is not None: @@ -138,6 +179,7 @@ def astra_3D_recon(self, sino, cors, angles, vol_shape, init): alg_id = astra.algorithm.create(cfg) # run algorithm + """ if self.res: for j in range(self.iters): # Run a single iteration @@ -145,17 +187,19 @@ def astra_3D_recon(self, sino, cors, angles, vol_shape, init): res[j] = astra.algorithm.get_res_norm(alg_id) else: astra.algorithm.run(alg_id, self.iters) + """ + astra.algorithm.run(alg_id, self.iters) # get reconstruction matrix - if self.manual_mask: - recon = self.mask*astra.data3d.get(rec_id) - else: - recon = astra.data3d.get(rec_id) + #if self.manual_mask: + # recon = self.mask*astra.data3d.get(rec_id) + #else: + # recon = astra.data3d.get(rec_id) - #recon = astra.data3d.get(rec_id) recon = np.transpose(astra.data3d.get(rec_id), (2, 0, 1)) + # delete geometry - self.delete(alg_id, sino_id, rec_id, proj_id) + self.delete(alg_id, sino_id, rec_id, False) self.start += 1 if self.res: @@ -169,28 +213,76 @@ def create_3d_vector_geom(self, angles, cors, detX): # add res_norm # add a mask angles = np.deg2rad(angles) - vectors = np.zeros((len(angles), 12)) + vectors3D = np.zeros((len(angles), 12)) shift = detX/2.0 - cors[0] # temporary for i in range(len(angles)): # ray direction - vectors[i, 0] = np.cos(angles[i]) - vectors[i, 1] = -np.sin(angles[i]) - vectors[i, 2] = 0 + vectors3D[i, 0] = np.cos(angles[i]) + vectors3D[i, 1] = -np.sin(angles[i]) + vectors3D[i, 2] = 0 # center of detector - vectors[i, 3] = -shift*np.sin(angles[i]) - vectors[i, 4] = -shift*np.cos(angles[i]) - vectors[i, 5] = 0 + vectors3D[i, 3] = -shift*np.sin(angles[i]) + vectors3D[i, 4] = -shift*np.cos(angles[i]) + vectors3D[i, 5] = 0 # vector from detector pixel (0,0) to (0,1) - vectors[i, 6] = -np.sin(angles[i]) - vectors[i, 7] = -np.cos(angles[i]) - vectors[i, 8] = 0 + vectors3D[i, 6] = -np.sin(angles[i]) + vectors3D[i, 7] = -np.cos(angles[i]) + vectors3D[i, 8] = 0 # vector from detector pixel (0,0) to (1,0) - vectors[i, 9] = 0 - vectors[i, 10] = 0 - vectors[i, 11] = 1 + vectors3D[i, 9] = 0 + vectors3D[i, 10] = 0 + vectors3D[i, 11] = 1 + return vectors3D + + def rotation_matrix2D(self, theta): + #define 2D rotation matrix + return np.array([[np.cos(theta), -np.sin(theta)], + [np.sin(theta), np.cos(theta)]]) + + def rotation_matrix3D(self, theta): + #define 3D rotation matrix + return np.array([[np.cos(theta), -np.sin(theta), 0.0], + [np.sin(theta), np.cos(theta), 0.0], + [0.0 , 0.0 , 1.0]]) + + def vec_geom_init2D(self, angles_rad, DetectorSpacingX, CenterRotOffset): + #define 2D vector geometry + s0 = [0.0, -1.0] # source + d0 = [CenterRotOffset, 0.0] # detector + u0 = [DetectorSpacingX, 0.0] # detector coordinates + + vectors = np.zeros([angles_rad.size,6]) + for i in range(0,angles_rad.size): + theta = angles_rad[i] + vec_temp = np.dot(self.rotation_matrix2D(theta),s0) + vectors[i,0:2] = vec_temp[:] # ray position + vec_temp = np.dot(self.rotation_matrix2D(theta),d0) + vectors[i,2:4] = vec_temp[:] # center of detector position + vec_temp = np.dot(self.rotation_matrix2D(theta),u0) + vectors[i,4:6] = vec_temp[:] # detector pixel (0,0) to (0,1). + return vectors + + def vec_geom_init3D(self, angles_rad, DetectorSpacingX, DetectorSpacingY, CenterRotOffset): + #define 3D vector geometry + s0 = [0.0, -1.0, 0.0] # source + d0 = [CenterRotOffset, 0.0, 0.0] # detector + u0 = [DetectorSpacingX, 0.0, 0.0] # detector coordinates + v0 = [0.0, 0.0, DetectorSpacingY] # detector coordinates + + vectors = np.zeros([angles_rad.size,12]) + for i in range(0,angles_rad.size): + theta = angles_rad[i] + vec_temp = np.dot(self.rotation_matrix3D(theta),s0) + vectors[i,0:3] = vec_temp[:] # ray position + vec_temp = np.dot(self.rotation_matrix3D(theta),d0) + vectors[i,3:6] = vec_temp[:] # center of detector position + vec_temp = np.dot(self.rotation_matrix3D(theta),u0) + vectors[i,6:9] = vec_temp[:] # detector pixel (0,0) to (0,1). + vec_temp = np.dot(self.rotation_matrix3D(theta),v0) + vectors[i,9:12] = vec_temp[:] # Vector from detector pixel (0,0) to (1,0) return vectors def get_citation_information(self): diff --git a/savu/plugins/reconstructions/astra_recons/base_astra_recon.py b/savu/plugins/reconstructions/astra_recons/base_astra_recon.py index efbb6413b..123925fdc 100644 --- a/savu/plugins/reconstructions/astra_recons/base_astra_recon.py +++ b/savu/plugins/reconstructions/astra_recons/base_astra_recon.py @@ -40,14 +40,13 @@ def __init__(self, name='BaseAstraRecon'): def setup(self): self.alg = self.parameters['algorithm'] - self.get_max_frames = \ - self._get_multiple if '3D' in self.alg else self._get_single + self.get_max_frames = self._get_multiple if '3D' in self.alg else self._get_single super(BaseAstraRecon, self).setup() out_dataset = self.get_out_datasets() # if res_norm is required then setup another output dataset - if len(out_dataset) is 2: + if len(out_dataset) == 2: self.res = True out_pData = self.get_plugin_out_datasets() in_data = self.get_in_datasets()[0] @@ -68,7 +67,7 @@ def setup(self): slice_dims=pattern['slice_dims'], core_dims=pattern['core_dims']) out_pData[1].plugin_data_setup( - pattern['name'], self.get_max_frames()) + pattern['name'], self.get_max_frames()) def pre_process(self): self.alg = self.parameters['algorithm'] @@ -95,16 +94,25 @@ def setup_2D(self): def set_mask(self, shape): l = self.get_plugin_out_datasets()[0].get_shape()[0] - c = np.linspace(-l/2.0, l/2.0, l) + c = np.linspace(-l / 2.0, l / 2.0, l) x, y = np.meshgrid(c, c) - r = (shape[self.dim_detX]-1)*self.parameters['ratio'] + ratio = self.parameters['ratio'] + if isinstance(ratio, list) or isinstance(ratio, tuple): + ratio_mask = ratio[0] + outer_mask = ratio[1] + if isinstance(outer_mask, str): + outer_mask = np.nan + else: + ratio_mask = ratio + outer_mask = np.nan + r = (l - 1) * ratio_mask outer_pad = True if self.parameters['outer_pad'] and self.padding_alg\ else False if not outer_pad: self.manual_mask = \ - np.array((x**2 + y**2 < (r/2.0)**2), dtype=np.float) - self.manual_mask[self.manual_mask == 0] = np.nan + np.array((x**2 + y**2 < (r / 2.0)**2), dtype=np.float) + self.manual_mask[self.manual_mask == 0] = outer_mask else: self.manual_mask = False @@ -146,7 +154,7 @@ def astra_2D_recon(self, data): # get reconstruction matrix if self.manual_mask is not False: - recon = self.manual_mask*astra.data2d.get(rec_id) + recon = self.manual_mask * astra.data2d.get(rec_id) else: recon = astra.data2d.get(rec_id) @@ -160,9 +168,9 @@ def set_config(self, rec_id, sino_id, proj_geom, vol_geom): cfg['ProjectionDataId'] = sino_id if 'FBP' in self.alg: fbp_filter = self.parameters['FBP_filter'] if 'FBP_filter' in \ - self.parameters.keys() else 'none' + list(self.parameters.keys()) else 'none' cfg['FilterType'] = fbp_filter - if 'projector' in self.parameters.keys(): + if 'projector' in list(self.parameters.keys()): proj_id = astra.create_projector( self.parameters['projector'], proj_geom, vol_geom) cfg['ProjectorId'] = proj_id diff --git a/savu/plugins/reconstructions/astra_recons/base_astra_vector_recon.py b/savu/plugins/reconstructions/astra_recons/base_astra_vector_recon.py new file mode 100644 index 000000000..d3bf330c0 --- /dev/null +++ b/savu/plugins/reconstructions/astra_recons/base_astra_vector_recon.py @@ -0,0 +1,241 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: base_astra_vector_recon + :platform: Unix + :synopsis: A base for Astra toolbox reconstruction algorithms using vector geometry +.. moduleauthor:: Mark Basham +""" + +import astra +import numpy as np + +from savu.plugins.reconstructions.base_recon import BaseRecon +from savu.data.plugin_list import CitationInformation + + +class BaseAstraVectorRecon(BaseRecon): + """ + A Plugin to perform Astra toolbox reconstruction using vector geometry + + :u*param n_iterations: Number of Iterations - only valid for iterative \ + algorithms. Default: 1. + """ + + def __init__(self, name='BaseAstraVectorRecon'): + super(BaseAstraVectorRecon, self).__init__(name) + self.res = False + + def setup(self): + self.alg = self.parameters['algorithm'] + self.get_max_frames = \ + self._get_multiple if '3D' in self.alg else self._get_single + + super(BaseAstraVectorRecon, self).setup() + out_dataset = self.get_out_datasets() + + # if res_norm is required then setup another output dataset + if len(out_dataset) is 2: + self.res = True + out_pData = self.get_plugin_out_datasets() + in_data = self.get_in_datasets()[0] + dim_detX = \ + in_data.get_data_dimension_by_axis_label('y', contains=True) + + nIts = self.parameters['n_iterations'] + nIts = nIts if isinstance(nIts, list) else [nIts] + self.len_res = max(nIts) + shape = (in_data.get_shape()[dim_detX], max(nIts)) + + label = ['vol_y.voxel', 'iteration.number'] + pattern = {'name': 'SINOGRAM', 'slice_dims': (0,), + 'core_dims': (1,)} + + out_dataset[1].create_dataset(axis_labels=label, shape=shape) + out_dataset[1].add_pattern(pattern['name'], + slice_dims=pattern['slice_dims'], + core_dims=pattern['core_dims']) + out_pData[1].plugin_data_setup( + pattern['name'], self.get_max_frames()) + + def pre_process(self): + self.alg = self.parameters['algorithm'] + self.iters = self.parameters['n_iterations'] + + if '3D' in self.alg: + self.setup_3D() + self.process_frames = self.astra_3D_vector_recon + else: + self.setup_2D() + self.process_frames = self.astra_2D_vector_recon + + def setup_2D(self): + pData = self.get_plugin_in_datasets()[0] + self.dim_detX = \ + pData.get_data_dimension_by_axis_label('x', contains=True) + self.dim_rot = \ + pData.get_data_dimension_by_axis_label('rot', contains=True) + + self.sino_shape = pData.get_shape() + self.nDims = len(self.sino_shape) + self.nCols = self.sino_shape[self.dim_detX] + self.set_mask(self.sino_shape) + + def setup_3D(self): + pData = self.get_plugin_in_datasets()[0] + self.sino_dim_detX = \ + pData.get_data_dimension_by_axis_label('x', contains=True) + self.sino_dim_detY = \ + pData.get_data_dimension_by_axis_label('y', contains=True) + self.det_rot = \ + pData.get_data_dimension_by_axis_label('angle', contains=True) + self.sino_shape = pData.get_shape() + self.nDims = len(self.sino_shape) + #self.nCols = self.sino_shape[self.sino_dim_detX] + self.slice_dir = pData.get_slice_dimension() + #self.slice_func = self.slice_sino(self.nDims) + """ + l = self.sino_shape[self.sino_dim_detX] + c = np.linspace(-l/2.0, l/2.0, l) + x, y = np.meshgrid(c, c) + self.mask_id = False + mask = np.array((x**2 + y**2 < (l/2.0)**2), dtype=np.float) + self.mask = np.transpose( + np.tile(mask, (self.get_max_frames(), 1, 1)), (1, 0, 2)) + self.manual_mask = True if not self.parameters['sino_pad'] else False + """ + + def set_mask(self, shape): + l = self.get_plugin_out_datasets()[0].get_shape()[0] + c = np.linspace(-l/2.0, l/2.0, l) + x, y = np.meshgrid(c, c) + r = (shape[self.dim_detX]-1)*self.parameters['ratio'] + + outer_pad = True if self.parameters['outer_pad'] and self.padding_alg\ + else False + if not outer_pad: + self.manual_mask = \ + np.array((x**2 + y**2 < (r/2.0)**2), dtype=np.float) + self.manual_mask[self.manual_mask == 0] = np.nan + else: + self.manual_mask = False + + def set_config(self, rec_id, sino_id, proj_geom, vol_geom): + cfg = astra.astra_dict(self.alg) + cfg['ReconstructionDataId'] = rec_id + cfg['ProjectionDataId'] = sino_id + if 'FBP' in self.alg: + fbp_filter = self.parameters['FBP_filter'] if 'FBP_filter' in \ + self.parameters.keys() else 'none' + cfg['FilterType'] = fbp_filter + if 'projector' in self.parameters.keys(): + proj_id = astra.create_projector( + self.parameters['projector'], proj_geom, vol_geom) + cfg['ProjectorId'] = proj_id + cfg = self.set_options(cfg) + return cfg + + def delete(self, alg_id, sino_id, rec_id, proj_id): + astra.algorithm.delete(alg_id) + astra.data2d.delete(sino_id) + astra.data2d.delete(rec_id) + if proj_id: + astra.projector.delete(proj_id) + + def get_padding_algorithms(self): + """ A list of algorithms that allow the data to be padded. """ + return ['FBP', 'FBP_CUDA'] + + def _get_single(self): + return 'single' + + def _get_multiple(self): + return 'multiple' + + def get_citation_information(self): + cite_info1 = CitationInformation() + cite_info1.name = 'citation1' + cite_info1.description = \ + ("The tomography reconstruction algorithm used in this processing \ + pipeline is part of the ASTRA Toolbox") + cite_info1.bibtex = \ + ("@article{van2016fast,\n" + + "title={Fast and flexible X-ray tomography using the ASTRA \ + toolbox},\n" + + "author={van Aarle, Wim and Palenstijn, Willem Jan and Cant, \ + Jeroen and Janssens, Eline and Bleichrodt, Folkert and \ + Dabravolski, Andrei and De Beenhouwer, Jan and Batenburg, K Joost\ + and Sijbers, Jan},\n" + + "journal={Optics Express},\n" + + "volume={24},\n" + + "number={22},\n" + + "pages={25129--25147},\n" + + "year={2016},\n" + + "publisher={Optical Society of America}\n" + + "}") + cite_info1.endnote = \ + ("%0 Journal Article\n" + + "%T Fast and flexible X-ray tomography using the ASTRA \ + toolbox\n" + + "%A van Aarle, Wim\n" + + "%A Palenstijn, Willem Jan\n" + + "%A Cant, Jeroen\n" + + "%A Janssens, Eline\n" + + "%A Bleichrodt, Folkert\n" + + "%A Dabravolski, Andrei\n" + + "%A De Beenhouwer, Jan\n" + + "%A Batenburg, K Joost\n" + + "%A Sijbers, Jan\n" + + "%J Optics Express\n" + + "%V 24\n" + + "%N 22\n" + + "%P 25129-25147\n" + + "%@ 1094-4087\n" + + "%D 2016\n" + + "%I Optical Society of America\n") + cite_info1.doi = "doi: 10.1364/OE.24.025129" + + cite_info2 = CitationInformation() + cite_info2.name = 'citation2' + cite_info2.description = \ + ("The tomography reconstruction algorithm used in this processing \ + pipeline is part of the ASTRA Toolbox") + cite_info2.bibtex = \ + ("@article{van2015astra,\n" + + "title={The ASTRA Toolbox: A platform for advanced algorithm \ + development in electron tomography},\n" + + "author={van Aarle, Wim and Palenstijn, Willem Jan and \ + De Beenhouwer, Jan and Altantzis, Thomas and Bals, Sara and \ + Batenburg, K Joost and Sijbers, Jan},\n" + + "journal={Ultramicroscopy},\n" + + "volume={157},\n" + + "pages={35--47},\n" + + "year={2015},\n" + + "publisher={Elsevier}\n" + + "}") + cite_info2.endnote = \ + ("%0 Journal Article\n" + + "%T Numerical removal of ring artifacts in microtomography\n" + + "%A Raven, Carsten\n" + + "%J Review of scientific instruments\n" + + "%V 69\n" + + "%N 8\n" + + "%P 2978-2980\n" + + "%@ 0034-6748\n" + + "%D 1998\n" + + "%I AIP Publishing") + cite_info2.doi = "doi: 10.1364/OE.24.025129" + + return [cite_info1, cite_info2] diff --git a/savu/plugins/reconstructions/base_recon.py b/savu/plugins/reconstructions/base_recon.py index cccb6cde5..8b4aefd8e 100644 --- a/savu/plugins/reconstructions/base_recon.py +++ b/savu/plugins/reconstructions/base_recon.py @@ -35,6 +35,7 @@ class BaseRecon(Plugin): :u*param centre_of_rotation: Centre of rotation to use for the \ reconstruction. Default: 0.0. + :u*param init_vol: Dataset to use as volume initialiser \ (doesn't currently work with preview). Default: None. @@ -53,14 +54,19 @@ class BaseRecon(Plugin): :u*param log: Take the log of the data before reconstruction \ (True or False). Default: True. + :u*param preview: A slice list of required frames. Default: []. + :param force_zero: Set any values in the reconstructed image outside of \ this range to zero. Default: [None, None]. - to zero. Default: False. - :param ratio: Ratio of the m2asks diameter in pixels to the smallest edge\ - size along given axis. Default: 0.95. + + :param ratio: Ratio between the diameter of a circle mask and the width of\ + a reconstructed image. If passed as a list or tuple, the second value is \ + assigned to the outer mask area, e.g [0.95, 0.0]. Default: 0.95. + :param log_func: Override the default log \ function. Default: 'np.nan_to_num(-np.log(sino))'. + :param vol_shape: Override the size of the reconstruction volume with an \ integer value. Default: 'fixed'. """ @@ -96,13 +102,13 @@ def base_pre_process(self): self.main_dir = in_data[0].get_data_patterns()['SINOGRAM']['main_dir'] self.angles = in_meta_data.get('rotation_angle') - if len(self.angles.shape) is not 1: + if len(self.angles.shape) != 1: self.scan_dim = in_data[0].get_data_dimension_by_axis_label('scan') self.slice_dirs = out_data[0].get_slice_dimensions() shape = in_pData[0].get_shape() factor = self.__get_outer_pad() - self.sino_pad = int(math.ceil(factor*shape[self.pad_dim])) + self.sino_pad = int(math.ceil(factor * shape[self.pad_dim])) self.sino_func, self.cor_func = self.set_function(shape) if \ self.padding_alg else self.set_function(False) @@ -111,9 +117,10 @@ def base_pre_process(self): self.fix_sino = self.get_sino_centre_method() def __get_outer_pad(self): - factor = math.sqrt(2)-1 # length of diagonal of square is side*sqrt(2) + # length of diagonal of square is side*sqrt(2) + factor = math.sqrt(2) - 1 pad = self.parameters['outer_pad'] if 'outer_pad' in \ - self.parameters.keys() else False + list(self.parameters.keys()) else False if pad is not False and not self.padding_alg: msg = 'This reconstruction algorithm cannot be padded.' @@ -133,7 +140,7 @@ def __set_padding_alg(self): """ Determine if this is an algorithm that allows sinogram padding. """ pad_algs = self.get_padding_algorithms() alg = self.parameters['algorithm'] if 'algorithm' in \ - self.parameters.keys() else None + list(self.parameters.keys()) else None self.padding_alg = True if alg in pad_algs else False def get_vol_shape(self): @@ -143,7 +150,7 @@ def set_centre_of_rotation(self, inData, mData, pData): # if cor has been passed as a dataset then do nothing if isinstance(self.parameters['centre_of_rotation'], str): return - if 'centre_of_rotation' in mData.get_dictionary().keys(): + if 'centre_of_rotation' in list(mData.get_dictionary().keys()): cor = self.__set_cor_from_meta_data(mData, inData) else: val = self.parameters['centre_of_rotation'] @@ -152,11 +159,12 @@ def set_centre_of_rotation(self, inData, mData, pData): else: sdirs = inData.get_slice_dimensions() cor = np.ones(np.prod([inData.get_shape()[i] for i in sdirs])) - # if centre of rotation has not been set then fix it in the centre + # if centre of rotation has not been set then fix it in the + # centre val = val if val != 0 else \ - (self.get_vol_shape()[self._get_detX_dim()])/2 + (self.get_vol_shape()[self._get_detX_dim()]) / 2.0 cor *= val - #mData.set('centre_of_rotation', cor) see Github ticket + # mData.set('centre_of_rotation', cor) see Github ticket self.cor = cor self.centre = self.cor[0] @@ -165,30 +173,30 @@ def __set_cor_from_meta_data(self, mData, inData): sdirs = inData.get_slice_dimensions() total_frames = np.prod([inData.get_shape()[i] for i in sdirs]) if total_frames > len(cor): - cor = np.tile(cor, total_frames/len(cor)) + cor = np.tile(cor, total_frames / len(cor)) return cor def __polyfit_cor(self, cor_dict, inData): - if 'detector_y' in inData.meta_data.get_dictionary().keys(): + if 'detector_y' in list(inData.meta_data.get_dictionary().keys()): y = inData.meta_data.get('detector_y') else: yDim = inData.get_data_dimension_by_axis_label('detector_y') y = np.arange(inData.get_shape()[yDim]) - z = np.polyfit(map(int, cor_dict.keys()), cor_dict.values(), 1) + z = np.polyfit(list(map(int, list(cor_dict.keys()))), list(cor_dict.values()), 1) p = np.poly1d(z) cor = p(y) return cor def set_function(self, pad_shape): if not pad_shape: - cor_func = lambda cor: cor + def cor_func(cor): return cor if self.parameters['log']: sino_func = self.__make_lambda() else: sino_func = self.__make_lambda(log=False) else: - cor_func = lambda cor: cor + self.sino_pad + def cor_func(cor): return cor + self.sino_pad if self.parameters['log']: sino_func = self.__make_lambda(pad=pad_shape) else: @@ -196,19 +204,16 @@ def set_function(self, pad_shape): return sino_func, cor_func def __make_lambda(self, log=True, pad=False): - log_func = 'np.nan_to_num(sino)' if not log else \ - self.parameters['log_func'] + log_func = 'np.nan_to_num(sino)' if not log else self.parameters['log_func'] if pad: pad_tuples, mode = self.__get_pad_values(pad) log_func = log_func.replace( 'sino', 'np.pad(sino, %s, "%s")' % (pad_tuples, mode)) - func = "f = lambda sino: " + log_func - exec(func) - return f + return eval("lambda sino: " + log_func) def __get_pad_values(self, pad_shape): mode = 'edge' - pad_tuples = [(0, 0)]*(len(pad_shape)-1) + pad_tuples = [(0, 0)] * (len(pad_shape) - 1) pad_tuples.insert(self.pad_dim, (self.sino_pad, self.sino_pad)) pad_tuples = tuple(pad_tuples) return pad_tuples, mode @@ -227,7 +232,7 @@ def base_process_frames_before(self, data): dim_sl = sl[self.main_dir] if self.cor_as_dataset: - self.frame_cors = self.cor_func(data[len(data)-1]) + self.frame_cors = self.cor_func(data[len(data) - 1]) else: frame_nos = \ self.get_plugin_in_datasets()[0].get_current_frame_idx() @@ -240,14 +245,14 @@ def base_process_frames_before(self, data): len_data = len(np.arange(dim_sl.start, dim_sl.stop, dim_sl.step)) - missing = [self.centre]*(len(self.frame_cors) - len_data) + missing = [self.centre] * (len(self.frame_cors) - len_data) self.frame_cors = np.append(self.frame_cors, missing) - + # fix to remove NaNs in the initialised image if init is not None: init[np.isnan(init)] == 0.0 self.frame_init_data = init - + data[0] = self.fix_sino(self.sino_func(data[0]), self.frame_cors[0]) return data @@ -268,7 +273,7 @@ def pad_sino(self, sino, cor): detX = self._get_detX_dim() pad = self.get_centre_offset(sino, cor, detX) self.cor_shift = pad[0] - pad_tuples = [(0, 0)]*(len(sino.shape)-1) + pad_tuples = [(0, 0)] * (len(sino.shape) - 1) pad_tuples.insert(detX, tuple(pad)) self.__set_pad_amount(max(pad)) return np.pad(sino, tuple(pad_tuples), mode='edge') @@ -281,8 +286,7 @@ def get_centre_offset(self, sino, cor, detX): centre_pad = self.br_array_pad(cor, sino.shape[detX]) sino_width = sino.shape[detX] new_width = sino_width + max(centre_pad) - sino_pad = \ - int(math.ceil(float(sino_width)/new_width * self.sino_pad)/2) + sino_pad = int(math.ceil(float(sino_width) / new_width * self.sino_pad) // 2) pad = np.array([sino_pad]*2) + centre_pad return pad @@ -295,7 +299,7 @@ def crop_sino(self, sino, cor): detX = self._get_detX_dim() start, stop = self.br_array_pad(cor, sino.shape[detX])[::-1] self.cor_shift = -start - sl = [slice(None)]*len(sino.shape) + sl = [slice(None)] * len(sino.shape) sl[detX] = slice(start, sino.shape[detX] - stop) sino = sino[tuple(sl)] self.set_mask(sino.shape) @@ -305,8 +309,8 @@ def br_array_pad(self, ctr, nPixels): width = nPixels - 1.0 alen = ctr blen = width - ctr - mid = (width-1.0)/2.0 - shift = round(abs(blen-alen)) + mid = (width - 1.0) / 2.0 + shift = round(abs(blen - alen)) p_low = 0 if (ctr > mid) else shift p_high = shift + 0 if (ctr > mid) else 0 return np.array([int(p_low), int(p_high)]) @@ -317,7 +321,7 @@ def keep_sino(self, sino, cor): def get_sino_centre_method(self): centre_pad = self.keep_sino - if 'centre_pad' in self.parameters.keys(): + if 'centre_pad' in list(self.parameters.keys()): cpad = self.parameters['centre_pad'] if not (cpad is True or cpad is False): raise Exception('Unknown value for "centre_pad", please choose' @@ -339,7 +343,7 @@ def get_fov_fraction(self, sino, cor): detX = pData.get_data_dimension_by_axis_label('x', contains=True) original_length = sino.shape[detX] shift = self.get_centre_shift(sino, cor) - return (original_length-shift)/float(original_length) + return (original_length - shift) / float(original_length) def get_reconstruction_alg(self): return None @@ -386,42 +390,29 @@ def setup(self): self.preview_flag = \ self.set_preview(in_dataset[0], self.parameters['preview']) - axis_labels = in_dataset[0].data_info.get('axis_labels')[0] - - dim_volX, dim_volY, dim_volZ = \ - self.map_volume_dimensions(in_dataset[0]) - - axis_labels = [0]*3 - axis_labels = {in_dataset[0]: - [str(dim_volX) + '.voxel_x.voxels', - str(dim_volY) + '.voxel_y.voxels', - str(dim_volZ) + '.voxel_z.voxels']} - - shape = list(in_dataset[0].get_shape()) - if self.parameters['vol_shape'] == 'fixed': - shape[dim_volX] = shape[dim_volZ] - else: - shape[dim_volX] = self.parameters['vol_shape'] - shape[dim_volZ] = self.parameters['vol_shape'] - - if 'resolution' in self.parameters.keys(): - shape[dim_volX] /= self.parameters['resolution'] - shape[dim_volZ] /= self.parameters['resolution'] + self._set_volume_dimensions(in_dataset[0]) + axis_labels = self._get_axis_labels(in_dataset[0]) + shape = self._get_shape(in_dataset[0]) - out_dataset[0].create_dataset(axis_labels=axis_labels, - shape=tuple(shape)) - out_dataset[0].add_volume_patterns(dim_volX, dim_volY, dim_volZ) + # output dataset + out_dataset[0].create_dataset(axis_labels=axis_labels, shape=shape) + out_dataset[0].add_volume_patterns(*self._get_volume_dimensions()) # set information relating to the plugin data in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('SINOGRAM', self.get_max_frames()) + self.init_vol = 1 if 'init_vol' in list(self.parameters.keys()) and\ + self.parameters['init_vol'] else 0 + self.cor_as_dataset = 1 if isinstance( + self.parameters['centre_of_rotation'], str) else 0 + + for i in range(len(in_dataset) - self.init_vol - self.cor_as_dataset): + in_pData[i].plugin_data_setup('SINOGRAM', self.get_max_frames(), + slice_axis=self.get_slice_axis()) + idx = 1 - idx = 1 # initial volume dataset - if 'init_vol' in self.parameters.keys() and \ - self.parameters['init_vol']: - self.init_vol = True + if self.init_vol: # from savu.data.data_structures.data_types import Replicate # if self.rep_dim: # in_dataset[idx].data = Replicate( @@ -430,34 +421,98 @@ def setup(self): idx += 1 # cor dataset - if isinstance(self.parameters['centre_of_rotation'], str): + if self.cor_as_dataset: self.cor_as_dataset = True in_pData[idx].plugin_data_setup('METADATA', self.get_max_frames()) # set pattern_name and nframes to process for all datasets out_pData[0].plugin_data_setup('VOLUME_XZ', self.get_max_frames()) - def get_max_frames(self): - return 'multiple' + def _get_axis_labels(self, in_dataset): + """ + Get the new axis labels for the output dataset - this is now a volume. + + Parameters + ---------- + in_dataset : :class:`savu.data.data_structures.data.Data` + The input dataset to the plugin. - def map_volume_dimensions(self, data): + Returns + ------- + labels : dict + The axis labels for the dataset that is output from the plugin. + + """ + labels = in_dataset.data_info.get('axis_labels')[0] + volX, volY, volZ = self._get_volume_dimensions() + labels = [str(volX) + '.voxel_x.voxels', str(volZ) + '.voxel_z.voxels'] + if volY: + labels.append(str(volY) + '.voxel_y.voxels') + labels = {in_dataset: labels} + return labels + + def _set_volume_dimensions(self, data): + """ + Map the input dimensions to the output volume dimensions + + Parameters + ---------- + in_dataset : :class:`savu.data.data_structures.data.Data` + The input dataset to the plugin. + """ data._finalise_patterns() - dim_rotAngle = data.get_data_patterns()['PROJECTION']['main_dir'] - sinogram = data.get_data_patterns()['SINOGRAM'] - dim_detY = sinogram['main_dir'] + self.volX = data.get_data_dimension_by_axis_label("rotation_angle") + self.volZ = data.get_data_dimension_by_axis_label("x", contains=True) + self.volY = data.get_data_dimension_by_axis_label( + "y", contains=True, exists=True) + + def _get_volume_dimensions(self): + return self.volX, self.volY, self.volZ + + def _get_shape(self, in_dataset): + shape = list(in_dataset.get_shape()) + volX, volY, volZ = self._get_volume_dimensions() + + if self.parameters['vol_shape'] in ('auto', 'fixed'): + shape[volX] = shape[volZ] + else: + shape[volX] = self.parameters['vol_shape'] + shape[volZ] = self.parameters['vol_shape'] + + if 'resolution' in self.parameters.keys(): + shape[volX] /= self.parameters['resolution'] + shape[volZ] /= self.parameters['resolution'] + return tuple(shape) - core_dirs = sinogram['core_dims'] - dim_detX = list(set(core_dirs).difference(set((dim_rotAngle,))))[0] + def get_max_frames(self): + """ + Number of data frames to pass to each instance of process_frames func - dim_volX = dim_rotAngle - dim_volY = dim_detY - dim_volZ = dim_detX - return dim_volX, dim_volY, dim_volZ + Returns + ------- + str or int + "single", "multiple" or integer (only to be used if the number of + frames MUST be fixed.) + """ + return 'multiple' + + def get_slice_axis(self): + """ + Fix the fastest changing slice dimension + + Returns + ------- + str or None + str should be the axis_label corresponding to the fastest changing + dimension + + """ + return None def nInput_datasets(self): nIn = 1 if 'init_vol' in self.parameters.keys() and \ - self.parameters['init_vol']: + self.parameters['init_vol']: if len(self.parameters['init_vol'].split('.')) == 3: name, temp, self.rep_dim = self.parameters['init_vol'] self.parameters['init_vol'] = name @@ -465,7 +520,7 @@ def nInput_datasets(self): self.parameters['in_datasets'].append(self.parameters['init_vol']) if isinstance(self.parameters['centre_of_rotation'], str): self.parameters['in_datasets'].append( - self.parameters['centre_of_rotation']) + self.parameters['centre_of_rotation']) nIn += 1 return nIn diff --git a/savu/plugins/reconstructions/ccpi_cgls_recon.py b/savu/plugins/reconstructions/ccpi_cgls_recon.py deleted file mode 100644 index f4d90f21d..000000000 --- a/savu/plugins/reconstructions/ccpi_cgls_recon.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: cgls_recon - :platform: Unix - :synopsis: Wrapper around the CCPi cgls reconstruction algorithm. - -.. moduleauthor:: Nicola Wadeson - -""" - -import logging -import numpy as np - -from ccpi.reconstruction.parallelbeam import alg as ccpi_alg - -from savu.plugins.utils import register_plugin -from savu.plugins.driver.cpu_plugin import CpuPlugin -from savu.plugins.reconstructions.base_recon import BaseRecon - - -@register_plugin -class CcpiCglsRecon(BaseRecon, CpuPlugin): - """ - A Plugin to run the CCPi implementation of the CGLS reconstruction \ - algorithm. - - :u*param n_iterations: Number of iterations. Default: 5. - :u*param resolution: number of output voxels (res = n_pixels/n_voxels), \ - set res > 1 for reduced resolution. Default: 1. - :param n_frames: This algorithm requires a multiple of 8 frames for \ - processing and this number may affect performance depending on your data \ - size (choose from 8, 16, 24, 32). Default: 16. - - :~param centre_pad: Not an option. Default: False. - :*param outer_pad: Not an option. Default: False. - :*param init_vol: Not an option. Default: None. - :*param enforce_positive: Not an option. Default: False. - """ - - def __init__(self): - super(CcpiCglsRecon, self).__init__("CcpiCglsRecon") - - def pre_process(self): - self.n_iters = self.parameters['n_iterations'] - self.res = self.parameters['resolution'] - in_data = self.get_in_datasets()[0] - in_pData = self.get_plugin_in_datasets()[0] - det_x = in_pData.get_data_dimension_by_axis_label('detector_x') - self.width = in_data.get_shape()[det_x] - - def process_frames(self, data): - sino = data[0] - cors, angles, vol_shape, init = self.get_frame_params() - - voxels = ccpi_alg.cgls(sino.astype(np.float32), - angles.astype(np.float32), cors[0], - self.res, self.n_iters, 1, - self.parameters['log']) - - # need to get left and right shift and crop - pad_start, pad_end = self.array_pad(cors[0], self.width) - return np.transpose(voxels[pad_start:pad_end, pad_start:pad_end, :], (0, 2, 1)) - - def array_pad(self, ctr, nPixels): - width = nPixels - 1.0 - alen = ctr - blen = width - ctr - mid = (width-1.0)/2.0 - shift = round(abs(blen-alen)) - p_low = 0 if (ctr > mid) else shift - p_high = shift + 0 if (ctr > mid) else 0 - pad = max(p_low, p_high) - if pad == 0: - return 0, -1 - return int(pad/2-1), int(-np.ceil(pad/2.0)) - - def get_max_frames(self): - # this algorithm requires a multiple of 8 frames - default = 16 - n_frames = self.parameters['n_frames'] - if n_frames % 8 != 0: - n_frames = default - logging.warn('incorrect number of frames requested for cgls_recon,' - ' using %s', default) - return n_frames diff --git a/savu/plugins/reconstructions/scikitimage_filter_back_projection.py b/savu/plugins/reconstructions/scikitimage_filter_back_projection.py index d93c16bff..6f94f9f7c 100644 --- a/savu/plugins/reconstructions/scikitimage_filter_back_projection.py +++ b/savu/plugins/reconstructions/scikitimage_filter_back_projection.py @@ -61,7 +61,7 @@ def __init__(self): self).__init__("ScikitimageFilterBackProjection") def _shift(self, sinogram, centre_of_rotation): - centre_of_rotation_shift = (sinogram.shape[0]/2) - centre_of_rotation + centre_of_rotation_shift = (sinogram.shape[0] // 2) - centre_of_rotation result = ndimage.interpolation.shift(sinogram, (centre_of_rotation_shift, 0)) return result diff --git a/savu/plugins/reconstructions/scikitimage_sart.py b/savu/plugins/reconstructions/scikitimage_sart.py index ad4bf5664..463493901 100644 --- a/savu/plugins/reconstructions/scikitimage_sart.py +++ b/savu/plugins/reconstructions/scikitimage_sart.py @@ -79,8 +79,7 @@ def __init__(self): super(ScikitimageSart, self).__init__("ScikitimageSart") def _shift(self, sinogram, centre_of_rotation): - centre_of_rotation_shift = (sinogram.shape[0]/2) - \ - float(centre_of_rotation) + centre_of_rotation_shift = (sinogram.shape[0] // 2) - float(centre_of_rotation) return ndimage.interpolation.shift(sinogram, centre_of_rotation_shift) def process_frames(self, data): @@ -101,7 +100,7 @@ def process_frames(self, data): circle=False) # self.parameters[False]) for i in range(self.parameters["iterations"]): - print "Iteration %i" % i + print("Iteration %i" % i) result = transform.iradon_sart(sino, theta=theta, image=result, # self.parameters['result'], projection_shifts=None, diff --git a/savu/plugins/reconstructions/simple_recon.py b/savu/plugins/reconstructions/simple_recon.py index 800ed4138..d1409448e 100644 --- a/savu/plugins/reconstructions/simple_recon.py +++ b/savu/plugins/reconstructions/simple_recon.py @@ -41,7 +41,7 @@ def __init__(self): def _filter(self, sinogram): ff = np.arange(sinogram.shape[0]) - ff -= sinogram.shape[0]/2 + ff -= sinogram.shape[0] // 2 ff = np.abs(ff) fs = np.fft.fft(sinogram) ffs = fs*ff @@ -62,8 +62,8 @@ def process_frames(self, data): sinogram = sino[:, np.newaxis, :] try: centre = self.kwargs['centre'] - except: - centre = (vol_shape[0]/2, vol_shape[1]/2) + except Exception: + centre = (vol_shape[0] // 2, vol_shape[1] // 2) results = [] for j in range(sinogram.shape[1]): diff --git a/savu/plugins/reconstructions/tomobar/tomobar_recon.py b/savu/plugins/reconstructions/tomobar/tomobar_recon.py index d7fb22d1e..c3693e408 100644 --- a/savu/plugins/reconstructions/tomobar/tomobar_recon.py +++ b/savu/plugins/reconstructions/tomobar/tomobar_recon.py @@ -16,7 +16,7 @@ .. module:: tomobar_recon :platform: Unix :synopsis: A wrapper around TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software \ - for advanced iterative image reconstruction + for advanced iterative image reconstruction (2D case) using GPU .. moduleauthor:: Daniil Kazantsev """ @@ -29,26 +29,24 @@ from tomobar.methodsIR import RecToolsIR from savu.plugins.utils import register_plugin -from scipy import ndimage @register_plugin class TomobarRecon(BaseRecon, GpuPlugin): """ - A Plugin to reconstruct full-field tomographic projection data using state-of-the-art regularised iterative algorithms from \ + A GPU plugin to reconstruct full-field tomographic projection data using state-of-the-art regularised iterative algorithms from \ the ToMoBAR package. ToMoBAR includes FISTA and ADMM iterative methods and depends on the ASTRA toolbox and the CCPi RGL toolkit: \ https://github.com/vais-ral/CCPi-Regularisation-Toolkit. :param output_size: Number of rows and columns in the \ reconstruction. Default: 'auto'. - :param data_fidelity: Data fidelity, chosoe Least Squares only at the moment. Default: 'LS'. + :param data_fidelity: Data fidelity, choose LS, PWLS, SWLS or KL. Default: 'LS'. :param data_Huber_thresh: Threshold parameter for __Huber__ data fidelity . Default: None. - :param data_any_rings: a parameter to suppress various artifacts including rings and streaks. Default: None. - :param data_any_rings_winsizes: half window sizes to collect background information [detector, angles, num of projections]. Default: (9,7,0). - :param data_any_rings_power: a power parameter for Huber model. Default: 1.5. + :param data_beta_SWLS: A parameter for stripe-weighted model. Default: 0.1. :param data_full_ring_GH: Regularisation variable for full constant ring removal (GH model). Default: None. :param data_full_ring_accelerator_GH: Acceleration constant for GH ring removal. Default: 10.0. :param algorithm_iterations: Number of outer iterations for FISTA (default) or ADMM methods. Default: 20. :param algorithm_verbose: print iterations number and other messages ('off' by default). Default: 'off'. + :param algorithm_mask: set to 1.0 to enable a circular mask diameter or < 1.0 to shrink the mask. Default: 1.0. :param algorithm_ordersubsets: The number of ordered-subsets to accelerate reconstruction. Default: 6. :param algorithm_nonnegativity: ENABLE or DISABLE nonnegativity constraint. Default: 'ENABLE'. :param regularisation_method: To regularise choose methods ROF_TV, FGP_TV, PD_TV, SB_TV, LLT_ROF,\ @@ -56,7 +54,6 @@ class TomobarRecon(BaseRecon, GpuPlugin): :param regularisation_parameter: Regularisation (smoothing) value, higher \ the value stronger the smoothing effect. Default: 0.00001. :param regularisation_iterations: The number of regularisation iterations. Default: 80. - :param regularisation_device: The number of regularisation iterations. Default: 'gpu'. :param regularisation_PD_lip: Primal-dual parameter for convergence. Default: 8. :param regularisation_methodTV: 0/1 - TV specific isotropic/anisotropic choice. Default: 0. :param regularisation_timestep: Time marching parameter, relevant for \ @@ -69,30 +66,31 @@ class TomobarRecon(BaseRecon, GpuPlugin): def __init__(self): super(TomobarRecon, self).__init__("TomobarRecon") - def _shift(self, sinogram, centre_of_rotation): - centre_of_rotation_shift = (sinogram.shape[0]/2) - centre_of_rotation - result = ndimage.interpolation.shift(sinogram, - (centre_of_rotation_shift, 0)) - return result - def pre_process(self): # extract given parameters into dictionaries suitable for ToMoBAR input + """ + # current parameters not fully working yet + :param data_any_rings: a parameter to suppress various artifacts including rings and streaks. Default: None. + :param data_any_rings_winsizes: half window sizes to collect background information [detector, angles, num of projections]. Default: (9,7,0). + :param data_any_rings_power: a power parameter for Huber model. Default: 1.5. + 'ring_weights_threshold' : self.parameters['data_any_rings'], + 'ring_tuple_halfsizes' : self.parameters['data_any_rings_winsizes'], + 'ring_huber_power' : self.parameters['data_any_rings_power'], + """ self._data_ = {'OS_number' : self.parameters['algorithm_ordersubsets'], 'huber_threshold' : self.parameters['data_Huber_thresh'], - 'ring_weights_threshold' : self.parameters['data_any_rings'], - 'ring_tuple_halfsizes' : self.parameters['data_any_rings_winsizes'], - 'ring_huber_power' : self.parameters['data_any_rings_power'], 'ringGH_lambda' : self.parameters['data_full_ring_GH'], 'ringGH_accelerate' : self.parameters['data_full_ring_accelerator_GH']} self._algorithm_ = {'iterations' : self.parameters['algorithm_iterations'], - 'nonnegativity' : self.parameters['algorithm_nonnegativity'], + 'nonnegativity' : self.parameters['algorithm_nonnegativity'], + 'mask_diameter' : self.parameters['algorithm_mask'], 'verbose' : self.parameters['algorithm_verbose']} self._regularisation_ = {'method' : self.parameters['regularisation_method'], 'regul_param' : self.parameters['regularisation_parameter'], 'iterations' : self.parameters['regularisation_iterations'], - 'device_regulariser' : self.parameters['regularisation_device'], + 'device_regulariser' : 'gpu', 'edge_threhsold' : self.parameters['regularisation_edge_thresh'], 'time_marching_step' : self.parameters['regularisation_timestep'], 'regul_param2' : self.parameters['regularisation_parameter2'], @@ -101,32 +99,40 @@ def pre_process(self): 'methodTV' : self.parameters['regularisation_methodTV']} def process_frames(self, data): - centre_of_rotations, angles, self.vol_shape, init = self.get_frame_params() + cor, angles, self.vol_shape, init = self.get_frame_params() sinogram = data[0].astype(np.float32) anglesTot, self.DetectorsDimH = np.shape(sinogram) + half_det_width = 0.5*self.DetectorsDimH + cor_astra = half_det_width - cor self.anglesRAD = np.deg2rad(angles.astype(np.float32)) self._data_.update({'projection_norm_data' : sinogram}) - """ - # if one selects PWLS model and provides raw input data - if (self.parameters['data_fidelity'] == 'PWLS'): - rawdata = data[1].astype(np.float32) - rawdata /= np.max(rawdata) - self._data_.update({'projection_raw_data' : rawdata}) - """ + + # if one selects PWLS or SWLS models then raw data is also required (2 inputs) + if ((self.parameters['data_fidelity'] == 'PWLS') or (self.parameters['data_fidelity'] == 'SWLS')): + rawdata = data[1].astype(np.float32) + rawdata /= np.max(rawdata) + self._data_.update({'projection_raw_data' : rawdata}) + self._data_.update({'beta_SWLS' : self.parameters['data_beta_SWLS']*np.ones(self.DetectorsDimH)}) # set parameters and initiate the ToMoBAR class object self.Rectools = RecToolsIR(DetectorsDimH = self.DetectorsDimH, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = None, # DetectorsDimV # detector dimension (vertical) for 3D case only - CenterRotOffset = None, # Center of Rotation (CoR) scalar (for 3D case only) - AnglesVec = self.anglesRAD, # array of angles in radians + CenterRotOffset = cor_astra.item() - 0.5, # The center of rotation (CoR) scalar or a vector + AnglesVec = self.anglesRAD, # the vector of angles in radians ObjSize = self.vol_shape[0] , # a scalar to define the reconstructed object dimensions - datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS, PWLS + datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS, PWLS, SWLS device_projector='gpu') # Run FISTA reconstrucion algorithm here recon = self.Rectools.FISTA(self._data_, self._algorithm_, self._regularisation_) return recon + def nInput_datasets(self): + return max(len(self.parameters['in_datasets']), 1) + + def nOutput_datasets(self): + return 1 + def get_max_frames(self): return 'single' diff --git a/savu/plugins/reconstructions/tomobar/tomobar_recon_3D.py b/savu/plugins/reconstructions/tomobar/tomobar_recon_3D.py index 4acf54bba..9136e22d6 100644 --- a/savu/plugins/reconstructions/tomobar/tomobar_recon_3D.py +++ b/savu/plugins/reconstructions/tomobar/tomobar_recon_3D.py @@ -13,12 +13,11 @@ # limitations under the License. """ -.. module:: Tomographic Model-Based Reconstruction module for an approximated (faster) 3D reconstruction +.. module:: tomobar_recon_3D :platform: Unix :synopsis: A wrapper around TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software \ for advanced iterative image reconstruction using _3D_ capabilities of regularisation. \ - This plugin will crop the 3D projection data into subsets with some padding of each cropped\ - volume. + This plugin will divide 3D projection data into overalpped subsets using padding, which maskes it fast (GPU driver). .. moduleauthor:: Daniil Kazantsev """ @@ -31,6 +30,7 @@ from tomobar.methodsIR import RecToolsIR from savu.plugins.utils import register_plugin + @register_plugin class TomobarRecon3d(BaseRecon, GpuPlugin): """ @@ -40,19 +40,18 @@ class TomobarRecon3d(BaseRecon, GpuPlugin): :param output_size: The dimension of the reconstructed volume (only X-Y dimension). Default: 'auto'. :param padding: The amount of pixels to pad each slab of the cropped projection data. Default: 17. - :param data_fidelity: Data fidelity, Least Squares only at the moment. Default: 'LS'. + :param data_fidelity: Data fidelity, choose LS, PWLS, SWLS or KL. Default: 'LS'. :param data_Huber_thresh: Threshold parameter for __Huber__ data fidelity . Default: None. - :param data_any_rings: a parameter to suppress various artifacts including rings and streaks. Default: None. - :param data_any_rings_winsizes: half window sizes to collect background information [detector, angles, num of projections]. Default: (9,7,9). - :param data_any_rings_power: a power parameter for Huber model. Default: 1.5. + :param data_beta_SWLS: A parameter for stripe-weighted model. Default: 0.1. :param data_full_ring_GH: Regularisation variable for full constant ring removal (GH model). Default: None. :param data_full_ring_accelerator_GH: Acceleration constant for GH ring removal. Default: 10.0. :param algorithm_iterations: Number of outer iterations for FISTA (default) or ADMM methods. Default: 20. :param algorithm_verbose: print iterations number and other messages ('off' by default). Default: 'off'. + :param algorithm_mask: set to 1.0 to enable a circular mask diameter or < 1.0 to shrink the mask. Default: 1.0. :param algorithm_ordersubsets: The number of ordered-subsets to accelerate reconstruction. Default: 6. :param algorithm_nonnegativity: ENABLE or DISABLE nonnegativity constraint. Default: 'ENABLE'. :param regularisation_method: To regularise choose methods ROF_TV, FGP_TV, PD_TV, SB_TV, LLT_ROF,\ - NDF, TGV, Diff4th. Default: 'FGP_TV'. + NDF, TGV, NLTV, Diff4th. Default: 'FGP_TV'. :param regularisation_parameter: Regularisation (smoothing) value, higher \ the value stronger the smoothing effect. Default: 0.00001. :param regularisation_iterations: The number of regularisation iterations. Default: 80. @@ -87,90 +86,36 @@ def set_filter_padding(self, in_pData, out_pData): out_pData[0].padding = pad_dict def setup(self): - in_dataset, out_dataset = self.get_datasets() - # reduce the data as per data_subset parameter - self.preview_flag = \ - self.set_preview(in_dataset[0], self.parameters['preview']) - - axis_labels = in_dataset[0].data_info.get('axis_labels')[0] - - dim_volX, dim_volY, dim_volZ = \ - self.map_volume_dimensions(in_dataset[0]) - - axis_labels = {in_dataset[0]: - [str(dim_volX) + '.voxel_x.voxels', - str(dim_volY) + '.voxel_y.voxels', - str(dim_volZ) + '.voxel_z.voxels']} - - # specify reconstructed volume dimensions - self.output_size = self._get_output_size(in_dataset[0]) - shape = list(in_dataset[0].get_shape()) - rot_dim = in_dataset[0].get_data_dimension_by_axis_label( - 'rotation_angle') - detX_dim = in_dataset[0].get_data_dimension_by_axis_label('detector_x') - shape[rot_dim] = self.output_size - shape[detX_dim] = self.output_size - - # if there are only 3 dimensions then add a fourth for slicing -# if len(shape) == 2: -# axis_labels = [0]*3 -# axis_labels[dim_volX] = 'voxel_x.voxels' -# axis_labels[dim_volY] = 'voxel_y.voxels' -# axis_labels[dim_volZ] = 'voxel_z.voxels' -# axis_labels[3] = 'scan.number' -# shape.append(1) - - if self.parameters['vol_shape'] == 'fixed': - shape[dim_volX] = shape[dim_volZ] - else: - shape[dim_volX] = self.parameters['vol_shape'] - shape[dim_volZ] = self.parameters['vol_shape'] - - if 'resolution' in self.parameters.keys(): - shape[dim_volX] /= self.parameters['resolution'] - shape[dim_volZ] /= self.parameters['resolution'] - - out_dataset[0].create_dataset(axis_labels=axis_labels, - shape=tuple(shape)) - out_dataset[0].add_volume_patterns(dim_volX, dim_volY, dim_volZ) - - ndims = range(len(shape)) - core_dims = (dim_volX, dim_volY, dim_volZ) - slice_dims = tuple(set(ndims).difference(set(core_dims))) - out_dataset[0].add_pattern( - 'VOLUME_3D', core_dims=core_dims, slice_dims=slice_dims) - - # set information relating to the plugin data - in_pData, out_pData = self.get_plugin_datasets() - + in_dataset = self.get_in_datasets()[0] + self.parameters['vol_shape'] = self.parameters['output_size'] procs = self.exp.meta_data.get("processes") procs = len([i for i in procs if 'GPU' in i]) - dim = in_dataset[0].get_data_dimension_by_axis_label('detector_y') - nSlices = int(np.ceil(shape[dim]/float(procs))) - - in_pData[0].plugin_data_setup('SINOGRAM', nSlices, slice_axis='detector_y') - - # in_pData[1].plugin_data_setup('PROJECTION', nSlices) # (for PWLS) - - # set pattern_name and nframes to process for all datasets - out_pData[0].plugin_data_setup('VOLUME_XZ', nSlices) + dim = in_dataset.get_data_dimension_by_axis_label('detector_y') + nSlices = int(np.ceil(in_dataset.get_shape()[dim]/float(procs))) + self._set_max_frames(nSlices) + super(TomobarRecon3d, self).setup() def pre_process(self): in_pData = self.get_plugin_in_datasets()[0] + out_pData = self.get_plugin_out_datasets()[0] detY = in_pData.get_data_dimension_by_axis_label('detector_y') + # ! padding vertical detector ! self.Vert_det = in_pData.get_shape()[detY] + 2*self.pad - # extract given parameters into dictionaries suitable for ToMoBAR input + in_pData = self.get_plugin_in_datasets() + self.det_dimX_ind = in_pData[0].get_data_dimension_by_axis_label('detector_x') + self.det_dimY_ind = in_pData[0].get_data_dimension_by_axis_label('detector_y') + self.output_size = out_pData.get_shape()[self.det_dimX_ind] + + # extract given parameters into dictionaries suitable for ToMoBAR input self._data_ = {'OS_number' : self.parameters['algorithm_ordersubsets'], 'huber_threshold' : self.parameters['data_Huber_thresh'], - 'ring_weights_threshold' : self.parameters['data_any_rings'], - 'ring_tuple_halfsizes' : self.parameters['data_any_rings_winsizes'], - 'ring_huber_power' : self.parameters['data_any_rings_power'], 'ringGH_lambda' : self.parameters['data_full_ring_GH'], 'ringGH_accelerate' : self.parameters['data_full_ring_accelerator_GH']} self._algorithm_ = {'iterations' : self.parameters['algorithm_iterations'], - 'nonnegativity' : self.parameters['algorithm_nonnegativity'], + 'nonnegativity' : self.parameters['algorithm_nonnegativity'], + 'mask_diameter' : self.parameters['algorithm_mask'], 'verbose' : self.parameters['algorithm_verbose']} self._regularisation_ = {'method' : self.parameters['regularisation_method'], @@ -184,45 +129,58 @@ def pre_process(self): 'NDF_penalty' : self.parameters['regularisation_NDF_penalty'], 'methodTV' : self.parameters['regularisation_methodTV']} - in_pData = self.get_plugin_in_datasets() - self.det_dimX_ind = in_pData[0].get_data_dimension_by_axis_label('detector_x') - self.det_dimY_ind = in_pData[0].get_data_dimension_by_axis_label('detector_y') - def process_frames(self, data): - centre_of_rotations, angles, self.vol_shape, init = self.get_frame_params() + cor, angles, self.vol_shape, init = self.get_frame_params() self.anglesRAD = np.deg2rad(angles.astype(np.float32)) - self.centre_of_rotations = centre_of_rotations projdata3D = data[0].astype(np.float32) dim_tuple = np.shape(projdata3D) self.Horiz_det = dim_tuple[self.det_dimX_ind] - - #print(np.shape(projdata3D)) + half_det_width = 0.5*self.Horiz_det + cor_astra = half_det_width - cor[0] + projdata3D[projdata3D > 10**15] = 0.0 projdata3D =np.swapaxes(projdata3D,0,1) - # WIP for PWLS fidelity - # rawdata3D = data[1].astype(np.float32) - # rawdata3D =np.swapaxes(rawdata3D,0,1)/np.max(np.float32(rawdata3D)) + #print(f"Shape of projdata3D is {np.shape(projdata3D)}") self._data_.update({'projection_norm_data' : projdata3D}) + # if one selects PWLS or SWLS models then raw data is also required (2 inputs) + if ((self.parameters['data_fidelity'] == 'PWLS') or (self.parameters['data_fidelity'] == 'SWLS')): + rawdata3D = data[1].astype(np.float32) + rawdata3D[rawdata3D > 10**15] = 0.0 + rawdata3D = np.swapaxes(rawdata3D,0,1)/np.max(np.float32(rawdata3D)) + #print(f"Shape of rawdata3D is {np.shape(rawdata3D)}") + self._data_.update({'projection_raw_data' : rawdata3D}) + self._data_.update({'beta_SWLS' : self.parameters['data_beta_SWLS']*np.ones(self.Horiz_det)}) + # set parameters and initiate a TomoBar class object self.Rectools = RecToolsIR(DetectorsDimH = self.Horiz_det, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = self.Vert_det, # DetectorsDimV # detector dimension (vertical) for 3D case only - CenterRotOffset = 0.0, # Center of Rotation (CoR) scalar (for 3D case only) - AnglesVec = self.anglesRAD, # array of angles in radians + CenterRotOffset = cor_astra.item() - 0.5, # The center of rotation (CoR) scalar or a vector + AnglesVec = self.anglesRAD, # the vector of angles in radians ObjSize = self.output_size, # a scalar to define the reconstructed object dimensions - datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS + datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS, PWLS, SWLS device_projector='gpu') # Run FISTA reconstrucion algorithm here recon = self.Rectools.FISTA(self._data_, self._algorithm_, self._regularisation_) - recon = np.swapaxes(recon,0,1) + recon = np.swapaxes(recon, 0, 1) return recon def nInput_datasets(self): - return 1 + return max(len(self.parameters['in_datasets']), 1) + def nOutput_datasets(self): return 1 + def _set_max_frames(self, frames): + self._max_frames = frames + + def get_max_frames(self): + return self._max_frames + + def get_slice_axis(self): + return 'detector_y' + def get_citation_information(self): cite_info1 = CitationInformation() cite_info1.name = 'citation1' diff --git a/savu/plugins/reconstructions/tomobar/tomobar_recon_cpu.py b/savu/plugins/reconstructions/tomobar/tomobar_recon_cpu.py index abb3a06d8..ec58d6424 100644 --- a/savu/plugins/reconstructions/tomobar/tomobar_recon_cpu.py +++ b/savu/plugins/reconstructions/tomobar/tomobar_recon_cpu.py @@ -13,10 +13,10 @@ # limitations under the License. """ -.. module:: TomoBAR CPU reconstruction +.. module:: TomoBAR CPU 2D reconstruction :platform: Unix :synopsis: A wrapper around TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software \ - for advanced iterative image reconstruction using CPU + for advanced iterative image reconstruction using CPU (2D case) .. moduleauthor:: Daniil Kazantsev """ @@ -29,7 +29,6 @@ from tomobar.methodsIR import RecToolsIR from savu.plugins.utils import register_plugin -from scipy import ndimage @register_plugin class TomobarReconCpu(BaseRecon, CpuPlugin): @@ -40,15 +39,14 @@ class TomobarReconCpu(BaseRecon, CpuPlugin): :param output_size: Number of rows and columns in the \ reconstruction. Default: 'auto'. - :param data_fidelity: Data fidelity, Least Squares only at the moment. Default: 'LS'. + :param data_fidelity: Data fidelity, choose LS, PWLS, SWLS or KL. Default: 'LS'. :param data_Huber_thresh: Threshold parameter for __Huber__ data fidelity . Default: None. - :param data_any_rings: a parameter to suppress various artifacts including rings and streaks. Default: None. - :param data_any_rings_winsizes: half window sizes to collect background information [detector, angles, num of projections]. Default: (9,7,0). - :param data_any_rings_power: a power parameter for Huber model. Default: 1.5. + :param data_beta_SWLS: A parameter for stripe-weighted model. Default: 0.1. :param data_full_ring_GH: Regularisation variable for full constant ring removal (GH model). Default: None. :param data_full_ring_accelerator_GH: Acceleration constant for GH ring removal. Default: 10.0. :param algorithm_iterations: Number of outer iterations for FISTA (default) or ADMM methods. Default: 20. :param algorithm_verbose: print iterations number and other messages ('off' by default). Default: 'off'. + :param algorithm_mask: set to 1.0 to enable a circular mask diameter or < 1.0 to shrink the mask. Default: 1.0. :param algorithm_ordersubsets: The number of ordered-subsets to accelerate reconstruction. Default: 6. :param algorithm_nonnegativity: ENABLE or DISABLE nonnegativity constraint. Default: 'ENABLE'. :param regularisation_method: To regularise choose methods ROF_TV, FGP_TV, PD_TV, SB_TV, LLT_ROF,\ @@ -56,7 +54,6 @@ class TomobarReconCpu(BaseRecon, CpuPlugin): :param regularisation_parameter: Regularisation (smoothing) value, higher \ the value stronger the smoothing effect. Default: 0.00001. :param regularisation_iterations: The number of regularisation iterations. Default: 80. - :param regularisation_device: The number of regularisation iterations. Default: 'cpu'. :param regularisation_PD_lip: Primal-dual parameter for convergence. Default: 8. :param regularisation_methodTV: 0/1 - TV specific isotropic/anisotropic choice. Default: 0. :param regularisation_timestep: Time marching parameter, relevant for \ @@ -69,30 +66,31 @@ class TomobarReconCpu(BaseRecon, CpuPlugin): def __init__(self): super(TomobarReconCpu, self).__init__("TomobarReconCpu") - def _shift(self, sinogram, centre_of_rotation): - centre_of_rotation_shift = (sinogram.shape[0]/2) - centre_of_rotation - result = ndimage.interpolation.shift(sinogram, - (centre_of_rotation_shift, 0)) - return result - def pre_process(self): # extract given parameters into dictionaries suitable for ToMoBAR input + """ + # current parameters not fully working yet + :param data_any_rings: a parameter to suppress various artifacts including rings and streaks. Default: None. + :param data_any_rings_winsizes: half window sizes to collect background information [detector, angles, num of projections]. Default: (9,7,0). + :param data_any_rings_power: a power parameter for Huber model. Default: 1.5. + 'ring_weights_threshold' : self.parameters['data_any_rings'], + 'ring_tuple_halfsizes' : self.parameters['data_any_rings_winsizes'], + 'ring_huber_power' : self.parameters['data_any_rings_power'], + """ self._data_ = {'OS_number' : self.parameters['algorithm_ordersubsets'], 'huber_threshold' : self.parameters['data_Huber_thresh'], - 'ring_weights_threshold' : self.parameters['data_any_rings'], - 'ring_tuple_halfsizes' : self.parameters['data_any_rings_winsizes'], - 'ring_huber_power' : self.parameters['data_any_rings_power'], 'ringGH_lambda' : self.parameters['data_full_ring_GH'], 'ringGH_accelerate' : self.parameters['data_full_ring_accelerator_GH']} self._algorithm_ = {'iterations' : self.parameters['algorithm_iterations'], - 'nonnegativity' : self.parameters['algorithm_nonnegativity'], + 'nonnegativity' : self.parameters['algorithm_nonnegativity'], + 'mask_diameter' : self.parameters['algorithm_mask'], 'verbose' : self.parameters['algorithm_verbose']} self._regularisation_ = {'method' : self.parameters['regularisation_method'], 'regul_param' : self.parameters['regularisation_parameter'], 'iterations' : self.parameters['regularisation_iterations'], - 'device_regulariser' : self.parameters['regularisation_device'], + 'device_regulariser' : 'cpu', 'edge_threhsold' : self.parameters['regularisation_edge_thresh'], 'time_marching_step' : self.parameters['regularisation_timestep'], 'regul_param2' : self.parameters['regularisation_parameter2'], @@ -101,25 +99,40 @@ def pre_process(self): 'methodTV' : self.parameters['regularisation_methodTV']} def process_frames(self, data): - centre_of_rotations, angles, self.vol_shape, init = self.get_frame_params() + cor, angles, self.vol_shape, init = self.get_frame_params() sinogram = data[0].astype(np.float32) anglesTot, self.DetectorsDimH = np.shape(sinogram) + half_det_width = 0.5*self.DetectorsDimH + cor_astra = half_det_width - cor self.anglesRAD = np.deg2rad(angles.astype(np.float32)) self._data_.update({'projection_norm_data' : sinogram}) + # if one selects PWLS or SWLS models then raw data is also required (2 inputs) + if ((self.parameters['data_fidelity'] == 'PWLS') or (self.parameters['data_fidelity'] == 'SWLS')): + rawdata = data[1].astype(np.float32) + rawdata /= np.max(rawdata) + self._data_.update({'projection_raw_data' : rawdata}) + self._data_.update({'beta_SWLS' : self.parameters['data_beta_SWLS']*np.ones(self.DetectorsDimH)}) + # set parameters and initiate the ToMoBAR class object self.Rectools = RecToolsIR(DetectorsDimH = self.DetectorsDimH, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = None, # DetectorsDimV # detector dimension (vertical) for 3D case only - CenterRotOffset = None, # Center of Rotation (CoR) scalar (for 3D case only) - AnglesVec = self.anglesRAD, # array of angles in radians + CenterRotOffset = cor_astra.item() - 0.5, # The center of rotation (CoR) scalar or a vector + AnglesVec = self.anglesRAD, # the vector of angles in radians ObjSize = self.vol_shape[0] , # a scalar to define the reconstructed object dimensions - datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS, PWLS + datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS, PWLS, SWLS device_projector='cpu') # Run FISTA reconstrucion algorithm here recon = self.Rectools.FISTA(self._data_, self._algorithm_, self._regularisation_) return recon + def nInput_datasets(self): + return max(len(self.parameters['in_datasets']), 1) + + def nOutput_datasets(self): + return 1 + def get_max_frames(self): return 'single' diff --git a/savu/plugins/reconstructions/tomobar/tomobar_recon_fully_3D.py b/savu/plugins/reconstructions/tomobar/tomobar_recon_fully_3D.py deleted file mode 100644 index 18176eead..000000000 --- a/savu/plugins/reconstructions/tomobar/tomobar_recon_fully_3D.py +++ /dev/null @@ -1,239 +0,0 @@ -# Copyright 2019 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: Tomographic Model-Based Reconstruction module for an exact (slower) 3D reconstruction - :platform: Unix - :synopsis: A wrapper around TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software \ - for advanced iterative image reconstruction using _3D_ capabilities of regularisation. \ - The plugin will run on ONE cluster node taking all available memory, i.e. it can be slow\ - and it can crash potenitally when out of memory. - -.. moduleauthor:: Daniil Kazantsev -""" - -from savu.plugins.reconstructions.base_recon import BaseRecon -from savu.data.plugin_list import CitationInformation -from savu.plugins.driver.multi_threaded_plugin import MultiThreadedPlugin - -import numpy as np -from tomobar.methodsIR import RecToolsIR -from savu.plugins.utils import register_plugin - -@register_plugin -class TomobarReconFully3d(BaseRecon, MultiThreadedPlugin): - """ - A Plugin to reconstruct full-field tomographic projection data using state-of-the-art regularised iterative algorithms from \ - the ToMoBAR package. ToMoBAR includes FISTA and ADMM iterative methods and depends on the ASTRA toolbox and the CCPi RGL toolkit: \ - https://github.com/vais-ral/CCPi-Regularisation-Toolkit. - - :param output_size: The dimension of the reconstructed volume (only X-Y dimension). Default: 'auto'. - :param data_fidelity: Data fidelity, Least Squares only at the moment. Default: 'LS'. - :param data_Huber_thresh: Threshold parameter for __Huber__ data fidelity . Default: None. - :param data_any_rings: a parameter to suppress various artifacts including rings and streaks. Default: None. - :param data_any_rings_winsizes: half window sizes to collect background information [detector, angles, num of projections]. Default: (9,7,9). - :param data_any_rings_power: a power parameter for Huber model. Default: 1.5. - :param data_full_ring_GH: Regularisation variable for full constant ring removal (GH model). Default: None. - :param data_full_ring_accelerator_GH: Acceleration constant for GH ring removal. Default: 10.0. - :param algorithm_iterations: Number of outer iterations for FISTA (default) or ADMM methods. Default: 20. - :param algorithm_verbose: print iterations number and other messages ('off' by default). Default: 'off'. - :param algorithm_ordersubsets: The number of ordered-subsets to accelerate reconstruction. Default: 6. - :param algorithm_nonnegativity: ENABLE or DISABLE nonnegativity constraint. Default: 'ENABLE'. - :param regularisation_method: To regularise choose methods ROF_TV, FGP_TV, PD_TV, SB_TV, LLT_ROF,\ - NDF, TGV, Diff4th. Default: 'FGP_TV'. - :param regularisation_parameter: Regularisation (smoothing) value, higher \ - the value stronger the smoothing effect. Default: 0.00001. - :param regularisation_iterations: The number of regularisation iterations. Default: 80. - :param regularisation_device: The number of regularisation iterations. Default: 'gpu'. - :param regularisation_PD_lip: Primal-dual parameter for convergence. Default: 8. - :param regularisation_methodTV: 0/1 - TV specific isotropic/anisotropic choice. Default: 0. - :param regularisation_timestep: Time marching parameter, relevant for \ - (ROF_TV, LLT_ROF, NDF, Diff4th) penalties. Default: 0.003. - :param regularisation_edge_thresh: Edge (noise) related parameter, relevant for NDF and Diff4th. Default: 0.01. - :param regularisation_parameter2: Regularisation (smoothing) value for LLT_ROF method. Default: 0.005. - :param regularisation_NDF_penalty: NDF specific penalty type Huber, Perona, Tukey. Default: 'Huber'. - """ - - def __init__(self): - super(TomobarReconFully3d, self).__init__("TomobarReconFully3d") - - def _get_output_size(self, in_data): - sizeX = self.parameters['output_size'] - shape = in_data.get_shape() - if sizeX == 'auto': - detX = in_data.get_data_dimension_by_axis_label('detector_x') - sizeX = shape[detX] - detY = in_data.get_data_dimension_by_axis_label('detector_y') - sizeY = shape[detY] - return (sizeX,sizeY) - - def setup(self): - in_dataset, out_dataset = self.get_datasets() - # reduce the data as per data_subset parameter - self.preview_flag = \ - self.set_preview(in_dataset[0], self.parameters['preview']) - - axis_labels = in_dataset[0].data_info.get('axis_labels')[0] - - dim_volX, dim_volY, dim_volZ = \ - self.map_volume_dimensions(in_dataset[0]) - - axis_labels = {in_dataset[0]: - [str(dim_volX) + '.voxel_x.voxels', - str(dim_volY) + '.voxel_y.voxels', - str(dim_volZ) + '.voxel_z.voxels']} - # specify reconstructed volume dimensions - (self.output_size, self.Vert_det) = self._get_output_size(in_dataset[0]) - shape = [0]*len(in_dataset[0].get_shape()) - shape[0] = self.output_size - shape[1] = self.Vert_det - shape[2] = self.output_size - - # if there are only 3 dimensions then add a fourth for slicing - if len(shape) == 3: - axis_labels = [0]*4 - axis_labels[dim_volX] = 'voxel_x.voxels' - axis_labels[dim_volY] = 'voxel_y.voxels' - axis_labels[dim_volZ] = 'voxel_z.voxels' - axis_labels[3] = 'scan.number' - shape.append(1) - - if self.parameters['vol_shape'] == 'fixed': - shape[dim_volX] = shape[dim_volZ] - else: - shape[dim_volX] = self.parameters['vol_shape'] - shape[dim_volZ] = self.parameters['vol_shape'] - - if 'resolution' in self.parameters.keys(): - shape[dim_volX] /= self.parameters['resolution'] - shape[dim_volZ] /= self.parameters['resolution'] - - out_dataset[0].create_dataset(axis_labels=axis_labels, - shape=tuple(shape)) - out_dataset[0].add_volume_patterns(dim_volX, dim_volY, dim_volZ) - - ndims = range(len(shape)) - core_dims = (dim_volX, dim_volY, dim_volZ) - slice_dims = tuple(set(ndims).difference(set(core_dims))) - out_dataset[0].add_pattern( - 'VOLUME_3D', core_dims=core_dims, slice_dims=slice_dims) - - # set information relating to the plugin data - in_pData, out_pData = self.get_plugin_datasets() - - dim = in_dataset[0].get_data_dimension_by_axis_label('rotation_angle') - nSlices = in_dataset[0].get_shape()[dim] - - in_pData[0].plugin_data_setup('PROJECTION', nSlices, - slice_axis='rotation_angle') - - # in_pData[1].plugin_data_setup('PROJECTION', nSlices) # (for PWLS) - - # set pattern_name and nframes to process for all datasets - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') - - def pre_process(self): - # extract given parameters into dictionaries suitable for ToMoBAR input - self._data_ = {'OS_number' : self.parameters['algorithm_ordersubsets'], - 'huber_threshold' : self.parameters['data_Huber_thresh'], - 'ring_weights_threshold' : self.parameters['data_any_rings'], - 'ring_tuple_halfsizes' : self.parameters['data_any_rings_winsizes'], - 'ring_huber_power' : self.parameters['data_any_rings_power'], - 'ringGH_lambda' : self.parameters['data_full_ring_GH'], - 'ringGH_accelerate' : self.parameters['data_full_ring_accelerator_GH']} - - self._algorithm_ = {'iterations' : self.parameters['algorithm_iterations'], - 'nonnegativity' : self.parameters['algorithm_nonnegativity'], - 'verbose' : self.parameters['algorithm_verbose']} - - self._regularisation_ = {'method' : self.parameters['regularisation_method'], - 'regul_param' : self.parameters['regularisation_parameter'], - 'iterations' : self.parameters['regularisation_iterations'], - 'device_regulariser' : self.parameters['regularisation_device'], - 'edge_threhsold' : self.parameters['regularisation_edge_thresh'], - 'time_marching_step' : self.parameters['regularisation_timestep'], - 'regul_param2' : self.parameters['regularisation_parameter2'], - 'PD_LipschitzConstant' : self.parameters['regularisation_PD_lip'], - 'NDF_penalty' : self.parameters['regularisation_NDF_penalty'], - 'methodTV' : self.parameters['regularisation_methodTV']} - - in_pData = self.get_plugin_in_datasets() - self.det_dimX_ind = in_pData[0].get_data_dimension_by_axis_label('detector_x') - self.det_dimY_ind = in_pData[0].get_data_dimension_by_axis_label('detector_y') - - def process_frames(self, data): - centre_of_rotations, angles, self.vol_shape, init = self.get_frame_params() - - self.anglesRAD = np.deg2rad(angles.astype(np.float32)) - self.centre_of_rotations = centre_of_rotations - projdata3D = data[0].astype(np.float32) - dim_tuple = np.shape(projdata3D) - self.Horiz_det = dim_tuple[self.det_dimX_ind] - - #print(np.shape(projdata3D)) - projdata3D =np.swapaxes(projdata3D,0,1) - # WIP for PWLS fidelity - # rawdata3D = data[1].astype(np.float32) - # rawdata3D =np.swapaxes(rawdata3D,0,1)/np.max(np.float32(rawdata3D)) - self._data_.update({'projection_norm_data' : projdata3D}) - - # set parameters and initiate a TomoBar class object - self.Rectools = RecToolsIR(DetectorsDimH = self.Horiz_det, # DetectorsDimH # detector dimension (horizontal) - DetectorsDimV = self.Vert_det, # DetectorsDimV # detector dimension (vertical) for 3D case only - CenterRotOffset = 0.0, # Center of Rotation (CoR) scalar (for 3D case only) - AnglesVec = self.anglesRAD, # array of angles in radians - ObjSize = self.output_size, # a scalar to define the reconstructed object dimensions - datafidelity=self.parameters['data_fidelity'],# data fidelity, choose LS - device_projector='gpu') - - # Run FISTA reconstrucion algorithm here - recon = self.Rectools.FISTA(self._data_, self._algorithm_, self._regularisation_) - recon = np.swapaxes(recon,0,1) - return recon - - def nInput_datasets(self): - return 1 - def nOutput_datasets(self): - return 1 - - def get_citation_information(self): - cite_info1 = CitationInformation() - cite_info1.name = 'citation1' - cite_info1.description = \ - ("First-order optimisation algorithm for linear inverse problems.") - cite_info1.bibtex = \ - ("@article{beck2009,\n" + - "title={A fast iterative shrinkage-thresholding algorithm for linear inverse problems},\n" + - "author={Amir and Beck, Mark and Teboulle},\n" + - "journal={SIAM Journal on Imaging Sciences},\n" + - "volume={2},\n" + - "number={1},\n" + - "pages={183--202},\n" + - "year={2009},\n" + - "publisher={SIAM}\n" + - "}") - cite_info1.endnote = \ - ("%0 Journal Article\n" + - "%T A fast iterative shrinkage-thresholding algorithm for linear inverse problems\n" + - "%A Beck, Amir\n" + - "%A Teboulle, Mark\n" + - "%J SIAM Journal on Imaging Sciences\n" + - "%V 2\n" + - "%N 1\n" + - "%P 183--202\n" + - "%@ --\n" + - "%D 2009\n" + - "%I SIAM\n") - cite_info1.doi = "doi: " - return cite_info1 diff --git a/savu/plugins/reconstructions/tomopy_recon.py b/savu/plugins/reconstructions/tomopy_recon.py index 443032be2..b10648ffa 100644 --- a/savu/plugins/reconstructions/tomopy_recon.py +++ b/savu/plugins/reconstructions/tomopy_recon.py @@ -28,7 +28,7 @@ import logging logger = logging.getLogger() level = logger.getEffectiveLevel() -logger.setLevel(20) +logger.setLevel(30) import tomopy logger.setLevel(level) import numpy as np @@ -63,39 +63,55 @@ def __init__(self): def pre_process(self): self.sl = self.get_plugin_in_datasets()[0].get_slice_dimension() vol_shape = self.get_vol_shape() - filter_name = self.parameters['filter_name'] # for backwards compatibility filter_name = 'none' if filter_name == None else filter_name options = {'filter_name': filter_name, - 'reg_par': self.parameters['reg_par']-1, + 'reg_par': self.parameters['reg_par'] - 1, 'n_iterations': self.parameters['n_iterations'], 'num_gridx': vol_shape[0], 'num_gridy': vol_shape[2]} + l = vol_shape[0] + c = np.linspace(-l / 2.0, l / 2.0, l) + x, y = np.meshgrid(c, c) + ratio = self.parameters['ratio'] + if isinstance(ratio, list) or isinstance(ratio, tuple): + self.ratio_mask = ratio[0] + outer_mask = ratio[1] + if isinstance(outer_mask, str): + outer_mask = np.nan + else: + self.ratio_mask = ratio + outer_mask = 0.0 + + if isinstance(self.ratio_mask, float): + r = (l - 1) * self.ratio_mask + self.manual_mask = \ + np.array((x**2 + y**2 >= (r / 2.0)**2), dtype=np.float) + self.manual_mask[self.manual_mask == 1] = outer_mask + self.alg_keys = self.get_allowed_kwargs() self.alg = self.parameters['algorithm'] self.kwargs = {key: options[key] for key in self.alg_keys[self.alg] if key in options.keys()} - self._finalise_data = self._transpose if self.parameters['outer_pad']\ else self._apply_mask def process_frames(self, data): self.sino = data[0] self.cors, angles, vol_shape, init = self.get_frame_params() - if init: self.kwargs['init_recon'] = init - recon = tomopy.recon(self.sino, np.deg2rad(angles), center=self.cors[0], ncore=1, algorithm=self.alg, **self.kwargs) return self._finalise_data(recon) def _apply_mask(self, recon): - ratio = self.parameters['ratio'] - if ratio: - recon = tomopy.circ_mask(recon, axis=0, ratio=ratio) + if isinstance(self.ratio_mask, float): + recon = tomopy.circ_mask(recon, axis=0, ratio=self.ratio_mask) + recon = recon[0] + self.manual_mask + recon = np.expand_dims(recon, 0) return self._transpose(recon) def _transpose(self, recon): diff --git a/savu/plugins/reconstructions/visual_hulls_recon.py b/savu/plugins/reconstructions/visual_hulls_recon.py index e22241d21..25b91446b 100644 --- a/savu/plugins/reconstructions/visual_hulls_recon.py +++ b/savu/plugins/reconstructions/visual_hulls_recon.py @@ -65,7 +65,7 @@ def _recon_hull(self, sino, centre, angles): mask = sino[i, :][mapping_array] full -= 1-mask data_range = full.max() - full.min() - full += data_range/4 + full += data_range // 4 full[full < 0.5] = 0 return full diff --git a/savu/plugins/reshape/data_removal.py b/savu/plugins/reshape/data_removal.py index 4f7a0d988..bbe288440 100644 --- a/savu/plugins/reshape/data_removal.py +++ b/savu/plugins/reshape/data_removal.py @@ -74,7 +74,7 @@ def setup(self): if self.parameters['pattern']: pattern = self.parameters['pattern'] else: - pattern = in_dataset[0].get_data_patterns().keys()[0] + pattern = list(in_dataset[0].get_data_patterns().keys())[0] in_pData[0].plugin_data_setup(pattern, self.get_max_frames()) out_pData[0].plugin_data_setup(pattern, self.get_max_frames()) diff --git a/savu/plugins/reshape/downsample_filter.py b/savu/plugins/reshape/downsample_filter.py index 119dfe510..398a6d42b 100644 --- a/savu/plugins/reshape/downsample_filter.py +++ b/savu/plugins/reshape/downsample_filter.py @@ -58,7 +58,7 @@ def get_output_shape(self, input_data): output_shape.append(input_shape[i]/self.parameters['bin_size']) else: output_shape.append(input_shape[i]) - + return output_shape def process_frames(self, data): @@ -94,7 +94,7 @@ def new_shape(self, full_shape, data): core_dirs = data.get_core_dimensions() new_shape = list(full_shape) for dim in core_dirs: - new_shape[dim] = full_shape[dim]/self.parameters['bin_size'] + new_shape[dim] = full_shape[dim] // self.parameters['bin_size'] if (full_shape[dim] % self.parameters['bin_size']) > 0: new_shape[dim] += 1 return tuple(new_shape) diff --git a/savu/plugins/reshape/image_stitching.py b/savu/plugins/reshape/image_stitching.py new file mode 100644 index 000000000..e76ec723b --- /dev/null +++ b/savu/plugins/reshape/image_stitching.py @@ -0,0 +1,255 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: Point-spread-function correction + :platform: Unix + :synopsis: A plugin for stitching two tomo-datasets. +.. moduleauthor:: Nghia Vo + +""" +import copy +import numpy as np +from savu.plugins.plugin import Plugin +from savu.plugins.driver.cpu_plugin import CpuPlugin +from savu.plugins.utils import register_plugin +import sys + + +@register_plugin +class ImageStitching(Plugin, CpuPlugin): + """ + Method to stitch images of two tomo-datasets including flat-field correction. + :u*param overlap: Overlap width between two images. Default: 354. + :u*param row_offset: Offset of row indices of projections in the second dataset \ + compared to the first dataset. Default: -1. + :u*param crop: Parameters used to crop stitched image with respect to \ + the edges of an image. Format: [crop_top, crop_bottom, crop_left, crop_right]. Default: [0, 0, 250, 250]. + :u*param pattern: Data processing pattern is 'PROJECTION' or \ + 'SINOGRAM'. Default: 'PROJECTION'. + :param norm: Apply normalization before stitching. Default: True. + :param flat_use: Apply flat-field correction. Default: True. + """ + + def __init__(self): + super(ImageStitching, self).__init__('ImageStitching') + + def setup(self): + in_dataset, out_dataset = self.get_datasets() + in_pData, out_pData = self.get_plugin_datasets() + self.space = self.parameters['pattern'] + + if self.space == 'SINOGRAM': + in_pData[0].plugin_data_setup('SINOGRAM_STACK', 2) + else: + in_pData[0].plugin_data_setup('PROJECTION_STACK', 2) + rm_dim = in_dataset[0].get_slice_dimensions()[0] + patterns = ['SINOGRAM.' + str(rm_dim), 'PROJECTION.' + str(rm_dim)] + + self.c_top, self.c_bot, self.c_left, self.c_right = self.parameters['crop'] + self.overlap = int(self.parameters['overlap']) + self.row_offset = int(self.parameters['row_offset']) + self.norm = self.parameters['norm'] + self.flat_use = self.parameters['flat_use'] + + axis_labels = copy.copy(in_dataset[0].get_axis_labels()) + del axis_labels[rm_dim] + width_dim = in_dataset[0].get_data_dimension_by_axis_label( + 'detector_x') + height_dim = in_dataset[0].get_data_dimension_by_axis_label( + 'detector_y') + shape = list(in_dataset[0].get_shape()) + + shape[width_dim] = 2 * shape[width_dim] - \ + self.overlap - self.c_left - self.c_right + if self.space == 'PROJECTION': + shape[height_dim] = shape[height_dim] - self.c_top - self.c_bot + del shape[rm_dim] + out_dataset[0].create_dataset( + patterns={in_dataset[0]: patterns}, + axis_labels=axis_labels, + shape=tuple(shape)) + if self.space == 'SINOGRAM': + out_pData[0].plugin_data_setup('SINOGRAM', 'single') + else: + out_pData[0].plugin_data_setup('PROJECTION', 'single') + + def make_weight_matrix(self, height1, width1, height2, width2, overlap, side): + """ + Generate a linear-ramp weighting matrix for image stitching. + + Parameters + ---------- + height1, width1 : int + Size of the 1st image. + height2, width2 : int + Size of the 2nd image. + overlap : int + Width of the overlap area between two images. + side : {0, 1} + Only two options: 0 or 1. It is used to indicate the overlap side + respects to image 1. "0" corresponds to the left side. "1" corresponds + to the right side. + """ + overlap = int(np.floor(overlap)) + wei_mat1 = np.ones((height1, width1), dtype=np.float32) + wei_mat2 = np.ones((height2, width2), dtype=np.float32) + if side == 1: + list_down = np.linspace(1.0, 0.0, overlap) + list_up = 1.0 - list_down + wei_mat1[:, -overlap:] = np.float32(list_down) + wei_mat2[:, :overlap] = np.float32(list_up) + else: + list_down = np.linspace(1.0, 0.0, overlap) + list_up = 1.0 - list_down + wei_mat2[:, -overlap:] = np.float32(list_down) + wei_mat1[:, :overlap] = np.float32(list_up) + return wei_mat1, wei_mat2 + + def stitch_image(self, mat1, mat2, overlap, side, wei_mat1, wei_mat2, norm): + """ + Stitch projection images or sinogram images using a linear ramp. + + Parameters + ---------- + mat1 : array_like + 2D array. Projection image or sinogram image. + mat2 : array_like + 2D array. Projection image or sinogram image. + overlap : float + Width of the overlap area between two images. + side : {0, 1} + Only two options: 0 or 1. It is used to indicate the overlap side + respects to image 1. "0" corresponds to the left side. "1" corresponds + to the right side. + wei_mat1 : array_like + Weighting matrix used for image 1. + wei_mat2 : array_like + Weighting matrix used for image 2. + norm : bool, optional + Enable/disable normalization before stitching. + + Returns + ------- + array_like + Stitched image. + """ + (nrow1, ncol1) = mat1.shape + (nrow2, ncol2) = mat2.shape + overlap_int = int(np.floor(overlap)) + sub_pixel = overlap - overlap_int + if sub_pixel > 0.0: + if side == 1: + mat1 = shift(mat1, (0, sub_pixel), mode='nearest') + mat2 = shift(mat2, (0, -sub_pixel), mode='nearest') + else: + mat1 = shift(mat1, (0, -sub_pixel), mode='nearest') + mat2 = shift(mat2, (0, sub_pixel), mode='nearest') + if nrow1 != nrow2: + raise ValueError("Two images are not at the same height!!!") + total_width0 = ncol1 + ncol2 - overlap_int + mat_comb = np.zeros((nrow1, total_width0), dtype=np.float32) + if side == 1: + if norm is True: + factor1 = np.mean(mat1[:, -overlap_int:]) + factor2 = np.mean(mat2[:, :overlap_int]) + mat2 = mat2 * factor1 / factor2 + mat_comb[:, 0:ncol1] = mat1 * wei_mat1 + mat_comb[:, (ncol1 - overlap_int):total_width0] += mat2 * wei_mat2 + else: + if norm is True: + factor2 = np.mean(mat2[:, -overlap_int:]) + factor1 = np.mean(mat1[:, :overlap_int]) + mat2 = mat2 * factor1 / factor2 + mat_comb[:, 0:ncol2] = mat2 * wei_mat2 + mat_comb[:, (ncol2 - overlap_int):total_width0] += mat1 * wei_mat1 + return mat_comb + + def pre_process(self): + inData = self.get_in_datasets()[0] + self.data_size = inData.get_shape() + shape = len(self.get_plugin_in_datasets()[0].get_shape()) + (self.depth0, self.height0, self.width0, _) = inData.get_shape() + self.sl1 = [slice(None)] * (shape - 1) + [0] + self.sl2 = [slice(None)] * (shape - 1) + [1] + if self.flat_use is True: + dark = inData.data.dark_mean() + flat = inData.data.flat_mean() + (h_df, w_df) = dark.shape + dark1 = dark[:h_df // 2] + flat1 = flat[:h_df // 2] + dark2 = dark[-h_df // 2:] + flat2 = flat[-h_df // 2:] + if self.space == 'SINOGRAM': + self.dark1 = 1.0 * dark1[:, self.c_left:] + self.flat1 = 1.0 * flat1[:, self.c_left:] + self.dark2 = 1.0 * dark2[:, :w_df - self.c_right] + self.flat2 = 1.0 * flat2[:, :w_df - self.c_right] + else: + self.dark1 = 1.0 * \ + dark1[self.c_top: h_df // 2 - self.c_bot, self.c_left:] + self.flat1 = 1.0 * \ + flat1[self.c_top: h_df // 2 - self.c_bot, self.c_left:] + dark2 = np.roll(dark2, self.row_offset, axis=0) + flat2 = np.roll(flat2, self.row_offset, axis=0) + self.dark2 = 1.0 * dark2[self.c_top: h_df // 2 - + self.c_bot, :w_df - self.c_right] + self.flat2 = 1.0 * flat2[self.c_top: h_df // 2 - + self.c_bot, :w_df - self.c_right] + self.flatdark1 = self.flat1 - self.dark1 + self.flatdark2 = self.flat2 - self.dark2 + nmean = np.mean(np.abs(self.flatdark1)) + self.flatdark1[self.flatdark1 == 0.0] = nmean + nmean = np.mean(np.abs(self.flatdark2)) + self.flatdark2[self.flatdark2 == 0.0] = nmean + if self.space == 'SINOGRAM': + (_, w_df1) = self.dark1.shape + (_, w_df2) = self.dark2.shape + (self.wei1, self.wei2) = self.make_weight_matrix( + self.depth0, w_df1, self.depth0, w_df2, self.overlap, 1) + else: + (h_df1, w_df1) = self.dark1.shape + (h_df2, w_df2) = self.dark2.shape + (self.wei1, self.wei2) = self.make_weight_matrix( + h_df1, w_df1, h_df2, w_df2, self.overlap, 1) + + outData = self.get_out_datasets()[0] + angles = inData.meta_data.get("rotation_angle")[:,0] + outData.meta_data.set("rotation_angle", angles) + + def process_frames(self, data): + mat1 = data[0][self.sl1] + mat2 = data[0][self.sl2] + if self.space == 'SINOGRAM': + mat1 = np.float32(mat1[:, self.c_left:]) + mat2 = np.float32(mat2[:, :self.width0 - self.c_right]) + if self.flat_use is True: + count = self.get_process_frames_counter() + current_idx = self.get_global_frame_index()[count] + mat1 = (mat1 - self.dark1[current_idx])\ + / self.flatdark1[current_idx] + mat2 = (mat2 - self.dark2[current_idx]) \ + / self.flatdark2[current_idx] + else: + mat1 = np.float32( + mat1[self.c_top:self.height0 - self.c_bot, self.c_left:]) + mat2 = np.roll(mat2, self.row_offset, axis=0) + mat2 = np.float32(mat2[self.c_top:self.height0 - + self.c_bot, :self.width0 - self.c_right]) + if self.flat_use is True: + mat1 = (mat1 - self.dark1) / self.flatdark1 + mat2 = (mat2 - self.dark2) / self.flatdark2 + mat = self.stitch_image(mat1, mat2, self.overlap, + 1, self.wei1, self.wei2, self.norm) + return mat diff --git a/savu/plugins/reshape/mipmap.py b/savu/plugins/reshape/mipmap.py index 246765535..2603549ef 100644 --- a/savu/plugins/reshape/mipmap.py +++ b/savu/plugins/reshape/mipmap.py @@ -14,7 +14,7 @@ """ .. module:: mipmaping plugin (a pyramid-like data downampling) :platform: Unix - :synopsis:A plugin to downsample multidimensional data + :synopsis:A plugin to downsample multidimensional data .. moduleauthor:: Mark Basham & Daniil Kazantsev """ @@ -35,7 +35,7 @@ class Mipmap(Plugin, CpuPlugin): A plugin to downsample multidimensional data successively by powers of 2.\ The output is multiple 'mipmapped' datasets, each a power of 2 smaller in \ each dimension than the previous dataset. - + :u*param mode: One of 'mean', 'median', 'min', 'max'. Default: 'mean'. :u*param n_mipmaps: The number of successive downsamples of powers of 2 \ (e.g. n_mipmaps=3 implies downsamples (of the original data) of \ @@ -76,7 +76,7 @@ def setup(self): full_data_shape = list(in_dataset[0].get_shape()) axis_labels = in_dataset[0].get_axis_labels() voxel_dims = \ - [i for i, e in enumerate(axis_labels) if 'voxel' in e.keys()[0]] + [i for i, e in enumerate(axis_labels) if 'voxel' in list(e.keys())[0]] # Sort out input data max_frames = self.get_max_frames() @@ -93,8 +93,7 @@ def setup(self): out_dataset[i].create_dataset(axis_labels=in_dataset[0], patterns=in_dataset[0], shape=shape) - out_pData[i].plugin_data_setup('VOLUME_XZ', max_frames/2**i, - slice_axis='voxel_y') + out_pData[i].plugin_data_setup('VOLUME_XZ', max_frames // 2**i, slice_axis='voxel_y') def nInput_datasets(self): return 1 @@ -103,7 +102,7 @@ def nOutput_datasets(self): n_mipmaps = self.parameters['n_mipmaps'] name = self.parameters['out_dataset_prefix'] self.parameters['out_datasets'] = \ - ['%s_%i' % (name, 2**i) for i in range(n_mipmaps)] + ['%s_%i' % (name, 2**i) for i in range(n_mipmaps)] return n_mipmaps def get_max_frames(self): diff --git a/savu/plugins/ring_removal/raven_filter.py b/savu/plugins/ring_removal/raven_filter.py index bc59530e5..13b4040c7 100644 --- a/savu/plugins/ring_removal/raven_filter.py +++ b/savu/plugins/ring_removal/raven_filter.py @@ -65,8 +65,8 @@ def pre_process(self): u0 = np.abs(self.parameters['uvalue']) n = np.abs(self.parameters['nvalue']) # Create filter - centerx = np.ceil(width1/2.0)-1.0 - centery = np.int16(np.ceil(height1/2.0)-1) + centerx = np.ceil(width1 / 2.0) - 1.0 + centery = np.int16(np.ceil(height1 / 2.0) - 1) self.row1 = centery - v0 self.row2 = centery + v0+1 listx = np.arange(width1)-centerx @@ -75,10 +75,10 @@ def pre_process(self): filtershapepad2d[:] = np.float64(filtershape) self.filtercomplex = filtershapepad2d + filtershapepad2d*1j - a = pyfftw.n_byte_align_empty((height1, width1), 16, 'complex128') - b = pyfftw.n_byte_align_empty((height1, width1), 16, 'complex128') - c = pyfftw.n_byte_align_empty((height1, width1), 16, 'complex128') - d = pyfftw.n_byte_align_empty((height1, width1), 16, 'complex128') + a = pyfftw.empty_aligned((height1, width1), dtype='complex128', n=16) + b = pyfftw.empty_aligned((height1, width1), dtype='complex128', n=16) + c = pyfftw.empty_aligned((height1, width1), dtype='complex128', n=16) + d = pyfftw.empty_aligned((height1, width1), dtype='complex128', n=16) self.fft_object = pyfftw.FFTW(a, b, axes=(0, 1)) self.ifft_object = pyfftw.FFTW(c, d, axes=(0, 1), direction='FFTW_BACKWARD') diff --git a/savu/plugins/ring_removal/ring_removal_fitting.py b/savu/plugins/ring_removal/ring_removal_fitting.py index 41949d970..6173aecd6 100644 --- a/savu/plugins/ring_removal/ring_removal_fitting.py +++ b/savu/plugins/ring_removal/ring_removal_fitting.py @@ -64,9 +64,9 @@ def _create_2d_window(self, height, width, sigmax, sigmay): --------- Return: - 2D window. """ - centerx = (width-1.0)/2.0 - centery = (height-1.0)/2.0 - y,x = np.ogrid[-centery:height-centery,-centerx:width-centerx] + centerx = (width-1.0) / 2.0 + centery = (height-1.0) / 2.0 + y, x = np.ogrid[-centery:height-centery, -centerx:width-centerx] numx = 2.0*sigmax*sigmax numy = 2.0*sigmay*sigmay win2d = np.exp(-(x*x/numx+y*y/numy)) @@ -96,7 +96,7 @@ def pre_process(self): self.matsign = np.power(-1.0,x+y) def process_frames(self, data): - sinogram = data[0] + sinogram = data[0] (height, _) = sinogram.shape if height%2==0: height = height - 1 @@ -105,7 +105,7 @@ def process_frames(self, data): sinofit2 = np.pad( sinofit,((0, 0), (self.pad, self.pad)), mode = 'edge') sinofit2 = np.pad( - sinofit2,((self.pad, self.pad), (0, 0)), mode = 'mean') + sinofit2,((self.pad, self.pad), (0, 0)), mode = 'mean') sinofitsmooth = np.real(fft.ifft2(fft.fft2( sinofit2*self.matsign)*self.window2d)*self.matsign) sinofitsmooth = sinofitsmooth[self.pad:self.height1-self.pad, diff --git a/savu/plugins/ring_removal/ring_removal_interpolation.py b/savu/plugins/ring_removal/ring_removal_interpolation.py new file mode 100644 index 000000000..17cdc6895 --- /dev/null +++ b/savu/plugins/ring_removal/ring_removal_interpolation.py @@ -0,0 +1,151 @@ +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +.. module:: Remove stripe artefacts + :platform: Unix + :synopsis: A plugin working in sinogram space to remove stripe artefacts +.. moduleauthor:: Nghia Vo + +""" + +from savu.plugins.plugin import Plugin +from savu.plugins.driver.cpu_plugin import CpuPlugin +from savu.plugins.utils import register_plugin +from savu.data.plugin_list import CitationInformation +import numpy as np +from scipy import interpolate +from scipy.ndimage import median_filter +from scipy.ndimage import binary_dilation + + +@register_plugin +class RingRemovalInterpolation(Plugin, CpuPlugin): + """ + + Method to remove stripe artefacts in a sinogram (<-> ring artefacts\ + in a reconstructed image) using a combination of a detection technique\ + and an interpolation technique. + + :u*param size: Size of the median filter window. Greater is stronger\ + . Default: 31. + :u*param snr: Ratio used to locate stripe artifacts. Greater is\ + less sensitive. Default: 3.0. + """ + + def __init__(self): + super(RingRemovalInterpolation, self).__init__( + "RingRemovalInterpolation") + + def setup(self): + in_dataset, out_dataset = self.get_datasets() + out_dataset[0].create_dataset(in_dataset[0]) + in_pData, out_pData = self.get_plugin_datasets() + in_pData[0].plugin_data_setup('SINOGRAM', 'single') + out_pData[0].plugin_data_setup('SINOGRAM', 'single') + + def detect_stripe(self, listdata, snr): + """ + Algorithm 4 in the paper. Used to locate stripe positions. + --------- + Parameters: - listdata: 1D normalized array. + - snr: ratio used to discriminate between useful + information and noise. + --------- + Return: - 1D binary mask. + """ + numdata = len(listdata) + listsorted = np.sort(listdata)[::-1] + xlist = np.arange(0, numdata, 1.0) + ndrop = np.int16(0.25 * numdata) + (_slope, _intercept) = np.polyfit( + xlist[ndrop:-ndrop - 1], listsorted[ndrop:-ndrop - 1], 1) + numt1 = _intercept + _slope * xlist[-1] + noiselevel = np.abs(numt1 - _intercept) + val1 = np.abs(listsorted[0] - _intercept) / noiselevel + val2 = np.abs(listsorted[-1] - numt1) / noiselevel + listmask = np.zeros_like(listdata) + if (val1 >= snr): + upper_thresh = _intercept + noiselevel * snr * 0.5 + listmask[listdata > upper_thresh] = 1.0 + if (val2 >= snr): + lower_thresh = numt1 - noiselevel * snr * 0.5 + listmask[listdata <= lower_thresh] = 1.0 + return listmask + + def pre_process(self): + in_pData = self.get_plugin_in_datasets() + width_dim = \ + in_pData[0].get_data_dimension_by_axis_label('detector_x') + height_dim = \ + in_pData[0].get_data_dimension_by_axis_label('rotation_angle') + sino_shape = list(in_pData[0].get_shape()) + self.width1 = sino_shape[width_dim] + self.height1 = sino_shape[height_dim] + listindex = np.arange(0.0, self.height1, 1.0) + self.matindex = np.tile(listindex, (self.width1, 1)) + self.size = np.clip( + np.int16(self.parameters['size']), 1, self.width1 - 1) + self.snr = np.clip(np.float32(self.parameters['snr']), 1.0, None) + + def process_frames(self, data): + """ + Combine algorithm 4, 5, and 6 in the paper. Remove stripes by: locating stripes + and using an interpolation technique to remove them. + """ + sinogram = np.copy(data[0]) + badpixelratio = 0.05 # To avoid false detection + ndrop = np.int16(badpixelratio * self.height1) + sinosorted = np.sort(sinogram, axis=0) + sinosmoothed = median_filter(sinosorted, (1, self.size)) + list1 = np.mean(sinosorted[ndrop:self.height1 - ndrop], axis=0) + list2 = np.mean(sinosmoothed[ndrop:self.height1 - ndrop], axis=0) + listfact = list1 / list2 + listmask = self.detect_stripe(listfact, self.snr) + listmask = binary_dilation( + listmask, iterations=1).astype(listmask.dtype) + matfact = np.tile(listfact, (self.height1, 1)) + sinogram = 1.0 * sinogram / matfact + listmask[0:2] = 0.0 + listmask[-2:] = 0.0 + listx = np.where(listmask < 1.0)[0] + listy = np.arange(self.height1) + matz = sinogram[:, listx] + finter = interpolate.interp2d(listx, listy, matz, kind='linear') + listxmiss = np.where(listmask > 0.0)[0] + if len(listxmiss) > 0: + matzmiss = finter(listxmiss, listy) + sinogram[:, listxmiss] = matzmiss + return sinogram + + def get_citation_information(self): + cite_info = CitationInformation() + cite_info.description = \ + ("The code of ring removal is the implementation of the work of \ + Nghia T. Vo et al. taken from algorithm 4, 5, 6 in this paper.") + cite_info.bibtex = \ + ("@article{Vo:18,\n" + + "title={Superior techniques for eliminating ring artifacts in\ + X-ray micro-tomography},\n" + + "author={Nghia T. Vo, Robert C. Atwood,\ + and Michael Drakopoulos},\n" + + "journal={Opt. Express},\n" + + "volume={26},\n" + + "number={22},\n" + + "pages={28396--28412},\n" + + "year={2018},\n" + + "publisher={OSA}" + + "}") + cite_info.doi = "doi: DOI: 10.1364/OE.26.028396" + return cite_info diff --git a/savu/plugins/ring_removal/ring_removal_waveletfft.py b/savu/plugins/ring_removal/ring_removal_waveletfft.py index d5289717d..c43199869 100644 --- a/savu/plugins/ring_removal/ring_removal_waveletfft.py +++ b/savu/plugins/ring_removal/ring_removal_waveletfft.py @@ -17,8 +17,8 @@ :platform: Unix :synopsis: A plugin removes ring artefacts -.. moduleauthor: Nghia Vo. - Adapted from tomopy source code: +.. moduleauthor: Nghia Vo. + Adapted from tomopy source code: http://tomopy.github.io/tomopy/_modules/tomopy/algorithms/preprocess/stripe_removal.html """ @@ -94,10 +94,10 @@ def process_frames(self, data): fcV = np.fft.fftshift(np.fft.fft2(cV[j])) my, mx = fcV.shape # Damping of ring artifact information. - y_hat = (np.arange(-my, my, 2, dtype='float') + 1) / 2 + y_hat = (np.arange(-my, my, 2, dtype='float') + 1) / 2.0 damp = 1 - np.exp(-np.power(y_hat, 2) / (2 * np.power(self.sigma, 2))) fcV = np.multiply(fcV, np.transpose(np.tile(damp, (mx, 1)))) - + # Inverse FFT. cV[j] = np.real(np.fft.ifft2(np.fft.ifftshift(fcV))) # Wavelet reconstruction. diff --git a/savu/plugins/savers/edf_saver.py b/savu/plugins/savers/edf_saver.py index 83b06d2bc..c46a74b07 100644 --- a/savu/plugins/savers/edf_saver.py +++ b/savu/plugins/savers/edf_saver.py @@ -60,11 +60,11 @@ def pre_process(self): self.axis_info = [] k = 0 for ix in self.axes: - axis_name = ix.keys()[0] + axis_name = list(ix.keys())[0] try: foo = in_datasets[0].meta_data.get(axis_name)# take the first key except KeyError: - foo = np.array(range(in_datasets[0].get_shape()[sd[k]])) # if it doesn't exis then replace it with a range + foo = np.array(list(range(in_datasets[0].get_shape()[sd[k]]))) # if it doesn't exis then replace it with a range k+=1 self.axis_info.append(foo) #self.axis_info = [in_datasets[0].meta_data.get(ix) for ix in self.axes] diff --git a/savu/plugins/savers/hdf5_saver.py b/savu/plugins/savers/hdf5_saver.py index 30745407f..7a2430d5f 100644 --- a/savu/plugins/savers/hdf5_saver.py +++ b/savu/plugins/savers/hdf5_saver.py @@ -85,7 +85,7 @@ def post_process(self): def __set_current_pattern(self): pattern = copy.deepcopy(self.in_data._get_plugin_data().get_pattern()) - pattern[pattern.keys()[0]]['max_frames'] = self.get_max_frames() + pattern[list(pattern.keys())[0]]['max_frames'] = self.get_max_frames() return pattern def get_pattern(self): @@ -93,8 +93,8 @@ def get_pattern(self): return self.parameters['pattern'] previous_pattern = self.get_in_datasets()[0].get_previous_pattern() if previous_pattern: - return previous_pattern.keys()[0] - return self.get_in_datasets()[0].get_data_patterns().keys()[0] + return list(previous_pattern.keys())[0] + return list(self.get_in_datasets()[0].get_data_patterns().keys())[0] def __get_file_name(self): nPlugin = self.exp.meta_data.get('nPlugin') diff --git a/savu/plugins/savers/image_saver.py b/savu/plugins/savers/image_saver.py index ef8696917..d9a19971e 100644 --- a/savu/plugins/savers/image_saver.py +++ b/savu/plugins/savers/image_saver.py @@ -31,6 +31,7 @@ from savu.plugins.driver.cpu_plugin import CpuPlugin import savu.core.utils as cu + @register_plugin class ImageSaver(BaseImageSaver, CpuPlugin): """ @@ -57,11 +58,11 @@ def pre_process(self): self.file_format = self.parameters['format'] num_bit = self.parameters['num_bit'] self.pData = self.get_plugin_in_datasets()[0] - if not (num_bit==8 or num_bit==16 or num_bit==32): + if not (num_bit == 8 or num_bit == 16 or num_bit == 32): self.num_bit = 32 msg = "\n***********************************************\n"\ "This option %s is not available. Reset to 32 \n"\ - %str(num_bit) + % str(num_bit) cu.user_message(msg) else: self.num_bit = num_bit @@ -70,60 +71,64 @@ def pre_process(self): def process_frames(self, data): frame = self.pData.get_current_frame_idx()[0] filename = '%s%05i.%s' % (self.filename, frame, self.file_format) - if (self.file_format=="tiff") or (self.file_format =="tif"): + frame = np.nan_to_num(data[0]) + if (self.file_format == "tiff") or (self.file_format == "tif"): global_min = self.parameters['min'] global_max = self.parameters['max'] - if self.num_bit==32: - rescaled_image = data[0] + if self.num_bit == 32: + rescaled_image = frame else: if global_min is None: if self.the_min is not None: global_min = self.the_min else: - global_min = np.min(data[0]) + global_min = np.min(frame) if global_max is None: if self.the_max is not None: global_max = self.the_max else: - global_max = np.max(data[0]) - rescaled_image = np.clip(data[0], global_min, global_max) + global_max = np.max(frame) + rescaled_image = np.clip(frame, global_min, global_max) rescaled_image = (rescaled_image - global_min) \ - / (global_max - global_min) - if self.num_bit==16: + / (global_max - global_min) + if self.num_bit == 16: rescaled_image = np.clip( np.uint16(rescaled_image * 65535), 0, 65535) else: - rescaled_image = np.clip(np.uint8(rescaled_image * 255), 0, 255) + rescaled_image = np.clip( + np.uint8(rescaled_image * 255), 0, 255) img = Image.fromarray(rescaled_image) img.save(filename) else: # Rescale image to (0.0, 1.0) range rescaled_image = skimage.exposure.rescale_intensity( - data[0], in_range=self._data_range, out_range=(0.0, 1.0)) + frame, in_range=self._data_range, out_range=(0.0, 1.0)) # Save image skimage.io.imsave( - filename, rescaled_image, quality=self.parameters['jpeg_quality']) + filename, rescaled_image, quality=self.parameters['jpeg_quality']) def _get_min_and_max(self): data = self.get_in_datasets()[0] pattern = self.parameters['pattern'] try: - self.the_min = np.min(data.meta_data.get(['stats', 'min', pattern])) - self.the_max = np.max(data.meta_data.get(['stats', 'max', pattern])) + self.the_min = np.min( + data.meta_data.get(['stats', 'min', pattern])) + self.the_max = np.max( + data.meta_data.get(['stats', 'max', pattern])) self._data_range = (self.the_min, self.the_max) except KeyError: self._data_range = 'image' - if (self.file_format=="tiff") or (self.file_format =="tif"): + if (self.file_format == "tiff") or (self.file_format == "tif"): self.the_min = None self.the_max = None msg = "\n***********************************************\n"\ - "!!!Warning!!!-> No global maximum and global minimum found\n"\ - "in the metadata. Please run the MaxAndMin plugin before\n" \ - "ImageSaver or input manually. Otherwise, local minimum\n" \ - "and local maximum will be used for rescaling. This may\n"\ - "result the fluctuation of brightness between slices.\n"\ - "***********************************************\n" - if (self.num_bit == 8) or (self.num_bit==16): + "!!!Warning!!!-> No global maximum and global minimum found\n"\ + "in the metadata. Please run the MaxAndMin plugin before\n" \ + "ImageSaver or input manually. Otherwise, local minimum\n" \ + "and local maximum will be used for rescaling. This may\n"\ + "result the fluctuation of brightness between slices.\n"\ + "***********************************************\n" + if (self.num_bit == 8) or (self.num_bit == 16): cu.user_message(msg) return self._data_range diff --git a/savu/plugins/savers/utils/hdf5_utils.py b/savu/plugins/savers/utils/hdf5_utils.py index 14b8f67db..5ae6a55e1 100644 --- a/savu/plugins/savers/utils/hdf5_utils.py +++ b/savu/plugins/savers/utils/hdf5_utils.py @@ -46,7 +46,7 @@ def __init__(self, exp): self.exp = exp # Get MPI I/O settings from the Savu config file settings = self.exp.meta_data.get(['system_params', 'mpi-io_settings']) - for key, value in settings.iteritems(): + for key, value in settings.items(): self.info.Set(key, value) def _open_backing_h5(self, filename, mode, comm=MPI.COMM_WORLD, mpi=True): @@ -116,19 +116,20 @@ def __is_h5dataset(self, data): except: return False - def create_dataset_nofill(self, group, name, shape, dtype, chunks=None): + def create_dataset_nofill(self, group, name:str, shape, dtype, chunks=None): spaceid = h5py.h5s.create_simple(shape) plist = h5py.h5p.create(h5py.h5p.DATASET_CREATE) plist.set_fill_time(h5py.h5d.FILL_TIME_NEVER) if chunks not in [None, []] and isinstance(chunks, tuple): plist.set_chunk(chunks) typeid = h5py.h5t.py_create(dtype) + group_name = (group.name + '/' + name).encode("ascii") datasetid = h5py.h5d.create( - group.file.id, group.name+'/'+name, typeid, spaceid, plist) + group.file.id, group_name, typeid, spaceid, plist) data = h5py.Dataset(datasetid) return data - def _create_entries(self, data, key, current_and_next): + def _create_entries(self, data, key:str, current_and_next): msg = self.__class__.__name__ + '_create_entries' self.exp._barrier(msg=msg+'1') @@ -148,7 +149,7 @@ def _create_entries(self, data, key, current_and_next): if 'data' in group: data.data = group['data'] elif current_and_next is 0: - logging.warn('Creating the dataset without chunks') + logging.warning('Creating the dataset without chunks') data.data = group.create_dataset("data", shape, data.dtype) else: chunk_max = self.__set_optimal_hdf5_chunk_cache_size(data, group) @@ -200,7 +201,7 @@ def _reopen_file(self, data, mode): logging.debug( "Re-opening the backing file %s in mode %s" % (filename, mode)) data.backing_file = self._open_backing_h5(filename, mode) - entry = data.backing_file.keys()[0] + '/data' + entry = list(data.backing_file.keys())[0] + '/data' if isinstance(data.data, BaseType): data.data.data = data.backing_file[entry] diff --git a/savu/plugins/savers/xrf_saver.py b/savu/plugins/savers/xrf_saver.py index 9695371b6..c40b47ac6 100644 --- a/savu/plugins/savers/xrf_saver.py +++ b/savu/plugins/savers/xrf_saver.py @@ -60,21 +60,21 @@ def pre_process(self): self.axis_info = [] k = 0 for ix in self.axes: - axis_name = ix.keys()[0] + axis_name = list(ix.keys())[0] try: foo = in_datasets[0].meta_data.get(axis_name)# take the first key except KeyError: - foo = np.array(range(in_datasets[0].get_shape()[sd[k]])) # if it doesn't exis then replace it with a range + foo = np.array(list(range(in_datasets[0].get_shape()[sd[k]]))) # if it doesn't exis then replace it with a range k+=1 self.axis_info.append(foo) #self.axis_info = [in_datasets[0].meta_data.get(ix) for ix in self.axes] def process_frames(self, data): d=data[0] # first dataset in the list - print "################################" - print "number of datasets in list",len(data) - print "shape of data[0]", data[0].shape - print "################################" + print("################################") + print("number of datasets in list",len(data)) + print("shape of data[0]", data[0].shape) + print("################################") # frame = self.get_current_slice_list()[0] # slice list for the first dataset # frame = [ix.start for ix in frame] # convert to just numbers # channel = self.axis_info[0][frame[-2]] @@ -101,7 +101,7 @@ def get_pattern(self): def get_max_frames(self): in_datasets, __out_datasets = self.get_datasets() sh = in_datasets[0].get_shape() - print "full dataset shape:",sh + print("full dataset shape:",sh) nframes = np.prod(sh[-2:])# product of the channel and the number of elements in the fit - print "max frames requested:",nframes, type(nframes) + print("max frames requested:",nframes, type(nframes)) return nframes \ No newline at end of file diff --git a/savu/plugins/segmentation/evolving_contours/mask_conditional_evolve3D.py b/savu/plugins/segmentation/evolving_contours/mask_conditional_evolve3D.py deleted file mode 100644 index e4f621578..000000000 --- a/savu/plugins/segmentation/evolving_contours/mask_conditional_evolve3D.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2019 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: mask_conditional_evolve3D - :platform: Unix - :synopsis: Fast segmentation by evolving the given mask in 3D space using additional\ - mask to constrain the evolution process - -.. moduleauthor:: Daniil Kazantsev -""" - -from savu.plugins.plugin import Plugin -from savu.plugins.driver.multi_threaded_plugin import MultiThreadedPlugin -from savu.plugins.utils import register_plugin - -from larix.methods.segmentation import MASK_CONDITIONAL_EVOLVE - -import numpy as np - -@register_plugin -class MaskConditionalEvolve3d(Plugin, MultiThreadedPlugin): - """ - Fast segmentation by evolving the given 3D mask, the initial mask must be given \ - precisely through the object, otherwise segmentation will be incorrect. Provided additional\ - mask will constrain the evolution process. - - :param threshold: important parameter to control mask propagation. Default: 1.0. - :param method: method to collect statistics from the mask (mean, median, value). Default: 'mean'. - :param iterations: The number of iterations. Default: 500. - :param connectivity: The connectivity of the local neighbourhood. Default: 6. - :param out_datasets: The default names . Default: ['MASK_EVOLVED']. - """ - - def __init__(self): - super(MaskConditionalEvolve3d, self).__init__("MaskConditionalEvolve3d") - - def setup(self): - in_dataset, out_dataset = self.get_datasets() - in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - in_pData[1].plugin_data_setup('VOLUME_3D', 'single') # the initialisation (mask) - in_pData[2].plugin_data_setup('VOLUME_3D', 'single') # the conditional mask - - out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') - - def pre_process(self): - # extract given parameters - self.threshold = self.parameters['threshold'] - self.iterations = self.parameters['iterations'] - self.connectivity = self.parameters['connectivity'] - if (str(self.parameters['method']) == 'mean'): - self.method = 'mean' - elif (str(self.parameters['method']) == 'median'): - self.method = 'median' - else: - self.method = 'value' - - def process_frames(self, data): - input_temp = data[0] - indices = np.where(np.isnan(input_temp)) - input_temp[indices] = 0.0 - pars = {'input_data' : input_temp, # input grayscale image - 'maskData' : np.uint8(data[1]), # generated initialisation mask - 'maskCond' : np.uint8(data[2]), # conditional mask - 'threhsold' : self.threshold, # threhsold controls where evolution stops (>=1) - 'iterationsNumb' : self.iterations,# the number of iterations (depends on the size of the phase) - 'connectivity' : self.connectivity,# voxel connectivity rule, choose between 4 (2D), 6, 8 (2D), and 26 - 'method' : self.method} # method to collect statistics from the mask (mean. median, value) - if (np.sum(data[1]) > 0): - mask_evolve = MASK_CONDITIONAL_EVOLVE(pars['input_data'], pars['maskData'],\ - pars['maskCond'], pars['threhsold'], pars['iterationsNumb'],\ - pars['connectivity'], pars['method']) - else: - mask_evolve = np.uint8(np.zeros(np.shape(data[0]))) - return mask_evolve - - def nInput_datasets(self): - return 3 - def nOutput_datasets(self): - return 1 diff --git a/savu/plugins/segmentation/evolving_contours/morph_snakes.py b/savu/plugins/segmentation/evolving_contours/morph_snakes.py index edd6166ae..dcfc8351e 100644 --- a/savu/plugins/segmentation/evolving_contours/morph_snakes.py +++ b/savu/plugins/segmentation/evolving_contours/morph_snakes.py @@ -29,7 +29,6 @@ # https://github.com/pmneila/morphsnakes from morphsnakes import morphological_chan_vese - @register_plugin class MorphSnakes(Plugin, CpuPlugin): """ @@ -46,6 +45,7 @@ class MorphSnakes(Plugin, CpuPlugin): reasonable values are around 1-4 and larger values lead to smoother segmentations. Default: 1. :param iterations: The number of iterations. Default: 350. :param pattern: pattern to apply this to. Default: "VOLUME_YZ". + :param out_datasets: The default names. Default: ['MASK_MORPH_EVOLVED']. """ def __init__(self): @@ -56,7 +56,7 @@ def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') - in_pData[1].plugin_data_setup(self.parameters['pattern'], 'single') # the initialisation (mask) + in_pData[1].plugin_data_setup(self.parameters['pattern'], 'single') # the initialised mask out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') diff --git a/savu/plugins/segmentation/evolving_contours/morph_snakes3D.py b/savu/plugins/segmentation/evolving_contours/morph_snakes3D.py index cdf4fc9ed..b81ddbe28 100644 --- a/savu/plugins/segmentation/evolving_contours/morph_snakes3D.py +++ b/savu/plugins/segmentation/evolving_contours/morph_snakes3D.py @@ -45,6 +45,7 @@ class MorphSnakes3d(Plugin, MultiThreadedPlugin): :param smoothing: Number of times the smoothing operator is applied per iteration, \ reasonable values are around 1-4 and larger values lead to smoother segmentations. Default: 1. :param iterations: The number of iterations. Default: 350. + :param out_datasets: The default names. Default: ['MASK_MORPH_EVOLVED3D']. """ def __init__(self): @@ -53,11 +54,13 @@ def __init__(self): def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - in_pData[1].plugin_data_setup('VOLUME_3D', 'single') # the initialisation (mask) + + getall = ["VOLUME_XZ", "voxel_y"] + in_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + in_pData[1].plugin_data_setup('VOLUME_3D', 'single', getall=getall) # the initialisation (mask) out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') + out_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) def pre_process(self): # extract given parameters diff --git a/savu/plugins/segmentation/evolving_contours/mask_evolve.py b/savu/plugins/segmentation/evolving_contours/region_grow.py similarity index 76% rename from savu/plugins/segmentation/evolving_contours/mask_evolve.py rename to savu/plugins/segmentation/evolving_contours/region_grow.py index 3e1c78a13..f6b8fe81d 100644 --- a/savu/plugins/segmentation/evolving_contours/mask_evolve.py +++ b/savu/plugins/segmentation/evolving_contours/region_grow.py @@ -13,9 +13,9 @@ # limitations under the License. """ -.. module:: mask_evolve +.. module:: region_grow :platform: Unix - :synopsis: Fast segmentation by evolving the given mask (initialised) + :synopsis: Fast region-grow type segmentation from Larix toolbox to evolve a given mask .. moduleauthor:: Daniil Kazantsev """ @@ -24,26 +24,25 @@ from savu.plugins.driver.cpu_plugin import CpuPlugin from savu.plugins.utils import register_plugin -from larix.methods.segmentation import MASK_EVOLVE - +from larix.methods.segmentation import REGION_GROW import numpy as np @register_plugin -class MaskEvolve(Plugin, CpuPlugin): +class RegionGrow(Plugin, CpuPlugin): """ - Fast segmentation by evolving the given mask, the mask must be given \ - precisely through the object, otherwise segmentation will be incorrect. + Fast 2D segmentation by evolving the user-given mask, the initialised mask should be set \ + in the central part of the object to be segmented. - :param threshold: important parameter to control mask propagation. Default: 1.0. - :param method: method to collect statistics from the mask (mean, median, value). Default: 'mean'. - :param iterations: The number of iterations. Default: 500. - :param connectivity: The connectivity of the local neighbourhood. Default: 4. + :param threshold: parameter to control mask propagation. Default: 1.0. + :param method: a method to collect statistics from the given mask (mean, median, value). Default: 'mean'. + :param iterations: number of iterations. Default: 500. + :param connectivity: the connectivity of the local neighbourhood, choose 4 or 8. Default: 4. :param pattern: pattern to apply this to. Default: "VOLUME_YZ". - :param out_datasets: The default names . Default: ['MASK_EVOLVED']. + :param out_datasets: The default names . Default: ['MASK_RG_EVOLVED']. """ def __init__(self): - super(MaskEvolve, self).__init__("MaskEvolve") + super(RegionGrow, self).__init__("RegionGrow") def setup(self): in_dataset, out_dataset = self.get_datasets() @@ -62,7 +61,7 @@ def pre_process(self): if (str(self.parameters['method']) == 'mean'): self.method = 'mean' elif (str(self.parameters['method']) == 'median'): - self.method = 'median' + self.method = 'median' else: self.method = 'value' @@ -70,16 +69,17 @@ def process_frames(self, data): input_temp = data[0] indices = np.where(np.isnan(input_temp)) input_temp[indices] = 0.0 - + pars = {'input_data' : input_temp, # input grayscale image 'maskData' : np.uint8(data[1]), # generated initialisation mask 'threhsold' : self.threshold, # threhsold controls where evolution stops (>=1) 'iterationsNumb' : self.iterations,# the number of iterations (depends on the size of the phase) 'connectivity' : self.connectivity,# voxel connectivity rule, choose between 4 (2D), 6, 8 (2D), and 26 'method' : self.method} # method to collect statistics from the mask (mean. median, value) - + + # run the method if (np.sum(data[1]) > 0): - mask_evolve = MASK_EVOLVE(pars['input_data'], pars['maskData'],\ + mask_evolve = REGION_GROW(pars['input_data'], pars['maskData'],\ pars['threhsold'], pars['iterationsNumb'],\ pars['connectivity'], pars['method']) else: diff --git a/savu/plugins/segmentation/evolving_contours/mask_evolve3D.py b/savu/plugins/segmentation/evolving_contours/region_grow3D.py similarity index 63% rename from savu/plugins/segmentation/evolving_contours/mask_evolve3D.py rename to savu/plugins/segmentation/evolving_contours/region_grow3D.py index 36ddb88cf..59ed77ae3 100644 --- a/savu/plugins/segmentation/evolving_contours/mask_evolve3D.py +++ b/savu/plugins/segmentation/evolving_contours/region_grow3D.py @@ -13,9 +13,9 @@ # limitations under the License. """ -.. module:: mask_evolve3D +.. module:: region_grow3D :platform: Unix - :synopsis: Fast segmentation by evolving the given mask in 3D + :synopsis: Fast region-grow type segmentation in 3D from Larix toolbox to evolve a given mask .. moduleauthor:: Daniil Kazantsev """ @@ -24,61 +24,63 @@ from savu.plugins.driver.multi_threaded_plugin import MultiThreadedPlugin from savu.plugins.utils import register_plugin -from larix.methods.segmentation import MASK_EVOLVE - +from larix.methods.segmentation import REGION_GROW import numpy as np @register_plugin -class MaskEvolve3d(Plugin, MultiThreadedPlugin): +class RegionGrow3d(Plugin, MultiThreadedPlugin): """ - Fast segmentation by evolving the given 3D mask, the initial mask must be given \ - precisely through the object, otherwise segmentation will be incorrect. + Fast 3D segmentation by evolving the user-given mask, the initialised mask should be set \ + in the central part of the object to be segmented. - :param threshold: important parameter to control mask propagation. Default: 1.0. - :param method: method to collect statistics from the mask (mean, median, value). Default: 'mean'. - :param iterations: The number of iterations. Default: 500. - :param connectivity: The connectivity of the local neighbourhood. Default: 6. - :param out_datasets: The default names . Default: ['MASK_EVOLVED']. + :param threshold: parameter to control mask propagation. Default: 1.0. + :param method: a method to collect statistics from the given mask (mean, median, value). Default: 'mean'. + :param iterations: number of iterations. Default: 500. + :param connectivity: the connectivity of the local neighbourhood, choose 4, 6, 8 or 26. Default: 6. + :param out_datasets: The default names . Default: ['MASK_RG_EVOLVED']. """ def __init__(self): - super(MaskEvolve3d, self).__init__("MaskEvolve3d") + super(RegionGrow3d, self).__init__("RegionGrow3d") def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - in_pData[1].plugin_data_setup('VOLUME_3D', 'single') # the initialisation (mask) + + getall = ['VOLUME_XZ', 'voxel_y'] + in_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + in_pData[1].plugin_data_setup('VOLUME_3D', 'single', getall=getall) # the initialised mask out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') + out_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) def pre_process(self): # extract given parameters self.threshold = self.parameters['threshold'] self.iterations = self.parameters['iterations'] - self.connectivity = self.parameters['connectivity'] + self.connectivity = self.parameters['connectivity'] if (str(self.parameters['method']) == 'mean'): self.method = 'mean' elif (str(self.parameters['method']) == 'median'): - self.method = 'median' + self.method = 'median' else: self.method = 'value' def process_frames(self, data): input_temp = data[0] indices = np.where(np.isnan(input_temp)) - input_temp[indices] = 0.0 - + input_temp[indices] = 0.0 + pars = {'input_data' : input_temp, # input grayscale image 'maskData' : np.uint8(data[1]), # generated initialisation mask 'threhsold' : self.threshold, # threhsold controls where evolution stops (>=1) 'iterationsNumb' : self.iterations,# the number of iterations (depends on the size of the phase) 'connectivity' : self.connectivity,# voxel connectivity rule, choose between 4 (2D), 6, 8 (2D), and 26 - 'method' : self.method} # method to collect statistics from the mask (mean. median, value) - + 'method' : self.method} # method to collect statistics from the mask (mean. median, value) + + # run the method if (np.sum(data[1]) > 0): - mask_evolve = MASK_EVOLVE(pars['input_data'], pars['maskData'],\ + mask_evolve = REGION_GROW(pars['input_data'], pars['maskData'],\ pars['threhsold'], pars['iterationsNumb'],\ pars['connectivity'], pars['method']) else: @@ -88,4 +90,4 @@ def process_frames(self, data): def nInput_datasets(self): return 2 def nOutput_datasets(self): - return 1 \ No newline at end of file + return 1 diff --git a/savu/plugins/segmentation/gaussian_mixtures/gmm_segment3D.py b/savu/plugins/segmentation/gaussian_mixtures/gmm_segment3D.py index f7d17e991..2acf7b62e 100644 --- a/savu/plugins/segmentation/gaussian_mixtures/gmm_segment3D.py +++ b/savu/plugins/segmentation/gaussian_mixtures/gmm_segment3D.py @@ -32,20 +32,22 @@ class GmmSegment3d(Plugin, MultiThreadedPlugin): """ A Plugin to segment data using Gaussian Mixtures from scikit - :param classes: The number of classes for GMM. Default: 5. + :param classes: The number of classes for GMM. Default: 4. """ def __init__(self): super(GmmSegment3d, self).__init__("GmmSegment3d") def setup(self): - + in_dataset, out_dataset = self.get_datasets() out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') - + + getall = ["VOLUME_XZ", "voxel_y"] + in_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + out_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + def pre_process(self): # extract given parameters self.classes = self.parameters['classes'] @@ -58,9 +60,10 @@ def process_frames(self, data): Nsize3 = 1 if (dimensdata == 3): (Nsize1, Nsize2, Nsize3) = np.shape(data[0]) - + inputdata = data[0].reshape((Nsize1*Nsize2*Nsize3), 1)/np.max(data[0]) - + + #run classification and segmentation classif = GaussianMixture(n_components=self.classes, covariance_type="tied") classif.fit(inputdata) cluster = classif.predict(inputdata) @@ -72,9 +75,8 @@ def process_frames(self, data): maskGMM = segm.astype(np.float64) / np.max(segm) maskGMM = 255 * maskGMM # Now scale by 255 maskGMM = maskGMM.astype(np.uint8) # obtain the GMM mask - return [maskGMM] - + def nInput_datasets(self): return 1 def nOutput_datasets(self): diff --git a/savu/plugins/segmentation/geo_distance/geo_distance.py b/savu/plugins/segmentation/geo_distance/geo_distance.py index 18ec304ec..f206f25f3 100644 --- a/savu/plugins/segmentation/geo_distance/geo_distance.py +++ b/savu/plugins/segmentation/geo_distance/geo_distance.py @@ -13,7 +13,7 @@ # limitations under the License. """ -.. module:: Calculate geodesic distance transforms +.. module:: Calculate geodesic distance transform for 2D image :platform: Unix :synopsis: Wraps the code for calculating geodesic distance transforms, can be a \ usefull tool for data segmentation with a proper seed initialisation @@ -40,16 +40,14 @@ if lambda==0.0, return spatial euclidean distance without considering gradient if lambda==1.0, the distance is based on gradient only without using spatial distance """ -# Geodesic distance transform, the software can be installed from -# https://github.com/taigw/geodesic_distance with -import geodesic_distance +import GeodisTK import numpy as np @register_plugin class GeoDistance(Plugin, CpuPlugin): """ - Geodesic transformation of images with manual initialisation. - + Geodesic transformation of images with mask initialisation. + :param lambda: weighting betwween 0 and 1 . Default: 0.5. :param iterations: number of iteration for raster scanning . Default: 4. :param out_datasets: The default names . Default: ['GeoDist','max_values']. @@ -67,12 +65,11 @@ def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() in_pData[0].plugin_data_setup('VOLUME_YZ', 'single') - in_pData[1].plugin_data_setup('VOLUME_YZ', 'single') # the initialisation (mask) + in_pData[1].plugin_data_setup('VOLUME_YZ', 'single') # the mask initialisation out_dataset[0].create_dataset(in_dataset[0]) out_pData[0].plugin_data_setup('VOLUME_YZ', 'single') - fullData = in_dataset[0] slice_dirs = list(in_dataset[0].get_slice_dimensions()) self.new_shape = (np.prod(np.array(fullData.get_shape())[slice_dirs]), 1) @@ -89,7 +86,7 @@ def process_frames(self, data): indices = np.where(np.isnan(input_temp)) input_temp[indices] = 0.0 if (np.sum(data[1]) > 0): - geoDist = geodesic_distance.geodesic2d_raster_scan(input_temp, data[1], self.lambda_par, self.iterations) + geoDist = GeodisTK.geodesic2d_raster_scan(input_temp, data[1], self.lambda_par, self.iterations) else: geoDist = np.float32(np.zeros(np.shape(data[0]))) maxvalues = [np.max(geoDist)] diff --git a/savu/plugins/segmentation/geo_distance/geo_distance3D.py b/savu/plugins/segmentation/geo_distance/geo_distance3D.py index 685d1655b..ee238e7cb 100644 --- a/savu/plugins/segmentation/geo_distance/geo_distance3D.py +++ b/savu/plugins/segmentation/geo_distance/geo_distance3D.py @@ -13,7 +13,7 @@ # limitations under the License. """ -.. module:: Calculate geodesic distance transforms in 3D +.. module:: Calculate geodesic distance transform for 3D volume :platform: Unix :synopsis: Wraps the code for calculating geodesic distance transforms, can be a \ usefull tool for data segmentation with a proper seed initialisation @@ -40,15 +40,13 @@ if lambda==0.0, return spatial euclidean distance without considering gradient if lambda==1.0, the distance is based on gradient only without using spatial distance """ -# Geodesic distance transform, the software can be installed from -# https://github.com/taigw/geodesic_distance with -import geodesic_distance +import GeodisTK import numpy as np @register_plugin class GeoDistance3d(Plugin, MultiThreadedPlugin): """ - 3D geodesic transformation of images with manual initialisation. + 3D geodesic transformation of volumes with mask initialisation. :param lambda: weighting betwween 0 and 1 . Default: 0.5. :param iterations: number of iteration for raster scanning . Default: 4. @@ -61,11 +59,15 @@ def __init__(self): def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - in_pData[1].plugin_data_setup('VOLUME_3D', 'single') # the initialisation (mask) + + # If VOLUME_3D pattern doesn't exist then use "VOlUME_XZ" pattern with + # all of voxel_y dimension as this is equivalent to one VOLUME_3D scan. + getall = ['VOLUME_XZ', 'voxel_y'] + in_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + in_pData[1].plugin_data_setup('VOLUME_3D', 'single', getall=getall) # the mask initialisation out_dataset[0].create_dataset(in_dataset[0]) - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') + out_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) def pre_process(self): # extract given parameters @@ -76,8 +78,9 @@ def process_frames(self, data): input_temp = data[0] indices = np.where(np.isnan(input_temp)) input_temp[indices] = 0.0 + spacing = [1.0, 1.0, 1.0] if (np.sum(data[1]) > 0): - geoDist = geodesic_distance.geodesic3d_raster_scan(input_temp, data[1], self.lambda_par, self.iterations) + geoDist = GeodisTK.geodesic3d_raster_scan(input_temp, data[1], spacing, self.lambda_par, self.iterations) else: geoDist = np.float32(np.zeros(np.shape(data[0]))) return geoDist @@ -85,4 +88,4 @@ def process_frames(self, data): def nInput_datasets(self): return 2 def nOutput_datasets(self): - return 1 \ No newline at end of file + return 1 diff --git a/savu/plugins/segmentation/i23segmentation/__init__.py b/savu/plugins/segmentation/i23segmentation/__init__.py deleted file mode 100644 index 05ec9bfd3..000000000 --- a/savu/plugins/segmentation/i23segmentation/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -All the plugin architecture for Savu is contained here - - -.. moduleauthor:: Mark Basham - -""" - diff --git a/savu/plugins/segmentation/i23segmentation/final_segment_i23.py b/savu/plugins/segmentation/i23segmentation/final_segment_i23.py deleted file mode 100644 index ae18f7a1e..000000000 --- a/savu/plugins/segmentation/i23segmentation/final_segment_i23.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2019 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: creates final segmentation for i23 data, apply at the end of the process list - :platform: Unix - :synopsis: creates final segmentation for i23 data, apply at the end of the process list - -.. moduleauthor:: Daniil Kazantsev -""" - -from savu.plugins.plugin import Plugin -from savu.plugins.driver.cpu_plugin import CpuPlugin -from savu.plugins.utils import register_plugin - -import numpy as np - -@register_plugin -class FinalSegmentI23(Plugin, CpuPlugin): - """ - Apply at the end when all objects have been segmented independently (crystal, liquor, whole object) - - :param set_classes_val: Set the values for all 4 classes (crystal, liquor, loop, vacuum). Default: [255, 128, 64, 0]. - """ - - def __init__(self): - super(FinalSegmentI23, self).__init__("FinalSegmentI23") - - def setup(self): - - in_dataset, out_dataset = self.get_datasets() - in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') - - out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) - out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') - - def pre_process(self): - # extract given parameters - self.set_classes_val = self.parameters['set_classes_val'] - - def process_frames(self, data): - CrystSegm = data[0] - LiquorSegm = data[1] - WholeObjSegm = data[2] - LoopSegm = WholeObjSegm - LiquorSegm - notnull_ind = np.where(LoopSegm == 1) - LoopSegm[notnull_ind] = self.set_classes_val[2] - - FinalSegm = CrystSegm+LiquorSegm+LoopSegm - # now FinalSegm has got 4 values [0,1,2,loop_val] for [vacuum, liquor, crystal, loop] - - ind_d = np.where(FinalSegm == 0) # vacuum - FinalSegm[ind_d] = self.set_classes_val[3] - ind_d = np.where(FinalSegm == 1) # liquor - FinalSegm[ind_d] = self.set_classes_val[1] - ind_d = np.where(FinalSegm == 2) # crystal - FinalSegm[ind_d] = self.set_classes_val[0] - return [FinalSegm] - - def nInput_datasets(self): - return 3 - def nOutput_datasets(self): - return 1 diff --git a/savu/plugins/segmentation/i23segmentation/i23_segment.py b/savu/plugins/segmentation/i23segmentation/i23_segment.py deleted file mode 100644 index c9be812cc..000000000 --- a/savu/plugins/segmentation/i23segmentation/i23_segment.py +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright 2019 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: i23 beamline segmentation routine - :platform: Unix - :synopsis: Wraps i23 segmentation code for Gaussian Mixture clustering \ - and subsequent postprocessing of the segmented image - -.. moduleauthor:: Daniil Kazantsev -""" - -from savu.plugins.plugin import Plugin -from savu.plugins.driver.cpu_plugin import CpuPlugin -from savu.plugins.utils import register_plugin - -import numpy as np -from sklearn.mixture import GaussianMixture -# i23 reconstruction and segmentation routines -from i23.methods.segmentation import MASK_CORR - -@register_plugin -class I23Segment(Plugin, CpuPlugin): - """ - A Plugin to segment reconstructed data from i23 beamline. The projection data \ - should be first reconstructed iteratively using the ToMoBAR plugin. The goal of \ - the segmentation plugin is to cluster and segment data using Gaussian Mixtures \ - and then apply iterative model-based segmentation to further process the obtained \ - mask. https://github.com/dkazanc/i23seg - - :param correction_window: The size of the correction window. Default: 9. - :param iterations: The number of iterations for segmentation. Default: 10. - :param out_datasets: Default out dataset names. Default: ['maskGMM4', 'maskGMM4_proc', 'maskGMM5', 'maskGMM5_proc'] - """ - - def __init__(self): - super(I23Segment, self).__init__("I23Segment") - - def setup(self): - - in_dataset, out_dataset = self.get_datasets() - out_dataset[0].create_dataset(in_dataset[0]) - out_dataset[1].create_dataset(in_dataset[0]) - out_dataset[2].create_dataset(in_dataset[0]) - out_dataset[3].create_dataset(in_dataset[0]) - in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_XZ', 'single') - out_pData[0].plugin_data_setup('VOLUME_XZ', 'single') - out_pData[1].plugin_data_setup('VOLUME_XZ', 'single') - out_pData[2].plugin_data_setup('VOLUME_XZ', 'single') - out_pData[3].plugin_data_setup('VOLUME_XZ', 'single') - - def pre_process(self): - # extract given parameters - self.iterationsNumb = self.parameters['iterations'] - self.CorrectionWindow = self.parameters['correction_window'] - - # some fixed parameters - self.class_names4 = ('crystal','air','loop') # classes to process (order matters) - self.restricted_combinations_4classes = (('loop','crystal','liquor','loop'), - ('air','loop','liquor','liquor'), - ('air','loop','crystal','liquor'), - ('air','crystal','loop','loop'), - ('air','crystal','liquor','liquor'), - ('air','liquor','loop','loop')) - self.class_names5 = ('liquor','air','loop') # classes to process (order matters) - self.restricted_combinations_5classes = (('loop','crystal','liquor','loop'), - ('air','artifacts','liquor','liquor'), - ('air','loop','liquor','liquor'), - ('air','artifacts','loop','loop'), - ('air','crystal','loop','loop'), - ('air','loop','crystal','crystal')) - - def process_frames(self, data): - # Do GMM classification/segmentation first - dimensdata = data[0].ndim - if (dimensdata == 2): - (Nsize1, Nsize2) = np.shape(data[0]) - Nsize3 = 1 - if (dimensdata == 3): - (Nsize1, Nsize2, Nsize3) = np.shape(data[0]) - - #print(dimensdata) - inputdata = data[0].reshape((Nsize1*Nsize2*Nsize3), 1)/np.max(data[0]) - - classif = GaussianMixture(n_components=4, covariance_type="tied") - classif.fit(inputdata) - cluster = classif.predict(inputdata) - segm = classif.means_[cluster] - if (dimensdata == 2): - segm = segm.reshape(Nsize1, Nsize3, Nsize2) - else: - segm = segm.reshape(Nsize1, Nsize2, Nsize3) - maskGMM4 = segm.astype(np.float64) / np.max(segm) - maskGMM4 = 255 * maskGMM4 # Now scale by 255 - maskGMM4 = maskGMM4.astype(np.uint8) # obtain the GMM mask - - classif = GaussianMixture(n_components=5, covariance_type="tied") - classif.fit(inputdata) - cluster = classif.predict(inputdata) - segm = classif.means_[cluster] - if (dimensdata == 2): - segm = segm.reshape(Nsize1, Nsize3, Nsize2) - else: - segm = segm.reshape(Nsize1, Nsize2, Nsize3) - maskGMM5 = segm.astype(np.float64) / np.max(segm) - maskGMM5 = 255 * maskGMM5 # Now scale by 255 - maskGMM5 = maskGMM5.astype(np.uint8) # obtain the GMM mask - - # Post-processing part of obtained GMM masks - # 4 classes processing - pars4 = {'maskdata' : maskGMM4,\ - 'class_names': self.class_names4,\ - 'total_classesNum': 4,\ - 'restricted_combinations': self.restricted_combinations_4classes,\ - 'CorrectionWindow' : self.CorrectionWindow ,\ - 'iterationsNumb' : self.iterationsNumb} - - maskGMM4_proc = MASK_CORR(pars4['maskdata'], pars4['class_names'], \ - pars4['total_classesNum'], pars4['restricted_combinations'],\ - pars4['CorrectionWindow'], pars4['iterationsNumb']) - - # 5 classes processing - pars5 = {'maskdata' : maskGMM5,\ - 'class_names': self.class_names5,\ - 'total_classesNum': 5,\ - 'restricted_combinations': self.restricted_combinations_5classes,\ - 'CorrectionWindow' : self.CorrectionWindow ,\ - 'iterationsNumb' : self.iterationsNumb} - - maskGMM5_proc = MASK_CORR(pars5['maskdata'], pars5['class_names'], \ - pars5['total_classesNum'], pars5['restricted_combinations'],\ - pars5['CorrectionWindow'], pars5['iterationsNumb']) - - return [maskGMM4,maskGMM4_proc,maskGMM5,maskGMM5_proc] - - def nInput_datasets(self): - return 1 - def nOutput_datasets(self): - return 4 - \ No newline at end of file diff --git a/savu/plugins/segmentation/i23segmentation/i23_segment3D.py b/savu/plugins/segmentation/i23segmentation/i23_segment3D.py deleted file mode 100644 index 69138e30a..000000000 --- a/savu/plugins/segmentation/i23segmentation/i23_segment3D.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 2019 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: i23 beamline post-segmentation routine - :platform: Unix - :synopsis: Wraps i23 segmentation code for subsequent postprocessing of the segmented image - -.. moduleauthor:: Daniil Kazantsev -""" - -from savu.plugins.plugin import Plugin -#from savu.plugins.driver.cpu_plugin import CpuPlugin -from savu.plugins.driver.multi_threaded_plugin import MultiThreadedPlugin -from savu.plugins.utils import register_plugin - -import numpy as np -from i23.methods.segmentation import MASK_CORR -# https://github.com/dkazanc/i23seg - -@register_plugin -class I23Segment3d(Plugin, MultiThreadedPlugin): - """ - A Plugin to segment reconstructed data from i23 beamline. The projection data \ - should be first reconstructed iteratively using the ToMoBAR plugin. The goal of \ - the segmentation plugin is to cluster and segment data using Gaussian Mixtures \ - and then apply iterative model-based segmentation to further process the obtained mask \ - INPUT to the plugin is the result of gmm_segment plugin - - :param classes: The number of classes for GMM. Default: 5. - :param correction_window: The size of the correction (non-local) window. Default: 8. - :param iterations: The number of iterations for segmentation. Default: 10. - """ - - def __init__(self): - super(I23Segment3d, self).__init__("I23Segment3d") - - def setup(self): - - in_dataset, out_dataset = self.get_datasets() - out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) - in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') - - def pre_process(self): - # extract given parameters - self.classes = self.parameters['classes'] - self.iterationsNumb = self.parameters['iterations'] - self.CorrectionWindow = self.parameters['correction_window'] - - # some fixed parameters - if (self.classes == 4): - self.class_names4 = ('crystal','air','loop') # classes to process (order matters) - self.restricted_combinations_4classes = (('loop','crystal','liquor','loop'), - ('air','loop','liquor','liquor'), - ('air','loop','crystal','liquor'), - ('air','crystal','loop','loop'), - ('air','crystal','liquor','liquor'), - ('air','liquor','loop','loop')) - elif (self.classes == 5): - self.class_names5 = ('liquor','air','loop') # classes to process (order matters) - self.restricted_combinations_5classes = (('loop','crystal','liquor','loop'), - ('air','artifacts','liquor','liquor'), - ('air','loop','liquor','liquor'), - ('air','artifacts','loop','loop'), - ('air','crystal','loop','loop'), - ('air','loop','crystal','crystal')) - else: - raise ("Choose 4 or 5 classes") - - def process_frames(self, data): - if (self.classes == 4): - # Post-processing part of obtained GMM masks (4 classes processing) - pars4 = {'maskdata' : data[0].astype(np.uint8),\ - 'class_names': self.class_names4,\ - 'total_classesNum': 4,\ - 'restricted_combinations': self.restricted_combinations_4classes,\ - 'CorrectionWindow' : self.CorrectionWindow ,\ - 'iterationsNumb' : self.iterationsNumb} - - maskGMM_proc = MASK_CORR(pars4['maskdata'], pars4['class_names'], \ - pars4['total_classesNum'], pars4['restricted_combinations'],\ - pars4['CorrectionWindow'], pars4['iterationsNumb']) - - if (self.classes == 5): - # 5 classes processing - pars5 = {'maskdata' : data[0].astype(np.uint8),\ - 'class_names': self.class_names5,\ - 'total_classesNum': 5,\ - 'restricted_combinations': self.restricted_combinations_5classes,\ - 'CorrectionWindow' : self.CorrectionWindow ,\ - 'iterationsNumb' : self.iterationsNumb} - - maskGMM_proc = MASK_CORR(pars5['maskdata'], pars5['class_names'], \ - pars5['total_classesNum'], pars5['restricted_combinations'],\ - pars5['CorrectionWindow'], pars5['iterationsNumb']) - - return [maskGMM_proc] - - def nInput_datasets(self): - return 1 - def nOutput_datasets(self): - return 1 \ No newline at end of file diff --git a/savu/plugins/segmentation/morphological_operations/morph_proc.py b/savu/plugins/segmentation/morphological_operations/morph_proc.py index effbd6917..d0c396fdf 100644 --- a/savu/plugins/segmentation/morphological_operations/morph_proc.py +++ b/savu/plugins/segmentation/morphological_operations/morph_proc.py @@ -13,9 +13,9 @@ # limitations under the License. """ -.. module:: 2D morphological processing of binary or grayscale datasets +.. module:: morph_proc :platform: Unix - :synopsis: Wrapper around skimage morphology routines for 2D morphological processing of binary or grayscale datasets + :synopsis: Wrapper around skimage morphology routines for 2D morphological processing of binary datasets .. moduleauthor:: Daniil Kazantsev """ @@ -31,8 +31,7 @@ @register_plugin class MorphProc(Plugin, CpuPlugin): """ - A Plugin to perform morphological operations on grayscale images \ - (use: erosion, dilation, opening, closing) or binary images \ + A Plugin to perform morphological operations on binary images \ (use: binary_erosion, binary_dilation, binary_opening, binary_closing) :param disk_radius: The radius of the disk-shaped structuring element for morphology. Default: 5. diff --git a/savu/plugins/segmentation/morphological_operations/merge_binary_mask.py b/savu/plugins/segmentation/morphological_operations/morph_proc_line.py similarity index 55% rename from savu/plugins/segmentation/morphological_operations/merge_binary_mask.py rename to savu/plugins/segmentation/morphological_operations/morph_proc_line.py index 127793c9f..ede4570a5 100644 --- a/savu/plugins/segmentation/morphological_operations/merge_binary_mask.py +++ b/savu/plugins/segmentation/morphological_operations/morph_proc_line.py @@ -13,9 +13,9 @@ # limitations under the License. """ -.. module:: merge_binary_mask +.. module:: morph_proc_line :platform: Unix - :synopsis: module to remove gaps in the provided binary mask by merging the boundaries + :synopsis: a Larix module to remove inconsistent gaps in the resulted binary mask by merging the boundaries .. moduleauthor:: Daniil Kazantsev """ @@ -25,51 +25,51 @@ from savu.plugins.utils import register_plugin import numpy as np -from larix.methods.segmentation import MASK_MORPH +from larix.methods.segmentation import MORPH_PROC_LINE @register_plugin -class MergeBinaryMask(Plugin, CpuPlugin): +class MorphProcLine(Plugin, CpuPlugin): """ - A plugin to remove gaps in the provided binary mask by merging the boundaries + A Larix morphological processing module using line segments to remove inconsistent gaps - :param primeclass: class to start morphological processing from. Default: 0. - :param correction_window: The size of the correction window. Default: 7. - :param iterations: The number of iterations for segmentation. Default: 15. - :param pattern: pattern to apply this to. Default: "VOLUME_XY". + :param primeclass: a mask class to start morphological processing from. Default: 0. + :param correction_window: the size of the correction window. Default: 7. + :param iterations: the number of iterations for segmentation. Default: 15. + :param pattern: pattern to apply this to. Default: "VOLUME_YZ". """ def __init__(self): - super(MergeBinaryMask, self).__init__("MergeBinaryMask") + super(MorphProcLine, self).__init__("MorphProcLine") - def setup(self): + def setup(self): in_dataset, out_dataset = self.get_datasets() in_pData, out_pData = self.get_plugin_datasets() in_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) out_pData[0].plugin_data_setup(self.parameters['pattern'], 'single') - + def pre_process(self): # extract given parameters self.primeclass = self.parameters['primeclass'] - self.CorrectionWindow = self.parameters['correction_window'] - self.iterationsNumb = self.parameters['iterations'] + self.CorrectionWindow = self.parameters['correction_window'] + self.iterationsNumb = self.parameters['iterations'] - def process_frames(self, data): + def process_frames(self, data): inputdata = data[0].copy(order='C') - - pars = {'maskdata' : np.uint8(inputdata),\ - 'primeClass': self.primeclass,\ - 'CorrectionWindow' : self.CorrectionWindow ,\ - 'iterationsNumb' : self.iterationsNumb} - - # run class merging here: - mask_merged = MASK_MORPH(pars['maskdata'], pars['primeClass'], - pars['CorrectionWindow'], pars['iterationsNumb']) + if (np.sum(inputdata) > 0): + pars = {'maskdata' : np.uint8(inputdata),\ + 'primeClass': self.primeclass,\ + 'CorrectionWindow' : self.CorrectionWindow ,\ + 'iterationsNumb' : self.iterationsNumb} + # run class merging module here: + mask_merged = MORPH_PROC_LINE(pars['maskdata'], pars['primeClass'], + pars['CorrectionWindow'], pars['iterationsNumb']) + else: + mask_merged = np.uint8(np.zeros(np.shape(inputdata))) return mask_merged - + def nInput_datasets(self): return 1 def nOutput_datasets(self): return 1 - diff --git a/savu/plugins/segmentation/morphological_operations/merge_binary_mask_3D.py b/savu/plugins/segmentation/morphological_operations/morph_proc_line3D.py similarity index 61% rename from savu/plugins/segmentation/morphological_operations/merge_binary_mask_3D.py rename to savu/plugins/segmentation/morphological_operations/morph_proc_line3D.py index 59505b022..7032d26c5 100644 --- a/savu/plugins/segmentation/morphological_operations/merge_binary_mask_3D.py +++ b/savu/plugins/segmentation/morphological_operations/morph_proc_line3D.py @@ -13,62 +13,63 @@ # limitations under the License. """ -.. module:: merge_binary_mask_3D +.. module:: morph_proc_line3D :platform: Unix - :synopsis: module to remove gaps in the provided 3D binary mask by merging the boundaries + :synopsis: a Larix module to remove inconsistent gaps in the resulted 3D binary mask by merging the boundaries .. moduleauthor:: Daniil Kazantsev """ from savu.plugins.plugin import Plugin -#from savu.plugins.driver.cpu_plugin import CpuPlugin from savu.plugins.driver.multi_threaded_plugin import MultiThreadedPlugin from savu.plugins.utils import register_plugin import numpy as np -from larix.methods.segmentation import MASK_MORPH +from larix.methods.segmentation import MORPH_PROC_LINE @register_plugin -class MergeBinaryMask3d(Plugin, MultiThreadedPlugin): +class MorphProcLine3d(Plugin, MultiThreadedPlugin): """ - A plugin to remove gaps in the provided 3D binary mask by merging the boundaries + A Larix morphological processing module using line segments to remove inconsistent gaps in 3D mask - :param primeclass: class to start morphological processing from. Default: 0. - :param correction_window: The size of the correction window. Default: 7. - :param iterations: The number of iterations for segmentation. Default: 3. + :param primeclass: a mask class to start morphological processing from. Default: 0. + :param correction_window: the size of the correction window. Default: 7. + :param iterations: the number of iterations for segmentation. Default: 3. """ def __init__(self): - super(MergeBinaryMask3d, self).__init__("MergeBinaryMask3d") + super(MorphProcLine3d, self).__init__("MorphProcLine3d") def setup(self): - + in_dataset, out_dataset = self.get_datasets() out_dataset[0].create_dataset(in_dataset[0], dtype=np.uint8) in_pData, out_pData = self.get_plugin_datasets() - in_pData[0].plugin_data_setup('VOLUME_3D', 'single') - out_pData[0].plugin_data_setup('VOLUME_3D', 'single') + getall = ["VOLUME_XZ", "voxel_y"] + in_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + out_pData[0].plugin_data_setup('VOLUME_3D', 'single', getall=getall) + def pre_process(self): # extract given parameters self.primeclass = self.parameters['primeclass'] - self.CorrectionWindow = self.parameters['correction_window'] - self.iterationsNumb = self.parameters['iterations'] + self.CorrectionWindow = self.parameters['correction_window'] + self.iterationsNumb = self.parameters['iterations'] def process_frames(self, data): - # run class merging here: + # run the class merging module here: inputdata = data[0].copy(order='C') - + pars = {'maskdata' : np.uint8(inputdata),\ 'primeClass': self.primeclass,\ 'CorrectionWindow' : self.CorrectionWindow ,\ - 'iterationsNumb' : self.iterationsNumb} - - mask_merged = MASK_MORPH(pars['maskdata'], pars['primeClass'], - pars['CorrectionWindow'], pars['iterationsNumb']) + 'iterationsNumb' : self.iterationsNumb} + + mask_merged = MORPH_PROC_LINE(pars['maskdata'], pars['primeClass'], + pars['CorrectionWindow'], pars['iterationsNumb']) return mask_merged - + def nInput_datasets(self): return 1 def nOutput_datasets(self): - return 1 \ No newline at end of file + return 1 diff --git a/savu/plugins/segmentation/morphological_operations/morph_remove_objects.py b/savu/plugins/segmentation/morphological_operations/morph_remove_objects.py index d1d73719a..68931e261 100644 --- a/savu/plugins/segmentation/morphological_operations/morph_remove_objects.py +++ b/savu/plugins/segmentation/morphological_operations/morph_remove_objects.py @@ -58,13 +58,12 @@ def pre_process(self): def process_frames(self, data): # run morphological operations here: #integerMax = np.max(data[0]) - #if (np.sum(data[0]) > 0): - - morph_result = remove_small_objects(data[0].astype(bool), self.min_size, self.connectivity, in_place=False) - morph_result = morph_result*1 - #else: - # morph_result = np.uint8(np.zeros(np.shape(data[0]))) - return [morph_result] + if (np.sum(data[0]) > 0): + morph_result = remove_small_objects(data[0].astype(bool), self.min_size, self.connectivity, in_place=False) + #morph_result = morph_result*1 + else: + morph_result = np.uint8(np.zeros(np.shape(data[0]))) + return morph_result def nInput_datasets(self): return 1 diff --git a/savu/plugins/stats/min_and_max.py b/savu/plugins/stats/min_and_max.py index b79791e2f..7b10d05c2 100644 --- a/savu/plugins/stats/min_and_max.py +++ b/savu/plugins/stats/min_and_max.py @@ -26,6 +26,7 @@ from savu.plugins.driver.cpu_plugin import CpuPlugin import savu.core.utils as cu + @register_plugin class MinAndMax(Plugin, CpuPlugin): """ @@ -74,14 +75,14 @@ def pre_process(self): ratio = 1.0 self.mask = self.circle_mask(width, ratio) else: - self.mask = np.ones((width,width), dtype=np.float32) + self.mask = np.ones((width, width), dtype=np.float32) self.method = self.parameters['method'] - if not (self.method=='percentile' or self.method=='extrema'): + if not (self.method == 'percentile' or self.method == 'extrema'): msg = "\n***********************************************\n"\ "!!! ERROR !!! -> Wrong method. Please use only one of "\ "the provided options \n"\ "***********************************************\n" - logging.warn(msg) + logging.warning(msg) cu.user_message(msg) raise ValueError(msg) self.p_min, self.p_max = np.sort(np.clip(np.asarray( @@ -89,17 +90,18 @@ def pre_process(self): def process_frames(self, data): use_filter = self.parameters['smoothing'] + frame = np.nan_to_num(data[0]) if use_filter is True: - frame = gaussian_filter(data[0],(3,3))*self.mask + frame = gaussian_filter(frame, (3, 3)) * self.mask else: - frame = data[0]*self.mask + frame = frame * self.mask if self.method == 'percentile': list_out = [np.array( - [np.percentile(frame, self.p_min)], dtype=np.float32), \ - np.array([np.percentile(frame, self.p_max)],dtype=np.float32)] + [np.percentile(frame, self.p_min)], dtype=np.float32), + np.array([np.percentile(frame, self.p_max)], dtype=np.float32)] else: - list_out =[np.array([np.min(frame)], dtype=np.float32),\ - np.array([np.max(frame)], dtype=np.float32)] + list_out = [np.array([np.min(frame)], dtype=np.float32), + np.array([np.max(frame)], dtype=np.float32)] return list_out def post_process(self): @@ -122,9 +124,9 @@ def setup(self): labels = ['x.pixels', 'y.pixels'] for i in range(len(out_datasets)): out_datasets[i].create_dataset(shape=new_shape, axis_labels=labels, - remove=True, transport='hdf5') + remove=True, transport='hdf5') out_datasets[i].add_pattern( - "METADATA", core_dims=(1,), slice_dims=(0,)) + "METADATA", core_dims=(1,), slice_dims=(0,)) out_pData[i].plugin_data_setup('METADATA', 'single') def _get_pattern(self): diff --git a/install/2_0_install/conda-recipes/__init__.py b/savu/plugins/unregistered/fluo_fitters/__init__.py similarity index 100% rename from install/2_0_install/conda-recipes/__init__.py rename to savu/plugins/unregistered/fluo_fitters/__init__.py diff --git a/savu/plugins/fluo_fitters/base_fluo_fitter.py b/savu/plugins/unregistered/fluo_fitters/base_fluo_fitter.py similarity index 92% rename from savu/plugins/fluo_fitters/base_fluo_fitter.py rename to savu/plugins/unregistered/fluo_fitters/base_fluo_fitter.py index 6998b0109..a07f1f84c 100644 --- a/savu/plugins/fluo_fitters/base_fluo_fitter.py +++ b/savu/plugins/unregistered/fluo_fitters/base_fluo_fitter.py @@ -87,7 +87,7 @@ def setup(self): numpeaks = len(idx) new_shape = shape[:-1] + (numpeaks,) - channel = {'core_dims': (-1,), 'slice_dims': range(len(shape)-1)} + channel = {'core_dims': (-1,), 'slice_dims': list(range(len(shape)-1))} fitAreas.create_dataset(patterns={in_dataset[0]: pattern_list}, axis_labels={in_dataset[0]: axis_labels}, shape=new_shape) @@ -175,7 +175,7 @@ def findLines(self, paramdict=XRFDataset().paramdict): count += 1.0 if(count == 0.0): break - linepos = linepos/count + linepos = linepos // count if(linepos > fitting_range[0] and linepos < fitting_range[1]): peakpos.append(linepos) @@ -221,13 +221,9 @@ def findLines(self, paramdict=XRFDataset().paramdict): def getAreas(self, fun, x, positions, fitmatrix): rest = fitmatrix numargsinp = self.getFitFunctionNumArgs(str(fun.__name__)) # 2 in - npts = len(fitmatrix) / numargsinp - #print npts + npts = len(fitmatrix) // numargsinp weights = rest[:npts] - #print 'the weights are'+str(weights) widths = rest[npts:2*npts] - #print 'the widths are'+str(widths) - #print(len(widths)) areas = [] for ii in range(len(weights)): areas.append(np.sum(fun(weights[ii], @@ -258,36 +254,29 @@ def getFitFunction(self,key): return self.lookup[key] def _resid(self, p, fun, y, x, pos): - #print fun.__name__ r = y-self._spectrum_sum(fun, x, pos, *p) - + return r def dfunc(self, p, fun, y, x, pos): if fun.__name__ == 'gaussian' or fun.__name__ == 'lorentzian': # took the lorentzian out. Weird - #print fun.__name__ rest = p - #print "parameter shape is "+ str(p.shape) - npts = len(p) / 2 + npts = len(p) // 2 a = rest[:npts] sig = rest[npts:2*npts] mu = pos - # print "len mu"+str(len(mu)) - # print "len x"+str(len(x)) if fun.__name__ == 'gaussian': da = self.spectrum_sum_dfun(fun, 1./a, x, mu, *p) - #dmu_mult = np.zeros((len(mu), len(x))) dsig_mult = np.zeros((npts, len(x))) for i in range(npts): dsig_mult[i] = ((x-mu[i])**2) / sig[i]**3 dsig = self.spectrum_sum_dfun(fun, dsig_mult, x, mu, *p) op = np.concatenate([-da, -dsig]) elif fun.__name__ == 'lorentzian': - #print "hey" da = self.spectrum_sum_dfun(fun, 1./a, x, mu, *p) dsig = np.zeros((npts, len(x))) for i in range(npts): - nom = 8 * a[i]* sig[i] * (x - mu[i]) ** 2 + nom = 8 * a[i] * sig[i] * (x - mu[i]) ** 2 denom = (sig[i]**2 + 4.0 * (x - mu[i])**2)**2 dsig[i] = nom / denom op = np.concatenate([-da, -dsig]) @@ -297,11 +286,9 @@ def dfunc(self, p, fun, y, x, pos): def _spectrum_sum(self, fun, x, positions, *p): rest = np.abs(p) - npts = len(p) / 2 + npts = len(p) // 2 weights = rest[:npts] - #print weights widths = rest[npts:2*npts] - #print widths spec = np.zeros((len(x),)) for ii in range(len(weights)): spec += fun(weights[ii], widths[ii], x, positions[ii]) @@ -309,12 +296,9 @@ def _spectrum_sum(self, fun, x, positions, *p): def spectrum_sum_dfun(self, fun, multiplier, x, pos, *p): rest = p - npts = len(p) / 2 - # print npts + npts = len(p) // 2 weights = rest[:npts] - #print weights widths = rest[npts:2*npts] - #print widths positions = pos # print(len(positions)) spec = np.zeros((npts, len(x))) @@ -329,10 +313,6 @@ def spectrum_sum_dfun(self, fun, multiplier, x, pos, *p): return spec def lorentzian(a, w, x, c): -# w = np.abs(w) -# numerator = (w**2) -# denominator = (x - c)**2 + w**2 -# y = np.abs(a)*(numerator/denominator) y = a / (1.0 + (2.0 * (c - x) / w) ** 2) return y diff --git a/savu/plugins/fluo_fitters/fastxrf_fitting.py b/savu/plugins/unregistered/fluo_fitters/fastxrf_fitting.py similarity index 99% rename from savu/plugins/fluo_fitters/fastxrf_fitting.py rename to savu/plugins/unregistered/fluo_fitters/fastxrf_fitting.py index ad94e3820..7a5a4c7cf 100644 --- a/savu/plugins/fluo_fitters/fastxrf_fitting.py +++ b/savu/plugins/unregistered/fluo_fitters/fastxrf_fitting.py @@ -27,7 +27,7 @@ from savu.plugins.utils import register_plugin -@register_plugin +#@register_plugin class FastxrfFitting(BaseFluoFitter): """ fast fluorescence fitting with FastXRF. Needs to be on the path. diff --git a/savu/plugins/fluo_fitters/simple_fit_xrf.py b/savu/plugins/unregistered/fluo_fitters/simple_fit_xrf.py similarity index 99% rename from savu/plugins/fluo_fitters/simple_fit_xrf.py rename to savu/plugins/unregistered/fluo_fitters/simple_fit_xrf.py index 6a281aea8..2a3f5040e 100644 --- a/savu/plugins/fluo_fitters/simple_fit_xrf.py +++ b/savu/plugins/unregistered/fluo_fitters/simple_fit_xrf.py @@ -28,7 +28,7 @@ import time -@register_plugin +#@register_plugin class SimpleFitXrf(BaseFluoFitter): """ This plugin fits XRF peaks. diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/__init__.py b/savu/plugins/unregistered/i18_loaders/__init__.py similarity index 100% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/__init__.py rename to savu/plugins/unregistered/i18_loaders/__init__.py diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/base_i18_multi_modal_loader.py b/savu/plugins/unregistered/i18_loaders/base_i18_multi_modal_loader.py similarity index 96% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/base_i18_multi_modal_loader.py rename to savu/plugins/unregistered/i18_loaders/base_i18_multi_modal_loader.py index 24920c4d1..c4760d363 100644 --- a/savu/plugins/loaders/mapping_loaders/i18_loaders/base_i18_multi_modal_loader.py +++ b/savu/plugins/unregistered/i18_loaders/base_i18_multi_modal_loader.py @@ -57,8 +57,8 @@ def multi_modal_setup(self, ltype, name): data_obj.backing_file.filename, ltype) data_obj.meta_data.set( - "mono_energy", f[self.parameters['monochromator']].value/1e3) - x = f[self.parameters['x']].value + "mono_energy", f[self.parameters['monochromator']][()]/1e3) + x = f[self.parameters['x']][()] if self.parameters['x'] is not None: if x.ndim > 1: @@ -67,10 +67,10 @@ def multi_modal_setup(self, ltype, name): data_obj.meta_data.set("x", x) if self.parameters['y'] is not None: - y = f[self.parameters['y']].value + y = f[self.parameters['y']][()] data_obj.meta_data.set("y", y) if self.parameters['rotation'] is not None: - rotation_angle = f[self.parameters['rotation']].value + rotation_angle = f[self.parameters['rotation']][()] if rotation_angle.ndim > 1: rotation_angle = rotation_angle[:, 0] @@ -128,7 +128,7 @@ def set_motors(self, data_obj, ltype): label = 'detector_y' units = 'index' chk=chk+1 - + except IndexError: ''' some additional singleton dimensions have been added in the latest mapping project stuff on I18 @@ -172,7 +172,7 @@ def add_patterns_based_on_acquisition(self, data_obj, ltype): # logging.debug projection elif key == 'rotation': rotation = item - dims = range(len(data_obj.get_shape())) + dims = list(range(len(data_obj.get_shape()))) if data_obj.data_mapping._is_map: proj_dir = tuple(projection) data_obj.add_pattern("PROJECTION", core_dims=proj_dir, @@ -185,20 +185,20 @@ def add_patterns_based_on_acquisition(self, data_obj, ltype): if slice_dims: data_obj.add_pattern("SINOGRAM", core_dims=sino_dir, slice_dims=slice_dims) - + if ltype == 'fluo': spec_core = (-1,) # it will always be this spec_slice = tuple(dims[:-1]) data_obj.add_pattern("SPECTRUM", core_dims=spec_core, slice_dims=spec_slice) - - + + if ltype == 'xrd': diff_core = (-2,-1) # it will always be this diff_slice = tuple(dims[:-2]) data_obj.add_pattern("DIFFRACTION", core_dims=diff_core, slice_dims=diff_slice) - + if ltype == 'monitor': # this is needed for I0 corrections of single sinogram ND data channel_core = (dims[-1],) diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_fluo_loader.py b/savu/plugins/unregistered/i18_loaders/i18_fluo_loader.py similarity index 99% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/i18_fluo_loader.py rename to savu/plugins/unregistered/i18_loaders/i18_fluo_loader.py index d1cd2c660..046151019 100644 --- a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_fluo_loader.py +++ b/savu/plugins/unregistered/i18_loaders/i18_fluo_loader.py @@ -27,7 +27,6 @@ from savu.plugins.utils import register_plugin -@register_plugin class I18FluoLoader(BaseI18MultiModalLoader): """ A class to load tomography data from an NXstxm file diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_mm_loader.py b/savu/plugins/unregistered/i18_loaders/i18_mm_loader.py similarity index 94% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/i18_mm_loader.py rename to savu/plugins/unregistered/i18_loaders/i18_mm_loader.py index 2963314cb..ae2da98d9 100644 --- a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_mm_loader.py +++ b/savu/plugins/unregistered/i18_loaders/i18_mm_loader.py @@ -39,7 +39,6 @@ from savu.core.utils import docstring_parameter -@register_plugin class I18MmLoader(BaseLoader): def __init__(self, name='I18MmLoader'): @@ -53,19 +52,19 @@ def __init__(self, name='I18MmLoader'): self.stxm_keys = self.set_params(stxm(), 'stxm') self.mon_keys = self.set_params(mon(), 'monitor') - for key, value in self.dict.iteritems(): + for key, value in self.dict.items(): self.parameters[key] = value def set_params(self, inst, name): inst._populate_default_parameters() - copy_keys = inst.parameters.viewkeys() - self.dict.viewkeys() + copy_keys = inst.parameters.keys() - self.dict.keys() for key in [k for k in copy_keys if k != 'name']: if key != 'name': self.parameters[key] = inst.parameters[key] return list(copy_keys) def separate_params(self, keys): - all_keys = self.dict.keys() + keys + all_keys = list(self.dict.keys()) + keys new_dict = {} for key in [k for k in all_keys if k != 'name']: new_dict[key] = self.parameters[key] @@ -103,7 +102,7 @@ def _data_loader(self, inst, name, key): inst.initialise(self.separate_params(key), self.exp) logging.debug(debug_str) except IndexError: - logging.warn(warn_str) + logging.warning(warn_str) except: raise diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_monitor_loader.py b/savu/plugins/unregistered/i18_loaders/i18_monitor_loader.py similarity index 99% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/i18_monitor_loader.py rename to savu/plugins/unregistered/i18_loaders/i18_monitor_loader.py index 086d3ca82..1a1c9a17d 100644 --- a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_monitor_loader.py +++ b/savu/plugins/unregistered/i18_loaders/i18_monitor_loader.py @@ -27,7 +27,6 @@ from savu.plugins.utils import register_plugin -@register_plugin class I18MonitorLoader(BaseI18MultiModalLoader): """ A class to load tomography data from an monitor file diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_stxm_loader.py b/savu/plugins/unregistered/i18_loaders/i18_stxm_loader.py similarity index 99% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/i18_stxm_loader.py rename to savu/plugins/unregistered/i18_loaders/i18_stxm_loader.py index 784d13ca9..b00f28be0 100644 --- a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_stxm_loader.py +++ b/savu/plugins/unregistered/i18_loaders/i18_stxm_loader.py @@ -27,7 +27,6 @@ from savu.plugins.utils import register_plugin -@register_plugin class I18StxmLoader(BaseI18MultiModalLoader): """ A class to load tomography data from an NXstxm file diff --git a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_xrd_loader.py b/savu/plugins/unregistered/i18_loaders/i18_xrd_loader.py similarity index 89% rename from savu/plugins/loaders/mapping_loaders/i18_loaders/i18_xrd_loader.py rename to savu/plugins/unregistered/i18_loaders/i18_xrd_loader.py index d965e4af4..eed54868e 100644 --- a/savu/plugins/loaders/mapping_loaders/i18_loaders/i18_xrd_loader.py +++ b/savu/plugins/unregistered/i18_loaders/i18_xrd_loader.py @@ -34,7 +34,6 @@ import savu.test.test_utils as tu -@register_plugin class I18XrdLoader(BaseI18MultiModalLoader): """ A class to load tomography data from an NXstxm file @@ -56,7 +55,7 @@ def setup(self): data_obj = self.multi_modal_setup('xrd', self.parameters['name']) scan_pattern = self.parameters['scan_pattern'] - frame_dim = range(len(scan_pattern)) + frame_dim = list(range(len(scan_pattern))) shape = [] for pattern in self.parameters['scan_pattern']: @@ -84,36 +83,36 @@ def setup(self): logging.debug('testing the version of the calibration file') det_str = 'entry1/instrument/detector' mData = data_obj.meta_data - xpix = calibrationfile[det_str + '/detector_module/fast_pixel_direction'].value*1e-3 # in metres + xpix = calibrationfile[det_str + '/detector_module/fast_pixel_direction'][()]*1e-3 # in metres mData.set("x_pixel_size",xpix) mData.set("beam_center_x", - calibrationfile[det_str + '/beam_center_x'].value*1e-3) #in metres + calibrationfile[det_str + '/beam_center_x'][()]*1e-3) #in metres mData.set("beam_center_y", - calibrationfile[det_str + '/beam_center_y'].value*1e-3) # in metres + calibrationfile[det_str + '/beam_center_y'][()]*1e-3) # in metres mData.set("distance", - calibrationfile[det_str + '/distance'].value*1e-3) # in metres + calibrationfile[det_str + '/distance'][()]*1e-3) # in metres mData.set("incident_wavelength", calibrationfile['/entry1/calibration_sample/beam' - '/incident_wavelength'].value*1e-10) # in metres - mData.set("yaw", -calibrationfile[det_str + '/transformations/euler_b'].value)# in degrees - mData.set("roll",calibrationfile[det_str + '/transformations/euler_c'].value-180.0)# in degrees + '/incident_wavelength'][()]*1e-10) # in metres + mData.set("yaw", -calibrationfile[det_str + '/transformations/euler_b'][()])# in degrees + mData.set("roll",calibrationfile[det_str + '/transformations/euler_c'][()]-180.0)# in degrees logging.debug('.... its the version in DAWN 2.0') except KeyError: try: det_str = 'entry/instrument/detector' mData = data_obj.meta_data - xpix = calibrationfile[det_str + '/x_pixel_size'].value * 1e-3 + xpix = calibrationfile[det_str + '/x_pixel_size'][()] * 1e-3 mData.set("x_pixel_size", xpix) # in metres mData.set("beam_center_x", - calibrationfile[det_str + '/beam_center_x'].value*xpix)# in metres + calibrationfile[det_str + '/beam_center_x'][()]*xpix)# in metres mData.set("beam_center_y", - calibrationfile[det_str + '/beam_center_y'].value*xpix) # in metres + calibrationfile[det_str + '/beam_center_y'][()]*xpix) # in metres mData.set("distance", - calibrationfile[det_str + '/distance'].value*1e-3) # in metres + calibrationfile[det_str + '/distance'][()]*1e-3) # in metres mData.set("incident_wavelength", calibrationfile['/entry/calibration_sample/beam' - '/incident_wavelength'].value*1e-10)# in metres + '/incident_wavelength'][()]*1e-10)# in metres orien = calibrationfile[det_str + '/detector_orientation'][...].reshape((3, 3)) yaw = math.degrees(-math.atan2(orien[2, 0], orien[2, 2]))# in degrees roll = math.degrees(-math.atan2(orien[0, 1], orien[1, 1]))# in degrees @@ -122,7 +121,7 @@ def setup(self): mData.set("roll", roll) logging.debug('.... its the legacy version pre-DAWN 2.0') except KeyError: - logging.warn("We don't know what type of calibration file this is") + logging.warning("We don't know what type of calibration file this is") self.set_data_reduction_params(data_obj) calibrationfile.close() diff --git a/savu/plugins/utils.py b/savu/plugins/utils.py index 47a7aeeba..652af9852 100644 --- a/savu/plugins/utils.py +++ b/savu/plugins/utils.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - """ .. module:: utils :platform: Unix @@ -27,17 +26,16 @@ import ast import logging import savu -import copy import importlib -import imp import inspect import itertools +from collections import OrderedDict +# can I remove these from here? plugins = {} plugins_path = {} dawn_plugins = {} -dawn_plugin_params = {} count = 0 OUTPUT_TYPE_DATA_ONLY = 0 @@ -63,13 +61,12 @@ def _dawn_compatible(clazz): try: plugin_path = sys.modules[clazz.__module__].__file__ # looks out for .pyc files - dawn_plugins[clazz.__name__]['path2plugin'] = \ - plugin_path.split('.py')[0]+'.py' - dawn_plugins[clazz.__name__]['plugin_output_type'] =\ - _plugin_output_type + dawn_plugins[clazz.__name__]['path2plugin'] = plugin_path.split('.py')[0] + '.py' + dawn_plugins[clazz.__name__]['plugin_output_type'] = _plugin_output_type except Exception as e: - print e + print(e) return clazz + # for backwards compatibility, if decorator is invoked without brackets... if inspect.isclass(plugin_output_type): _plugin_output_type = OUTPUT_TYPE_METADATA_AND_DATA @@ -107,16 +104,20 @@ def load_class(name, cls_name=None): cls_name = _get_cls_name(name) if not cls_name else cls_name if cls_name in plugins.keys(): return plugins[cls_name] - mod = \ - imp.load_source(name, path) if path else importlib.import_module(name) + if path: + mod = importlib.machinery.SourceFileLoader(name, path).load_module() + else: + mod = importlib.import_module(name) return getattr(mod, cls_name) def plugin_loader(exp, plugin_dict, check=False): logging.debug("Running plugin loader") try: - plugin = get_plugin( - plugin_dict['id'], plugin_dict['data'], exp, check=check) + plugin = get_plugin(plugin_dict['id'], + plugin_dict['data'], + exp, + check=check) except Exception as e: logging.error("failed to load the plugin") logging.error(e) @@ -135,30 +136,28 @@ def get_plugins_paths(examples=True): This gets the plugin paths, but also adds any that are not on the pythonpath to it. """ - plugins_paths = [] - # get user and environment plugin paths - user_path = [os.path.join(os.path.expanduser("~"), 'savu_plugins')] - env_paths = list(itertools.ifilter(None, ( - os.getenv("SAVU_PLUGINS_PATH") or "").replace(" ","").split(":"))) + plugins_paths = OrderedDict() - # If examples have been requested then add them to the path - # add all sub folders - eg_base_path = os.path.join(savu.__path__[0], - "../plugin_examples/plugin_templates") - eg_path = [x[0] for x in os.walk(eg_base_path)] if examples else [] - # check all paths exist and add the the plugin paths - for ppath in user_path + env_paths + eg_path: - if os.path.exists(ppath): - plugins_paths.append(ppath) + # Add the savu plugins paths first so it is overridden by user folders + savu_plugins_path = os.path.join(savu.__path__[0], 'plugins') + savu_plugins_subpaths = [d for d in next(os.walk(savu_plugins_path))[1] \ + if d != "__pycache__"] + for path in savu_plugins_subpaths: + plugins_paths[os.path.join(savu_plugins_path, path)] = \ + ''.join(['savu.plugins.', path, '.']) + + # get user, environment and example plugin paths + user_path = [os.path.join(os.path.expanduser("~"), 'savu_plugins')] + env_paths = os.getenv("SAVU_PLUGINS_PATH", "").replace(" ", "").split(":") + templates = "../plugin_examples/plugin_templates" + eg_path = [os.path.join(savu.__path__[0], templates)] if examples else [] - # before we add the savu plugins to the list, add all items in the list - # so far to the pythonpath - for ppath in plugins_paths: - if ppath not in sys.path: - sys.path.append(ppath) + for ppath in env_paths + user_path + eg_path: + if os.path.exists(ppath): + plugins_paths[ppath] = os.path.basename(ppath) + '.' + if ppath not in sys.path: + sys.path.append(os.path.dirname(ppath)) - # now add the savu plugin path, which is now the whole path. - plugins_paths.append(os.path.join(savu.__path__[0]) + '/../') return plugins_paths @@ -175,10 +174,10 @@ def is_template_param(param): start = 6 first, last = param[start], param[-1] if first == '<' and last == '>': - param = param[start+1:-1] + param = param[start + 1:-1] param = None if not param else param try: - exec("param = " + param) + param = eval(param) except: pass return [ptype, param] @@ -198,11 +197,11 @@ def enablePrint(): def parse_config_string(string): - regex = "[\[\]\, ]+" - split_vals = filter(None, re.split(regex, string)) + regex = r"[\[\]\, ]+" + split_vals = [_f for _f in re.split(regex, string) if _f] delimitors = re.findall(regex, string) split_vals = [repr(a.strip()) for a in split_vals] - zipped = itertools.izip_longest(delimitors, split_vals) + zipped = itertools.zip_longest(delimitors, split_vals) string = ''.join([i for l in zipped for i in l if i is not None]) try: return ast.literal_eval(string) @@ -211,10 +210,10 @@ def parse_config_string(string): def parse_array_index_as_string(string): - p = re.compile("'\['") + p = re.compile(r"'\['") for m in p.finditer(string): offset = m.start() - count + 3 end = string[offset:].index("']") + offset - string = string[:end] + "]'" + string[end+2:] + string = string[:end] + "]'" + string[end + 2:] string = string.replace("'['", '[') return string diff --git a/savu/plugins/visualisation/ortho_slice.py b/savu/plugins/visualisation/ortho_slice.py index 28dce9b57..1ddf19a82 100644 --- a/savu/plugins/visualisation/ortho_slice.py +++ b/savu/plugins/visualisation/ortho_slice.py @@ -100,8 +100,8 @@ def process_frames(self, data): slice_to_take[self.axis_loc[pattern]] = slice(slice_value, slice_value+1, 1) - print("Final slice is : %s of %s" % (str(slice_to_take), - str(fullData.data.shape))) + print(("Final slice is : %s of %s" % (str(slice_to_take), + str(fullData.data.shape)))) self.exp.log("Final slice is : %s of %s" % (str(slice_to_take), str(fullData.data.shape))) diff --git a/savu/test/base_checkpoint_test.py b/savu/test/base_checkpoint_test.py index 06a1ab6bc..5c6bed73e 100644 --- a/savu/test/base_checkpoint_test.py +++ b/savu/test/base_checkpoint_test.py @@ -31,6 +31,7 @@ from savu.core.plugin_runner import PluginRunner from savu.core.checkpointing import Checkpointing +from savu.core.utils import ensure_string from savu.data.experiment_collection import Experiment @@ -86,7 +87,7 @@ def get_options(self, cfile=True): options = self.set_data_options() options['out_path'] = self.tmpdir options['nxs_filename'] = self.cfile if cfile else None - options['processes'] = range(1) + options['processes'] = list(range(1)) options['process'] = 0 options['mpi'] = False options['inter_path'] = self.tmpdir @@ -157,8 +158,7 @@ def test_plugin_level_4a(self): def test_plugin_level_4b(self): # 4: Killed during processing - # b) after a plugin that doesn't populate nxs file - # - (works with full-field processing list) + # b) after a plugin that doesn't populate nxs file - (works with full-field processing list) vals = (5, 3, 3, 'plugin') self._set_checkpoint_parameters(*vals) # rerun from checkpoint @@ -172,7 +172,7 @@ def test_plugin_level_4b(self): def test_plugin_level_4c(self): # 4: Killed during processing - # c) re-loading of a different data type, e.g., ImageKey + # c) re-loading of a different data type, e.g., ImageKey vals = (1, 3, 3, 'plugin') self._set_checkpoint_parameters(*vals) # rerun from checkpoint @@ -226,15 +226,14 @@ def _amend_checkpoint_file(self, p_no, tidx, pidx): self._create_dataset(f, 'completed_plugins', p_no) def _create_dataset(self, f, name, data): - if name in f.keys(): + if name in list(f.keys()): f.__delitem__(name) if data is not None: - f.create_dataset(name, data=np.zeros(1, dtype=np.int8)) - f[name][:] = data + f.create_dataset(name, data=data, dtype=np.int16) def _read_nexus_file(self, nxsfile, datasets): # find NXdata - for key, value in nxsfile.items(): + for key, value in list(nxsfile.items()): if self._is_nxdata(value): datasets.append(value) elif isinstance(value, h5py.Group) and key != 'input_data': @@ -242,8 +241,7 @@ def _read_nexus_file(self, nxsfile, datasets): return datasets def _is_nxdata(self, value): - check = 'NX_class' in value.attrs.keys() and\ - value.attrs['NX_class'] == 'NXdata' + check = 'NX_class' in list(value.attrs.keys()) and ensure_string(value.attrs['NX_class']) == 'NXdata' return check def _assert_checkpoint_params_equal(self, p_no, tidx, pidx, level, exp): diff --git a/savu/test/jenkins/plugin_tests/__init__.py b/savu/test/jenkins/plugin_tests/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/filter_tests/__init__.py b/savu/test/jenkins/plugin_tests/filter_tests/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/filter_tests/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/reconstruction_tests/ccpi_cgls_recon_test.py b/savu/test/jenkins/plugin_tests/filter_tests/dezinger_gpu_test.py similarity index 81% rename from savu/test/jenkins/plugin_tests/reconstruction_tests/ccpi_cgls_recon_test.py rename to savu/test/jenkins/plugin_tests/filter_tests/dezinger_gpu_test.py index 6e25101b1..e8fb060f1 100644 --- a/savu/test/jenkins/plugin_tests/reconstruction_tests/ccpi_cgls_recon_test.py +++ b/savu/test/jenkins/plugin_tests/filter_tests/dezinger_gpu_test.py @@ -22,23 +22,26 @@ .. moduleauthor:: Mark Basham """ - import unittest import savu.test.test_utils as tu from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner + run_protected_plugin_runner +import savu.test.base_checkpoint_test +import tempfile +import os -class CcpiCglsReconTest(unittest.TestCase): +class DezingerGpuTest(unittest.TestCase): global data_file, experiment data_file = '24737.nxs' - experiment = None + experiment = 'tomo' - def test_cgls_recon(self): - process_list = 'reconstruction/ccpi_cgls_recon_test.nxs' + def test_dezinger_gpu(self): + process_list = 'filters/dezinger/dezinger_gpu_test.nxs' options = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options) tu.cleanup(options) + if __name__ == "__main__": unittest.main() diff --git a/savu/test/travis/plugin_tests/loader_tests/i18_stxm_loader_test.py b/savu/test/jenkins/plugin_tests/filter_tests/median_filter_gpu_test.py similarity index 65% rename from savu/test/travis/plugin_tests/loader_tests/i18_stxm_loader_test.py rename to savu/test/jenkins/plugin_tests/filter_tests/median_filter_gpu_test.py index e97f3998d..df5383123 100644 --- a/savu/test/travis/plugin_tests/loader_tests/i18_stxm_loader_test.py +++ b/savu/test/jenkins/plugin_tests/filter_tests/median_filter_gpu_test.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,28 +13,32 @@ # See the License for the specific language governing permissions and # limitations under the License. + """ -.. module:: nx_xrd_loader_test +.. module:: plugins_test :platform: Unix - :synopsis: testing the nx_xrd loader + :synopsis: unittest test classes for plugins -.. moduleauthor:: Aaron Parsons +.. moduleauthor:: Mark Basham """ import unittest -from savu.test import test_utils as tu + +import savu.test.test_utils as tu from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner + run_protected_plugin_runner +import savu.test.base_checkpoint_test +import tempfile +import os -class I18StxmLoaderTest(unittest.TestCase): +class MedianFilterGpuTest(unittest.TestCase): global data_file, experiment - data_file = 'i18_test_data.nxs' - experiment = None + data_file = '24737.nxs' + experiment = 'tomo' -# @unittest.skip("the test data isn't ready yet. Adp") - def test_i18_stxm(self): - process_list = 'loaders/basic_stxm_process_i18.nxs' + def test_median_gpu_filter(self): + process_list = 'filters/denoise/median_filter_gpu_test.nxs' options = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options) tu.cleanup(options) diff --git a/savu/test/jenkins/plugin_tests/filter_tests/under_revision/__init__.py b/savu/test/jenkins/plugin_tests/filter_tests/under_revision/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/filter_tests/under_revision/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/loader_tests/__init__.py b/savu/test/jenkins/plugin_tests/loader_tests/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/loader_tests/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/loader_tests/under_revision/__init__.py b/savu/test/jenkins/plugin_tests/loader_tests/under_revision/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/loader_tests/under_revision/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/reconstruction_tests/__init__.py b/savu/test/jenkins/plugin_tests/reconstruction_tests/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/reconstruction_tests/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/__init__.py b/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/tomobar_gpu_test.py b/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/tomobar_gpu_test.py index ff75546d9..65f8bd0f1 100644 --- a/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/tomobar_gpu_test.py +++ b/savu/test/jenkins/plugin_tests/reconstruction_tests/tomobar/tomobar_gpu_test.py @@ -42,28 +42,29 @@ def test_tomobar_2drecon(self): run_protected_plugin_runner(options) tu.cleanup(options) + def test_tomobar_swls_2drecon(self): + process_list = 'reconstruction/tomobar/tomobar2d_SWLS_gpu_recon.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + """ + def test_tomobar3d_full(self): + process_list = 'reconstruction/tomobar/tomobar_fully3d_gpu_recon.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + """ def test_tomobar3d_fast(self): process_list = 'reconstruction/tomobar/tomobar3d_gpu_recon.nxs' options1 = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options1) #read the output file using SavuNexusLoader - path_to_rec = options1['out_path'] + 'test_processed.nxs' - self.test_folder2 = tempfile.mkdtemp(suffix='my_test2/') - options2 = tu.set_experiment('tomo') - options2['data_file'] = path_to_rec - options2['out_path'] = os.path.join(self.test_folder2) - options2['process_file'] = tu.get_test_process_path('loaders/savu_nexus_loader_test3.nxs') + data_file2 = options1['out_path'] + 'test_processed.nxs' + options2 = tu.initialise_options(data_file2, 'load_data', 'loaders/savu_nexus_loader_test4.nxs') run_protected_plugin_runner(options2) - tu.cleanup(options1) tu.cleanup(options2) - def test_tomobar3d_full(self): - process_list = 'reconstruction/tomobar/tomobar_fully3d_gpu_recon.nxs' - options = tu.initialise_options(data_file, experiment, process_list) - run_protected_plugin_runner(options) - tu.cleanup(options) - if __name__ == "__main__": unittest.main() diff --git a/savu/test/jenkins/process_list_tests/__init__.py b/savu/test/jenkins/process_list_tests/__init__.py deleted file mode 100644 index 01fc09d62..000000000 --- a/savu/test/jenkins/process_list_tests/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Test suites for Savu are here - - -.. moduleauthor:: Mark Basham - -""" diff --git a/savu/test/jenkins/process_list_tests/full_recon_test.py b/savu/test/jenkins/process_list_tests/full_recon_test.py index 678989270..135d07ce3 100644 --- a/savu/test/jenkins/process_list_tests/full_recon_test.py +++ b/savu/test/jenkins/process_list_tests/full_recon_test.py @@ -27,7 +27,6 @@ class PluginRunnerFullReconTest(unittest.TestCase): - def test_fbp(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('miro_test.nxs') diff --git a/savu/test/jenkins/process_list_tests/i18_full_pipeline_test.py b/savu/test/jenkins/process_list_tests/i18_full_pipeline_test.py deleted file mode 100644 index 2d294febf..000000000 --- a/savu/test/jenkins/process_list_tests/i18_full_pipeline_test.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: tomo_recon - :platform: Unix - :synopsis: runner for tests using the MPI framework - -.. moduleauthor:: Mark Basham - -""" - -import unittest -from savu.test import test_utils as tu -from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner - - -class I18FullPipelineTest(unittest.TestCase): - def test_process(self): - data_file = tu.get_test_data_path('i18_test_data.nxs') - process_file = tu.get_process_list_path('multimodal_tomo_i18.nxs') - run_protected_plugin_runner(tu.set_options(data_file, - process_file=process_file)) -if __name__ == "__main__": - unittest.main() diff --git a/savu/test/jenkins/process_list_tests/simple_fit_recon_single_sino_test.py b/savu/test/jenkins/process_list_tests/simple_fit_recon_single_sino_test.py deleted file mode 100644 index 20ceee8f4..000000000 --- a/savu/test/jenkins/process_list_tests/simple_fit_recon_single_sino_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: tomo_recon - :platform: Unix - :synopsis: runner for tests using the MPI framework - -.. moduleauthor:: Mark Basham - -""" - -import unittest -from savu.test import test_utils as tu -from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner - - -class SimpleFitReconSingleSinoTest(unittest.TestCase): - - def test_process(self): - data_file = tu.get_test_data_path('fluo_single_sino.nxs') - process_file = tu.get_test_process_path('simple_fit_test_XRF_tomo.nxs') - run_protected_plugin_runner(tu.set_options(data_file, - process_file=process_file)) - -if __name__ == "__main__": - unittest.main() diff --git a/savu/test/jenkins/process_list_tests/simple_fit_recon_test.py b/savu/test/jenkins/process_list_tests/simple_fit_recon_test.py deleted file mode 100644 index 98e59dc84..000000000 --- a/savu/test/jenkins/process_list_tests/simple_fit_recon_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: tomo_recon - :platform: Unix - :synopsis: runner for tests using the MPI framework - -.. moduleauthor:: Mark Basham - -""" - -import unittest -from savu.test import test_utils as tu -from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner - - -class SimpleFitReconTest(unittest.TestCase): - - def test_process(self): - data_file = tu.get_test_data_path('mm.nxs') - process_file = tu.get_test_process_path('simple_fit_test_XRF_tomo.nxs') - run_protected_plugin_runner(tu.set_options(data_file, - process_file=process_file)) - -if __name__ == "__main__": - unittest.main() diff --git a/savu/test/jenkins/process_list_tests/simple_stxm_tomo_single_sino_test.py b/savu/test/jenkins/process_list_tests/simple_stxm_tomo_single_sino_test.py deleted file mode 100644 index c2861bc6f..000000000 --- a/savu/test/jenkins/process_list_tests/simple_stxm_tomo_single_sino_test.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2014 Diamond Light Source Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -.. module:: stxm_tomo_recon - :platform: Unix - :synopsis: runner for tests using the MPI framework - -.. moduleauthor:: Mark Basham - -""" - -import unittest -from savu.test import test_utils as tu -from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner - - -class SimpleStxmTomoSingleSinoTest(unittest.TestCase): - - def test_process(self): - data_file = tu.get_test_data_path('stxm_single_sino.nxs') - process_file = tu.get_test_process_path( - 'simple_stxm_tomo_test_astra_single_sino.nxs') - run_protected_plugin_runner(tu.set_options(data_file, - process_file=process_file)) - - -if __name__ == "__main__": - unittest.main() diff --git a/savu/test/test_process_list_utils.py b/savu/test/test_process_list_utils.py index 3fc5924da..980430bef 100644 --- a/savu/test/test_process_list_utils.py +++ b/savu/test/test_process_list_utils.py @@ -42,28 +42,27 @@ def get_process_list_in_file(root, files): processes = [] for fname in files: fname = root + '/' + fname - in_file = open(fname, 'r') - for line in in_file: - if '.nxs' in line: - processes.append(get_nxs_file_name(line)) + with open(fname, 'r') as in_file: + for line in in_file: + if '.nxs' in line: + processes.append(get_nxs_file_name(line)) return processes - def get_no_process_list_tests(root, files): processes = [] for fname in files: fname = root + '/' + fname - in_file = open(fname, 'r') - func = 'run_protected_plugin_runner_no_process_list' - exclude = ['def', 'search_str'] - pos = 1 - param = get_param_name(func, pos, in_file, exclude=exclude) - if param: - in_file.seek(0) - plugin_id_list = get_param_value_from_file(param, in_file) - for pid in plugin_id_list: - plugin_name = pid.split('.')[-1].split("'")[0] - processes.append(plugin_name + '.py') + with open(fname, 'r') as in_file: + func = 'run_protected_plugin_runner_no_process_list' + exclude = ['def', 'search_str'] + pos = 1 + param = get_param_name(func, pos, in_file, exclude=exclude) + if param: + in_file.seek(0) + plugin_id_list = get_param_value_from_file(param, in_file) + for pid in plugin_id_list: + plugin_name = pid.split('.')[-1].split("'")[0] + processes.append(plugin_name + '.py') return processes diff --git a/savu/test/test_utils.py b/savu/test/test_utils.py index 6a3fb1eb4..b5e22c55e 100644 --- a/savu/test/test_utils.py +++ b/savu/test/test_utils.py @@ -177,6 +177,7 @@ def set_options(path, **kwargs): options['template'] = None options['checkpoint'] = None options['system_params'] = None + options['nPlugin'] = 0 return options @@ -209,7 +210,7 @@ def load_test_data(exp_type): def get_data_object(exp): - data = exp.index['in_data'][exp.index['in_data'].keys()[0]] + data = exp.index['in_data'][list(exp.index['in_data'].keys())[0]] data._set_plugin_data(PluginData(data)) pData = data._get_plugin_data() return data, pData @@ -259,7 +260,7 @@ def plugin_runner_real_plugin_run(options): pu.plugin_loader(exp, plugin_list[0]) start_in_data = copy.deepcopy(exp.index['in_data']) - in_data = exp.index["in_data"][exp.index["in_data"].keys()[0]] + in_data = exp.index["in_data"][list(exp.index["in_data"].keys())[0]] out_data_objs, stop = in_data._load_data(1) exp._clear_data_objects() exp.index['in_data'] = copy.deepcopy(start_in_data) @@ -287,8 +288,12 @@ def initialise_options(data, experiment, process_path): if (experiment is not None) & (data is None): options = set_experiment(experiment) elif (experiment is not None) & (data is not None): - options = set_experiment(experiment) - options['data_file'] = data_file + if experiment == 'load_data': + options = set_experiment('tomo') + options['data_file'] = data + else: + options = set_experiment(experiment) + options['data_file'] = data_file options['process_file'] = process_file else: options = set_options(data_file, process_file=process_file) diff --git a/savu/test/travis/framework_tests/astra_multiple_parameter_test.py b/savu/test/travis/framework_tests/astra_multiple_parameter_test.py index 86eb1d9f0..0314562fe 100644 --- a/savu/test/travis/framework_tests/astra_multiple_parameter_test.py +++ b/savu/test/travis/framework_tests/astra_multiple_parameter_test.py @@ -28,21 +28,22 @@ import savu.plugins.utils as pu import savu.test.test_utils as tu +from collections import OrderedDict + class AstraMultipleParameterTest(unittest.TestCase): def plugin_setup(self): ppath = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu' plugin = pu.load_class(ppath)() - #plugin = pu.get_plugin(ppath) return plugin def framework_options_setup(self): - key1 = 'algorithm' - key2 = 'n_iterations' + key1 = 'n_iterations' + key2 = 'algorithm' key3 = 'in_datasets' key4 = 'out_datasets' - params = {key1: 'FBP;CGLS', key2: '1;2;3', key3: 'tomo', key4: 'tomo'} + params = OrderedDict({key1: '1;2;3', key2: 'FBP;CGLS', key3: 'tomo', key4: 'tomo'}) options = tu.set_experiment('tomo') plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu' @@ -80,7 +81,6 @@ def test_parameter_space_extra_dims(self): def test_parameter_space_data_shape(self): options = self.framework_options_setup() plugin = tu.plugin_runner_load_plugin(options) - #tu.plugin_setup(plugin) out_dataset = plugin.get_out_datasets()[0] self.assertEqual((160, 135, 160, 3, 2), out_dataset.get_shape()) diff --git a/savu/test/travis/framework_tests/chunking_test.py b/savu/test/travis/framework_tests/chunking_test.py index f7b30215f..e0be06aba 100644 --- a/savu/test/travis/framework_tests/chunking_test.py +++ b/savu/test/travis/framework_tests/chunking_test.py @@ -30,22 +30,11 @@ class ChunkingTests(unittest.TestCase): - -# def test_spectra_to_tomo(self): -# options = { -# "transport": "hdf5", -# "process_names": "CPU0", -# "data_file": tu.get_test_data_path('mm.nxs'), -# "process_file": tu.get_test_process_path('pyfai_tomo_chunking_test.nxs'), -# "out_path": tempfile.mkdtemp() -# } -# run_protected_plugin_runner(options) - def create_chunking_instance(self, current_list, nnext_list, nProcs): current = self.create_pattern('a', current_list) nnext = self.create_pattern('b', nnext_list) options = tu.set_experiment('tomoRaw') - options['processes'] = range(nProcs) + options['processes'] = list(range(nProcs)) # set a dummy process list options['process_file'] = \ tu.get_test_process_path('loaders/basic_tomo_process.nxs') @@ -70,20 +59,6 @@ def amend_chunks(self, chunks): """ If any temporary amendments are applied to the final chunking values in the framework, then remove these here. """ return chunks -# new_chunks = list(chunks) -# for i in range(len(new_chunks)): -# if chunks[i]-1 > 0: -# new_chunks[i] = chunks[i] + 1 -# return tuple(new_chunks) - -# def test_chunks_2D(self): -# current = [1, (0,), (1,)] -# nnext = [1, (0,), (1,)] -# shape = (100, 20) -# nProcs = 1 -# chunking = self.create_chunking_instance(current, nnext, nProcs) -# chunks = chunking._calculate_chunking(shape, np.float32) -# self.assertEqual(chunks, True) def test_chunks_3D_1(self): current = [1, (0,), (1, 2)] @@ -168,5 +143,6 @@ def test_chunks_4D_1(self): chunks = chunking._calculate_chunking(shape, np.float32) self.assertEqual(self.amend_chunks(chunks), (4, 8, 8, 500)) + if __name__ == "__main__": unittest.main() diff --git a/savu/test/travis/framework_tests/max_frames_test.py b/savu/test/travis/framework_tests/max_frames_test.py index e1efd0608..efb595136 100644 --- a/savu/test/travis/framework_tests/max_frames_test.py +++ b/savu/test/travis/framework_tests/max_frames_test.py @@ -56,13 +56,12 @@ def __get_system_parameters_file(self): path = os.path.join(os.path.dirname(__file__), "system_parameters.yml") return path - def test1_single_threaded(self): loader = "full_field_loaders.random_3d_tomo_loader" params = {'size': (140, 1, 1)} # data size is (136, 1, 1) sys_file = self.__get_system_parameters_file() # create a process list? - + data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) @@ -123,7 +122,7 @@ def test3_single_threaded(self): def test4_single_threaded(self): loader = "full_field_loaders.random_3d_tomo_loader" params = {'size': (4500, 1, 1)} # data size is (4496, 1, 1) - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) @@ -149,7 +148,7 @@ def test1_parallel(self): sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) - data.dtype = np.dtype(np.float32) + data.dtype = np.dtype(np.float32) sl_dict = self.__get_slice_list_dict( data, pData, 'PROJECTION', 'single', 'in', processes) @@ -166,10 +165,10 @@ def test2_parallel(self): params['patterns'] = ['PROJECTION.0s.1s.2c.3c.4s'] params['axis_labels'] = ['val%d.unit' % i for i in range(5)] params['size'] = (1, 1, 1, 1, 1) - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) - data.dtype = np.dtype(np.float32) + data.dtype = np.dtype(np.float32) sl_dict = self.__get_slice_list_dict( data, pData, 'PROJECTION', 'single', 'in', processes) @@ -186,10 +185,10 @@ def test3_parallel(self): params['patterns'] = ['PROJECTION.0s.1s.2c.3c.4s'] params['axis_labels'] = ['val%d.unit' % i for i in range(5)] params['size'] = (15, 13, 1, 1, 4) - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) - data.dtype = np.dtype(np.float32) + data.dtype = np.dtype(np.float32) sl_dict = self.__get_slice_list_dict( data, pData, 'PROJECTION', 'single', 'in', processes) @@ -203,7 +202,7 @@ def test4_parallel(self): loader = "full_field_loaders.random_3d_tomo_loader" processes = ['p']*20 params = {'size': (24, 1, 1)} # data size is (20, 1, 1) - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) @@ -219,7 +218,7 @@ def test5_parallel(self): loader = "full_field_loaders.random_3d_tomo_loader" processes = ['p']*15 params = {'size': (24, 1, 1)} # data size is (20, 1, 1) - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) @@ -235,7 +234,7 @@ def test6_parallel(self): loader = "full_field_loaders.random_3d_tomo_loader" processes = ['p']*15 params = {'size': (4500, 1, 1)} # data size is (4496, 1, 1) - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) @@ -257,7 +256,7 @@ def test7_parallel(self): sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) - data.dtype = np.dtype(np.float32) + data.dtype = np.dtype(np.float32) sl_dict = self.__get_slice_list_dict( data, pData, 'PROJECTION', 'single', 'in', processes) @@ -274,10 +273,10 @@ def test8_parallel(self): params['axis_labels'] = ['val%d.unit' % i for i in range(5)] params['size'] = (450, 36, 1, 1, 14) processes = ['p']*36 - sys_file = self.__get_system_parameters_file() + sys_file = self.__get_system_parameters_file() data, pData = tu.get_data_object(tu.load_random_data( loader, params, system_params=sys_file, fake=True)) - data.dtype = np.dtype(np.float32) + data.dtype = np.dtype(np.float32) sl_dict = self.__get_slice_list_dict( data, pData, 'PROJECTION', 'single', 'in', processes) diff --git a/savu/test/travis/framework_tests/plugin_coverage_test.py b/savu/test/travis/framework_tests/plugin_coverage_test.py index 5953f3f26..29bfeb805 100644 --- a/savu/test/travis/framework_tests/plugin_coverage_test.py +++ b/savu/test/travis/framework_tests/plugin_coverage_test.py @@ -25,7 +25,6 @@ import os from savu.data.plugin_list import PluginList -import savu.test.test_utils as tu import savu.test.test_process_list_utils as tplu @@ -51,9 +50,8 @@ def test_coverage(self): try: filename_nxs = os.path.basename(nxs) nxs_in_tests_mod.append(filename_nxs) - except: + except Exception: print("The failed basename file:", nxs) - pass # list all test process lists available in test_process_lists folder test_process_path = savu_base_path + 'test_data/test_process_lists' @@ -86,14 +84,14 @@ def test_coverage(self): uncovered = list(set(plugin_list).difference(set(tested_plugin_list))) for plugin in uncovered: print (plugin) - print ("===============================================================") + print("===============================================================") - print ("===============================================================") - print ("\nThe following process lists are redundant:\n") + print("===============================================================") + print("\nThe following process lists are redundant:\n") redundant = list(set(self.nxs_avail).difference(set(self.nxs_used))) for plugin in redundant: print (plugin) - print ("===============================================================") + print("===============================================================") def test_process_lists(self): # check for unused process lists @@ -125,7 +123,7 @@ def get_test_plugin_list(self, process_files, path): plugin_names.append(p + '.py') except ImportError as e: print("Failed to run test as libraries not available (%s)," - % (e) + " passing test") + % (e) + " passing test") return list(set(plugin_names)) def add_plugin(self, plugin_id): diff --git a/savu/test/travis/framework_tests/plugin_runner_test.py b/savu/test/travis/framework_tests/plugin_runner_test.py index 2c56ab351..31d0a1df1 100644 --- a/savu/test/travis/framework_tests/plugin_runner_test.py +++ b/savu/test/travis/framework_tests/plugin_runner_test.py @@ -26,7 +26,7 @@ def run_protected_plugin_runner_no_process_list(options, plugin, **kwargs): - if 'data' in kwargs.keys(): + if 'data' in list(kwargs.keys()): tu.set_plugin_list(options, plugin, kwargs['data']) else: tu.set_plugin_list(options, plugin) diff --git a/savu/test/travis/plugin_tests/filter_tests/dezinger/dezinger_test.py b/savu/test/travis/plugin_tests/filter_tests/dezinger/dezinger_test.py index b5d44348a..02ca83efd 100644 --- a/savu/test/travis/plugin_tests/filter_tests/dezinger/dezinger_test.py +++ b/savu/test/travis/plugin_tests/filter_tests/dezinger/dezinger_test.py @@ -32,23 +32,24 @@ class DezingerTest(unittest.TestCase): data_file = '24737.nxs' experiment = 'tomo' - def test_dezing_filter(self): - options = tu.initialise_options(None, 'tomoRaw', None) - plugin = 'savu.plugins.filters.dezinger_simple' - run_protected_plugin_runner_no_process_list(options, plugin) - tu.cleanup(options) - - def test_dezinger(self): - process_list = 'filters/dezinger/dezinger_test.nxs' - options = tu.initialise_options(data_file, experiment, process_list) - run_protected_plugin_runner(options) - tu.cleanup(options) + #def test_dezing_filter(self): + # options = tu.initialise_options(None, 'tomoRaw', None) + # plugin = 'savu.plugins.filters.dezinger_simple' + # run_protected_plugin_runner_no_process_list(options, plugin) + # tu.cleanup(options) def test_dezinger_sinogram(self): process_list = 'filters/dezinger/dezinger_sinogram_test.nxs' options = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options) tu.cleanup(options) + + def test_dezinger(self): + process_list = 'filters/dezinger/dezinger_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + if __name__ == "__main__": unittest.main() diff --git a/savu/test/travis/plugin_tests/loader_tests/i18_mm_loader_test.py b/savu/test/travis/plugin_tests/filter_tests/fresnel_filter_test.py old mode 100644 new mode 100755 similarity index 77% rename from savu/test/travis/plugin_tests/loader_tests/i18_mm_loader_test.py rename to savu/test/travis/plugin_tests/filter_tests/fresnel_filter_test.py index ac47b10a5..58b09e800 --- a/savu/test/travis/plugin_tests/loader_tests/i18_mm_loader_test.py +++ b/savu/test/travis/plugin_tests/filter_tests/fresnel_filter_test.py @@ -13,11 +13,11 @@ # limitations under the License. """ -.. module:: nx_xrd_loader_test +.. module:: fresnel_filter_Test :platform: Unix - :synopsis: testing the nx_xrd loader + :synopsis: Test for the Fresnel filter plugin -.. moduleauthor:: Aaron Parsons +.. moduleauthor:: Nicola Wadeson """ import unittest @@ -26,13 +26,13 @@ run_protected_plugin_runner -class I18MmLoaderTest(unittest.TestCase): +class FresnelFilterTest(unittest.TestCase): global data_file, experiment - data_file = 'i18_test_data.nxs' + data_file = '24737.nxs' experiment = None - def test_i18_mm(self): - process_list = 'loaders/MM_i18_test.nxs' + def test_fresnel_fbp(self): + process_list = 'fresnel_filter_test.nxs' options = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options) tu.cleanup(options) diff --git a/savu/test/travis/plugin_tests/loader_tests/savu_nexus_loader_test.py b/savu/test/travis/plugin_tests/loader_tests/savu_nexus_loader_test.py index 67ef8ce4d..5762cc8f4 100644 --- a/savu/test/travis/plugin_tests/loader_tests/savu_nexus_loader_test.py +++ b/savu/test/travis/plugin_tests/loader_tests/savu_nexus_loader_test.py @@ -37,14 +37,9 @@ def test_reload(self): run_protected_plugin_runner(options1) #read the output file using SavuNexusLoader - path_to_rec = options1['out_path'] + 'test_processed.nxs' - self.test_folder2 = tempfile.mkdtemp(suffix='my_test2/') - options2 = tu.set_experiment('tomo') - options2['data_file'] = path_to_rec - options2['out_path'] = os.path.join(self.test_folder2) - options2['process_file'] = tu.get_test_process_path('loaders/savu_nexus_loader_test2.nxs') + data_file2 = options1['out_path'] + 'test_processed.nxs' + options2 = tu.initialise_options(data_file2, 'load_data', 'loaders/savu_nexus_loader_test2.nxs') run_protected_plugin_runner(options2) - tu.cleanup(options1) tu.cleanup(options2) diff --git a/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py b/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py index 621235554..8c97fd848 100644 --- a/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py +++ b/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py @@ -57,7 +57,7 @@ def test_1D_data(self): self.yaml['xrd']['params'].update({'idx_A': 0, 'idx_detx': 1, 'idx_dety': 2, - 'A_vals': "$dfile['entry/A'].value", + 'A_vals': "$dfile['entry/A'][()]", 'dims': "$range(0, 3)"}) # add some axis labels @@ -66,7 +66,6 @@ def test_1D_data(self): 2: self.detY_axis_label} self.save_yaml_and_change_process_list() - run_protected_plugin_runner(tu.set_options(self.data_file_path, process_file=self.process_list_path, out_path=self.test_folder)) @@ -82,6 +81,48 @@ def test_1D_data(self): np.testing.assert_array_equal(result_corners, expected_top_corners, err_msg="The output values are not as expected") + def test_again(self): + A = 11 + + X = 10 + Y = 13 + + expected_output_shape = (A, X, Y) + expected_top_corners = np.arange(A, dtype=np.float32) + + self.create_N_tiffs(A, frame_size=(X, Y)) + # create a data file with the axis information + self.data_file['entry/A'] = np.arange(A) + self.data_file.close() + + # edit and save the yaml + self.yaml['xrd']['data']['shape'] = '$(len(A_vals),)' + self.yaml['xrd']['params'].update({'idx_A': 0, + 'idx_detx': 1, + 'idx_dety': 2, + 'A_vals': "$dfile['entry/A'][()]", + 'dims': "$range(0, 3)"}) + + # add some axis labels + self.yaml['xrd']['axis_labels'] = {0: {'dim': '$idx_A', 'name': 'A', 'value': '$A_vals', 'units': 'pixels'}, + 1: self.detX_axis_label, + 2: self.detY_axis_label} + + self.save_yaml_and_change_process_list() + run_protected_plugin_runner(tu.set_options(self.data_file_path, + process_file=self.process_list_path, + out_path=self.test_folder)) + + # now check the result + + result = h5.File(os.path.join(self.test_folder, 'test_processed.nxs'), 'r')['entry/final_result_xrd/data'] + np.testing.assert_array_equal(result.shape, expected_output_shape, + err_msg='The output shape is not as expected.') + result_corners = result[..., -1, -1] + np.testing.assert_equal(result_corners.dtype, expected_top_corners.dtype, + err_msg='The array does not output the correct type.') + np.testing.assert_array_equal(result_corners, expected_top_corners, + err_msg="The output values are not as expected") def test_2D_data(self): A = 3 @@ -105,8 +146,8 @@ def test_2D_data(self): 'idx_B': 1, 'idx_detx': 2, 'idx_dety': 3, - 'A_vals': "$dfile['entry/A'].value", - 'B_vals': "$dfile['entry/B'].value", + 'A_vals': "$dfile['entry/A'][()]", + 'B_vals': "$dfile['entry/B'][()]", 'dims': "$range(0, 4)"}) self.yaml['xrd']['axis_labels'] = {0: {'dim': '$idx_A', 'name': 'A', 'value': '$A_vals', 'units': 'pixels'}, @@ -153,9 +194,9 @@ def test_3D_data(self): 'idx_C': 2, 'idx_detx': 3, 'idx_dety': 4, - 'A_vals': "$dfile['entry/A'].value", - 'B_vals': "$dfile['entry/B'].value", - 'C_vals': "$dfile['entry/C'].value", + 'A_vals': "$dfile['entry/A'][()]", + 'B_vals': "$dfile['entry/B'][()]", + 'C_vals': "$dfile['entry/C'][()]", 'dims': "$range(0, 4)"}) self.yaml['xrd']['axis_labels'] = {0: {'dim': '$idx_A', 'name': 'A', 'value': '$A_vals', 'units': 'pixels'}, @@ -165,7 +206,6 @@ def test_3D_data(self): 4: self.detY_axis_label} self.save_yaml_and_change_process_list() - run_protected_plugin_runner(tu.set_options(self.data_file_path, process_file=self.process_list_path, out_path=self.test_folder)) @@ -189,11 +229,6 @@ def setUp(self): shutil.copyfile(tu.get_test_process_path('xrd_template_test.nxs'), self.process_list_path) - utils.populate_plugins() - self.process_list = Content() - self.process_list.fopen(self.process_list_path, update=False) - for idx in self.process_list.get_positions(): - self.process_list.refresh(idx) self.detX_axis_label = {'dim': '$idx_detx', 'name': 'detector_x', 'value': None, 'units': 'pixels'} self.detY_axis_label = {'dim': '$idx_dety', 'name': 'detector_y', 'value': None, 'units': 'pixels'} @@ -212,10 +247,9 @@ def setUp(self): 'slice_dims': '$tuple([d for d in dims if d not in [idx_detx, idx_dety]])'} self.yaml['xrd']['axis_labels'] = {} self.yaml['xrd']['metadata'] = {} - self.data_file_path = 'test_data.nxs' + self.data_file_path = os.path.join(self.test_folder, 'test_data.nxs') self.data_file = h5.File(self.data_file_path, 'w') # this will have the axes in. - def tearDown(self): shutil.rmtree(self.test_folder, ignore_errors=True) @@ -233,12 +267,17 @@ def create_N_tiffs(self, N, file_pattern='%04d.tif', frame_size=(10, 13)): tifffile.imsave(file_path, data*idx) def save_yaml_and_change_process_list(self): - yml_path = os.path.join(self.test_folder, 'xrd_tiff.yml') - with open(yml_path, 'w') as f: + self.yml_path = os.path.join(self.test_folder, 'xrd_tiff.yml') + with open(self.yml_path, 'w') as f: yu.dump_yaml(self.yaml, f) # now set the template path in the process list - self.process_list.modify('1', '2', yml_path) + # uses the parameter name instead of number + # because the number can change between runs + self.process_list = Content() + self.process_list.fopen(self.process_list_path, update=False) + self.process_list.modify('1', 'yaml_file', self.yml_path) self.process_list.save(self.process_list_path) -if __name__=='__main__': + +if __name__ == '__main__': unittest.main() diff --git a/savu/test/travis/plugin_tests/reconstruction_tests/tomo_pipeline_preview_test.py b/savu/test/travis/plugin_tests/reconstruction_tests/tomo_pipeline_preview_test.py index 9740d16a4..a9caecd7d 100644 --- a/savu/test/travis/plugin_tests/reconstruction_tests/tomo_pipeline_preview_test.py +++ b/savu/test/travis/plugin_tests/reconstruction_tests/tomo_pipeline_preview_test.py @@ -28,7 +28,6 @@ from savu.test.travis.framework_tests.plugin_runner_test import \ run_protected_plugin_runner -#@unittest.skip('Runs as a standalone test but not in the suite. Error to be investigated') class TomoPipelinePreviewTest(unittest.TestCase): global data_file, experiment data_file = '24737.nxs' @@ -40,5 +39,6 @@ def test_process_preview(self): run_protected_plugin_runner(options) tu.cleanup(options) + if __name__ == "__main__": unittest.main() diff --git a/savu/test/jenkins/__init__.py b/savu/test/travis/plugin_tests/segmentation_tests/__init__.py similarity index 100% rename from savu/test/jenkins/__init__.py rename to savu/test/travis/plugin_tests/segmentation_tests/__init__.py diff --git a/savu/test/travis/plugin_tests/segmentation_tests/geo_dist_test.py b/savu/test/travis/plugin_tests/segmentation_tests/geo_dist_test.py new file mode 100644 index 000000000..3cd2676b2 --- /dev/null +++ b/savu/test/travis/plugin_tests/segmentation_tests/geo_dist_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +.. module:: plugins_test + :platform: Unix + :synopsis: unittest test classes for plugins + +.. moduleauthor:: Daniil Kazantsev + +""" + +import unittest +import savu.test.test_utils as tu +from savu.test.travis.framework_tests.plugin_runner_test import \ + run_protected_plugin_runner + +class GeoDistTest(unittest.TestCase): + global data_file, experiment + data_file = '24737.nxs' + experiment = 'tomo' + + def test_GeoDistance2d(self): + process_list = 'segmentation/geodistance/geodistance2d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + + def test_GeoDistance3d(self): + process_list = 'segmentation/geodistance/geodistance3d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + +if __name__ == "__main__": + unittest.main() diff --git a/savu/test/travis/plugin_tests/loader_tests/i18_fluo_loader_test.py b/savu/test/travis/plugin_tests/segmentation_tests/gmm_test.py similarity index 69% rename from savu/test/travis/plugin_tests/loader_tests/i18_fluo_loader_test.py rename to savu/test/travis/plugin_tests/segmentation_tests/gmm_test.py index e8d23eb45..071cd3cad 100644 --- a/savu/test/travis/plugin_tests/loader_tests/i18_fluo_loader_test.py +++ b/savu/test/travis/plugin_tests/segmentation_tests/gmm_test.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,27 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. + """ -.. module:: nx_xrd_loader_test +.. module:: plugins_test :platform: Unix - :synopsis: testing the nx_xrd loader + :synopsis: unittest test classes for plugins -.. moduleauthor:: Aaron Parsons +.. moduleauthor:: Daniil Kazantsev """ + import unittest -from savu.test import test_utils as tu +import savu.test.test_utils as tu from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner - + run_protected_plugin_runner -class I18FluoLoaderTest(unittest.TestCase): +class GmmTest(unittest.TestCase): global data_file, experiment - data_file = 'i18_test_data.nxs' - experiment = None + data_file = '24737.nxs' + experiment = 'tomo' - def test_i18_fluo(self): - process_list = 'loaders/basic_fluo_process_i18.nxs' + def test_gmm(self): + process_list = 'segmentation/gmm/gmm_test.nxs' options = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options) tu.cleanup(options) diff --git a/savu/test/travis/plugin_tests/loader_tests/i18_xrd_loader_test.py b/savu/test/travis/plugin_tests/segmentation_tests/mask_initialise_test.py similarity index 68% rename from savu/test/travis/plugin_tests/loader_tests/i18_xrd_loader_test.py rename to savu/test/travis/plugin_tests/segmentation_tests/mask_initialise_test.py index d872e1ad7..316299266 100644 --- a/savu/test/travis/plugin_tests/loader_tests/i18_xrd_loader_test.py +++ b/savu/test/travis/plugin_tests/segmentation_tests/mask_initialise_test.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,27 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. + """ -.. module:: nx_xrd_loader_test +.. module:: plugins_test :platform: Unix - :synopsis: testing the nx_xrd loader + :synopsis: unittest test classes for plugins -.. moduleauthor:: Aaron Parsons +.. moduleauthor:: Daniil Kazantsev """ + import unittest -from savu.test import test_utils as tu +import savu.test.test_utils as tu from savu.test.travis.framework_tests.plugin_runner_test import \ - run_protected_plugin_runner - + run_protected_plugin_runner -class I18XrdLoaderTest(unittest.TestCase): +class MaskInitialiseTest(unittest.TestCase): global data_file, experiment - data_file = 'i18_test_data.nxs' - experiment = None + data_file = '24737.nxs' + experiment = 'tomo' - def test_nx_xrd(self): - process_list = 'loaders/basic_xrd_process_i18.nxs' + def test_MaskInitialiser(self): + process_list = 'segmentation/morphsnakes/mask_init_test.nxs' options = tu.initialise_options(data_file, experiment, process_list) run_protected_plugin_runner(options) tu.cleanup(options) diff --git a/savu/test/travis/plugin_tests/segmentation_tests/morph_operations_test.py b/savu/test/travis/plugin_tests/segmentation_tests/morph_operations_test.py new file mode 100644 index 000000000..f3760d926 --- /dev/null +++ b/savu/test/travis/plugin_tests/segmentation_tests/morph_operations_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +.. module:: plugins_test + :platform: Unix + :synopsis: unittest test classes for plugins + +.. moduleauthor:: Daniil Kazantsev + +""" + +import unittest +import savu.test.test_utils as tu +from savu.test.travis.framework_tests.plugin_runner_test import \ + run_protected_plugin_runner + +class MorphOperationsTest(unittest.TestCase): + global data_file, experiment + data_file = '24737.nxs' + experiment = 'tomo' + + def test_morphproc(self): + process_list = 'segmentation/morphproc/morphproc_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + + def test_morphremoval(self): + process_list = 'segmentation/morphproc/morphremove_objects_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + +if __name__ == "__main__": + unittest.main() diff --git a/savu/test/travis/plugin_tests/segmentation_tests/morphproc_line_test.py b/savu/test/travis/plugin_tests/segmentation_tests/morphproc_line_test.py new file mode 100644 index 000000000..b3b588d42 --- /dev/null +++ b/savu/test/travis/plugin_tests/segmentation_tests/morphproc_line_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +.. module:: plugins_test + :platform: Unix + :synopsis: unittest test classes for plugins + +.. moduleauthor:: Daniil Kazantsev + +""" + +import unittest +import savu.test.test_utils as tu +from savu.test.travis.framework_tests.plugin_runner_test import \ + run_protected_plugin_runner + +class MorphprocLineTest(unittest.TestCase): + global data_file, experiment + data_file = '24737.nxs' + experiment = 'tomo' + + def test_morphproc_line2d(self): + process_list = 'segmentation/morphproc/morphproc_line_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + + def test_morphproc_line3d(self): + process_list = 'segmentation/morphproc/morphproc_line3d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + +if __name__ == "__main__": + unittest.main() diff --git a/savu/test/travis/plugin_tests/segmentation_tests/morphsnakes_test.py b/savu/test/travis/plugin_tests/segmentation_tests/morphsnakes_test.py new file mode 100644 index 000000000..a8114d90f --- /dev/null +++ b/savu/test/travis/plugin_tests/segmentation_tests/morphsnakes_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +.. module:: plugins_test + :platform: Unix + :synopsis: unittest test classes for plugins + +.. moduleauthor:: Daniil Kazantsev + +""" + +import unittest +import savu.test.test_utils as tu +from savu.test.travis.framework_tests.plugin_runner_test import \ + run_protected_plugin_runner + +class MorphsnakesTest(unittest.TestCase): + global data_file, experiment + data_file = '24737.nxs' + experiment = 'tomo' + + def test_Morphsnakes2d(self): + process_list = 'segmentation/morphsnakes/morphsnakes2d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + + def test_Morphsnakes3d(self): + process_list = 'segmentation/morphsnakes/morphsnakes3d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + +if __name__ == "__main__": + unittest.main() diff --git a/savu/test/travis/plugin_tests/segmentation_tests/regiongrow_test.py b/savu/test/travis/plugin_tests/segmentation_tests/regiongrow_test.py new file mode 100644 index 000000000..a90a38bef --- /dev/null +++ b/savu/test/travis/plugin_tests/segmentation_tests/regiongrow_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Diamond Light Source Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +.. module:: plugins_test + :platform: Unix + :synopsis: unittest test classes for plugins + +.. moduleauthor:: Daniil Kazantsev + +""" + +import unittest +import savu.test.test_utils as tu +from savu.test.travis.framework_tests.plugin_runner_test import \ + run_protected_plugin_runner + +class RegiongrowTest(unittest.TestCase): + global data_file, experiment + data_file = '24737.nxs' + experiment = 'tomo' + + def test_Regiongrow2d(self): + process_list = 'segmentation/regiongrow/regiongrow2d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + + def test_Regiongrow3d(self): + process_list = 'segmentation/regiongrow/regiongrow3d_test.nxs' + options = tu.initialise_options(data_file, experiment, process_list) + run_protected_plugin_runner(options) + tu.cleanup(options) + +if __name__ == "__main__": + unittest.main() diff --git a/savu/tomo_recon.py b/savu/tomo_recon.py index 44ab0d575..afa097a77 100644 --- a/savu/tomo_recon.py +++ b/savu/tomo_recon.py @@ -219,7 +219,7 @@ def main(input_args=None): plugin_runner = pRunner(options) plugin_runner._run_plugin_list() except Exception as error: - print error.message + print(error) traceback.print_exc(file=sys.stdout) MPI.COMM_WORLD.Abort(1) diff --git a/savu/version.py b/savu/version.py index fc57517b8..957e30be1 100644 --- a/savu/version.py +++ b/savu/version.py @@ -15,19 +15,14 @@ """ Get the Savu version """ - -# from pkg_resources import get_distribution -# -# __version__ = get_distribution('savu').version - import os +import pathlib -path = os.path.abspath(os.path.dirname(__file__)) -thepath = path + '/../install/' -thepath = thepath if os.path.exists(thepath) else path + '/install/' +# for the savu_installer +savu_path = pathlib.Path(__file__).parent.absolute() +__install__ = "install/savu_hpc/savu_installer" +with open(os.path.join( + os.path.join(savu_path, "..", __install__, "version.txt"))) as f: + __version__ = f.readline().strip() -with open(thepath + 'latest_version.txt', 'r') as f: - version_file = f.readline().strip() - __version__ = version_file.split('savu_v')[1].split('/')[0] -__install__ = 'install/' + version_file.split('/')[0] diff --git a/scripts/citation_extractor/citation_extractor.py b/scripts/citation_extractor/citation_extractor.py index 562098c85..c92a352f9 100644 --- a/scripts/citation_extractor/citation_extractor.py +++ b/scripts/citation_extractor/citation_extractor.py @@ -64,7 +64,7 @@ def __init__(self): self.citation_manager = NXcitation_manager() def _visit_NXcite(self, name, obj): - if "NX_class" in obj.attrs.keys(): + if "NX_class" in list(obj.attrs.keys()): if obj.attrs["NX_class"] in ["NXcite"]: citation = NXcitation(obj['description'][0], obj['doi'][0], @@ -86,7 +86,7 @@ def __check_input_params(args): sys.exit(1) if not os.path.exists(args[0]): - print("Input file '%s' does not exist" % args[0]) + print(("Input file '%s' does not exist" % args[0])) print("Exiting with error code 2 - Input file missing") sys.exit(2) diff --git a/scripts/config_generator/arg_parsers.py b/scripts/config_generator/arg_parsers.py index fcd28544c..e08028864 100644 --- a/scripts/config_generator/arg_parsers.py +++ b/scripts/config_generator/arg_parsers.py @@ -46,9 +46,8 @@ def __arg_parser(parser, args, command): try: args = parser.parse_args(args=args) except MyException as e: - if e.message: - print (e.message) - print("Please type '%s -h' for help." % command) + print(e) + print(f"Please type '{command} -h' for help.") args = e.args return args @@ -62,7 +61,7 @@ def _config_arg_parser(): help=disp_str, default=False) input_str = "Open a Savu process list." parser.add_argument("-i", "--input", dest="file", help=input_str) - parser.add_argument("-e", "--error", dest="error", help=argparse.SUPPRESS, + parser.add_argument("-e", "--error", dest="error", help="Shows all errors that Savu encounters.", action='store_true', default=False) parser.add_argument("--examples", dest="examples", action='store_true', help="Add example plugins", default=False) @@ -142,7 +141,7 @@ def _mod_arg_parser(args, desc): param_str = ("The plugin parameter to modify. Either " "'plugin_pos.param_name' or ' plugin_pos.param_no'") parser.add_argument("param", help=param_str) - val_str = ("The plugin parameter value.") + val_str = "The plugin parameter value." parser.add_argument("value", nargs='+', help=val_str) return __arg_parser(parser, args, 'mod') diff --git a/scripts/config_generator/completer.py b/scripts/config_generator/completer.py index a34db1fb1..23445c948 100644 --- a/scripts/config_generator/completer.py +++ b/scripts/config_generator/completer.py @@ -26,7 +26,7 @@ from savu.plugins import utils as pu if os.name == 'nt': - import win_readline as readline + from . import win_readline as readline else: import readline @@ -121,8 +121,8 @@ def _get_collections(self): def complete_params(self, args): if not args[0]: - return pu.plugins.keys() - return [x for x in pu.plugins.keys() if x.startswith(args[0])] + return list(pu.plugins.keys()) + return [x for x in list(pu.plugins.keys()) if x.startswith(args[0])] def complete(self, text, state): "Generic readline completion entry point." @@ -134,7 +134,7 @@ def __get_matches(self, read_buffer): # show all commands line = readline.get_line_buffer().split() if not line: - return [c + ' ' for c in self.commands.keys()] + return [c + ' ' for c in list(self.commands.keys())] else: # account for last argument ending in a space if RE_SPACE.match(read_buffer): @@ -142,11 +142,11 @@ def __get_matches(self, read_buffer): # resolve command to the implementation function cmd = line[0].strip() - if cmd in self.commands.keys(): + if cmd in list(self.commands.keys()): impl = getattr(self, 'complete_%s' % cmd) args = line[1:] if args: return (impl(args) + [None]) return [cmd + ' '] - return [c + ' ' for c in self.commands.keys() if + return [c + ' ' for c in list(self.commands.keys()) if c.startswith(cmd)] + [None] diff --git a/scripts/config_generator/config_utils.py b/scripts/config_generator/config_utils.py index 52759aba8..35c8456e5 100644 --- a/scripts/config_generator/config_utils.py +++ b/scripts/config_generator/config_utils.py @@ -23,19 +23,20 @@ import re import sys import os +import mmap import atexit import logging import traceback import pkgutil +import importlib.util from functools import wraps -import arg_parsers as parsers +from . import arg_parsers as parsers import savu.plugins.utils as pu import savu.data.data_structures.utils as du - if os.name == 'nt': - import win_readline as readline + from . import win_readline as readline else: import readline @@ -84,6 +85,7 @@ def _parse_args_wrap_function(content, args): if not args: return content return function(content, args) + return _parse_args_wrap_function @@ -93,58 +95,59 @@ def error_catcher_wrap_function(content, args): try: return function(content, args) except Exception as e: - savu_error = True if len(e.message.split()) > 1 and \ - e.message.split()[1] == 'ERROR:' else False + err_msg_list = str(e).split() + savu_error = True if len(err_msg_list) > 1 and err_msg_list[1] == 'ERROR:' else False if error_level is 0 and savu_error: - print e.message + print(e) elif error_level is 0: - print "%s: %s" % (type(e).__name__, e.message) + print(f"{type(e).__name__}: {e}") elif error_level is 1: traceback.print_exc(file=sys.stdout) return content - return error_catcher_wrap_function - -def _add_module(failed_imports, loader, module_name, error_mode): - if module_name not in sys.modules: - try: - loader.find_module(module_name).load_module(module_name) - except Exception as e: - clazz = ''.join([w.capitalize() for w in \ - module_name.split('.')[-1].split('_')]) - failed_imports[clazz] = e - if error_mode: - print("\nUnable to load plugin %s\n%s" % (module_name, e)) - else: - pass + return error_catcher_wrap_function -def populate_plugins(dawn=False, error_mode=False, examples=False): +def populate_plugins(error_mode=False, examples=False): # load all the plugins - plugins_path = pu.get_plugins_paths(examples=examples) - savu_plugins = plugins_path[-1:] - local_plugins = plugins_path[0:-1] - + plugins_paths = pu.get_plugins_paths(examples=examples) failed_imports = {} - # load local plugins - for loader, module_name, is_pkg in pkgutil.walk_packages(local_plugins): - _add_module(failed_imports, loader, module_name, error_mode) - # load savu plugins - for loader, module_name, is_pkg in pkgutil.walk_packages(savu_plugins): - if module_name.split('savu.plugins')[0] == '': - _add_module(failed_imports, loader, module_name, error_mode) + for path, name in plugins_paths.items(): + for finder, module_name, is_pkg in pkgutil.walk_packages([path], name): + if not is_pkg: + _load_module(finder, module_name, failed_imports, error_mode) + - if dawn: - _dawn_setup() +def _load_module(finder, module_name, failed_imports, error_mode): + try: + # need to ignore loading of plugin.utils as it is emptying the list + spec = finder.find_spec(module_name) + mod = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = mod + spec.loader.exec_module(mod) + except Exception as e: + if _is_registered_plugin(mod): + clazz = pu._get_cls_name(module_name) + failed_imports[clazz] = e + if error_mode: + print(("\nUnable to load plugin %s\n%s" % (module_name, e))) return failed_imports +def _is_registered_plugin(mod): + with open(mod.__file__) as f: + for line in f: + if "@register_plugin" in line and line.replace(' ', '')[0] != '#': + return True + return False + + def _dawn_setup(): - for plugin in pu.dawn_plugins.keys(): + for plugin in list(pu.dawn_plugins.keys()): p = pu.plugins[plugin]() pu.dawn_plugins[plugin]['input rank'] = \ du.get_pattern_rank(p.get_plugin_pattern()) @@ -157,7 +160,7 @@ def _get_dawn_parameters(plugin): plugin._populate_default_parameters() desc = plugin.parameters_desc params = {} - for key, value in plugin.parameters.iteritems(): + for key, value in plugin.parameters.items(): if key not in ['in_datasets', 'out_datasets']: params[key] = {'value': value, 'hint': desc[key]} return params @@ -179,7 +182,7 @@ def __get_filtered_plugins(pfilter): star_search = \ pfilter.split('*')[0] if pfilter and '*' in pfilter else False - for key, value in pu.plugins.iteritems(): + for key, value in pu.plugins.items(): if star_search: search = '(?i)^' + star_search if re.match(search, value.__name__) or \ diff --git a/scripts/config_generator/content.py b/scripts/config_generator/content.py index f8d9901d6..ad31af149 100644 --- a/scripts/config_generator/content.py +++ b/scripts/config_generator/content.py @@ -27,7 +27,7 @@ from savu.plugins import utils as pu from savu.data.plugin_list import PluginList -import mutations +from . import mutations class Content(object): @@ -49,7 +49,7 @@ def is_finished(self): def fopen(self, infile, update=False, skip=False): if os.path.exists(infile): - self.plugin_list._populate_plugin_list(infile, activePass=True) + self.plugin_list._populate_plugin_list(infile, active_pass=True) else: raise Exception('INPUT ERROR: The file does not exist.') self.filename = infile @@ -58,25 +58,31 @@ def fopen(self, infile, update=False, skip=False): self.param_mutations = self.check_mutations(self.param_mutations) self._apply_plugin_updates(skip) - def check_mutations(self, mut_dict): + def check_mutations(self, mut_dict: dict): plist_version = self._version_to_float(self.plugin_list.version) + # deleting elements while iterating invalidates the iterator + # which raises a RuntimeError in Python 3. + # Instead a copy of the dict is mutated and returned + mut_dict_copy = mut_dict.copy() for key, subdict in mut_dict.items(): if 'up_to_version' in subdict.keys(): up_to_version = self._version_to_float(subdict['up_to_version']) if plist_version >= up_to_version: - del mut_dict[key] - return mut_dict + del mut_dict_copy[key] + return mut_dict_copy def _version_to_float(self, version): - if version == None: + if version is None: return 0 + if isinstance(version, bytes): + version = version.decode("ascii") split_vals = version.split('.') return float('.'.join([split_vals[0], ''.join(split_vals[1:])])) def display(self, formatter, **kwargs): - if 'level' not in kwargs.keys(): + if 'level' not in list(kwargs.keys()): kwargs['level'] = self.disp_level - print '\n' + formatter._get_string(**kwargs) + '\n' + print('\n' + formatter._get_string(**kwargs) + '\n') def check_file(self, filename): if not filename: @@ -89,7 +95,7 @@ def check_file(self, filename): def save(self, filename, check='y', template=False): if check.lower() == 'y': - print("Saving file %s" % (filename)) + print(f"Saving file {filename}") if template: self.plugin_list.add_template(create=True) self.plugin_list._save_plugin_list(filename) @@ -101,10 +107,10 @@ def clear(self, check='y'): self.plugin_list.plugin_list = [] def add(self, name, str_pos): - if name not in pu.plugins.keys(): - if name in self.failed.keys(): - msg = "IMPORT ERROR: %s is unavailable due to the following"\ - " error:\n\t%s" % (name, self.failed[name]) + if name not in list(pu.plugins.keys()): + if name in list(self.failed.keys()): + msg = "IMPORT ERROR: %s is unavailable due to the following" \ + " error:\n\t%s" % (name, self.failed[name]) raise Exception(msg) else: raise Exception("INPUT ERROR: Unknown plugin %s" % name) @@ -134,15 +140,15 @@ def _update_parameters(self, plugin, name, keep, str_pos): # add any parameter mutations here classes = [c.__name__ for c in inspect.getmro(plugin.__class__)] m_dict = self.param_mutations - keys = [k for k in m_dict.keys() if k in classes] + keys = [k for k in list(m_dict.keys()) if k in classes] changes = False for k in keys: for entry in m_dict[k]['params']: - if entry['old'] in keep.keys(): + if entry['old'] in list(keep.keys()): changes = True val = keep[entry['old']] - if 'eval' in entry.keys(): + if 'eval' in list(entry.keys()): val = eval(entry['eval']) self.modify(str_pos, entry['new'], val, ref=True) if changes: @@ -151,23 +157,25 @@ def _update_parameters(self, plugin, name, keep, str_pos): def _apply_plugin_updates(self, skip=False): # Update old process lists that start from 0 the_list = self.plugin_list.plugin_list - if 'pos' in the_list[0].keys() and the_list[0]['pos'] == '0': + if 'pos' in list(the_list[0].keys()) and the_list[0]['pos'] == '0': self.increment_positions() missing = [] - pos = len(the_list)-1 + pos = len(the_list) - 1 notices = mutations.plugin_notices for plugin in the_list[::-1]: # update old process lists to include 'active' flag - if 'active' not in plugin.keys(): + if 'active' not in list(plugin.keys()): plugin['active'] = True - while(True): + while True: name = the_list[pos]['name'] if name in notices.keys(): - print notices[name]['desc'] - # if a plugin is missing then look for mutations + print(notices[name]['desc']) + + # if a plugin is missing from all available plugins + # then look for mutations in the plugin name search = True if name not in pu.plugins.keys() else False found = self._mutate_plugins(name, pos, search=search) if search and not found: @@ -175,20 +183,17 @@ def _apply_plugin_updates(self, skip=False): missing.append([name, str_pos]) self.remove(pos) pos -= 1 - if (name == the_list[pos]['name']): + if name == the_list[pos]['name']: break pos -= 1 - exception = False for name, pos in missing[::-1]: if skip: - print('Skipping plugin %s: %s' % (pos, name)) + print(f"Skipping plugin {pos}: {name}") else: - print("PLUGIN ERROR: The plugin %s is unavailable in this " - "version of Savu." % name) - exception = True - if exception: - raise Exception('Incompatible process list.') + message = f"PLUGIN ERROR: The plugin {name} is unavailable in this version of Savu." + print(message) + raise Exception(f'Incompatible process list. {message}') def _mutate_plugins(self, name, pos, search=False): """ Perform plugin mutations. """ @@ -205,16 +210,15 @@ def _mutate_plugins(self, name, pos, search=False): if name in m_dict.keys(): mutate = m_dict[name] if 'replace' in mutate.keys(): - if mutate['replace'] in pu.plugins.keys(): + if mutate['replace'] in list(pu.plugins.keys()): str_pos = self.plugin_list.plugin_list[pos]['pos'] self.refresh(str_pos, change=mutate['replace']) - print mutate['desc'] + print(mutate['desc']) return True - raise Exception('Replacement plugin %s unavailable for %s' - % (mutate['replace'], name)) + raise Exception(f"Replacement plugin {mutate['replace']} unavailable for {name}") elif 'remove' in mutate.keys(): self.remove(pos) - print mutate['desc'] + print(mutate['desc']) else: raise Exception('Unknown mutation type.') return False @@ -235,15 +239,15 @@ def modify(self, pos_str, subelem, value, ref=False): pos = self.find_position(pos_str) data_elements = self.plugin_list.plugin_list[pos]['data'] if subelem.isdigit(): - subelem = self.plugin_list.plugin_list[pos]['map'][int(subelem)-1] + subelem = self.plugin_list.plugin_list[pos]['map'][int(subelem) - 1] data_elements[subelem] = value def value(self, value): if not value.count(';'): try: - exec("value = " + value) + value = eval(value) except (NameError, SyntaxError): - exec("value = " + "'" + value + "'") + value = eval(f"'{value}'") return value def convert_to_ascii(self, value): @@ -253,7 +257,7 @@ def convert_to_ascii(self, value): return ascii_list def on_and_off(self, str_pos, index): - print("switching plugin %s %s" % (str_pos, index)) + print(("switching plugin %s %s" % (str_pos, index))) status = True if index == 'ON' else False pos = self.find_position(str_pos) self.plugin_list.plugin_list[pos]['active'] = status @@ -268,7 +272,7 @@ def convert_pos(self, str_pos): :rtype: (pos, str_pos) """ pos_list = self.get_split_positions() - num = re.findall("\d+", str_pos)[0] + num = re.findall(r"\d+", str_pos)[0] letter = re.findall("[a-z]", str_pos) entry = [num, letter[0]] if letter else [num] @@ -284,19 +288,19 @@ def convert_pos(self, str_pos): if len(entry) is 2: if len(pos_list[start]) is 2: idx = int([i for i in range(len(num_list)) if - (num_list[i] == entry[0])][-1])+1 - entry = [entry[0], str(unichr(ord(pos_list[idx-1][1])+1))] + (num_list[i] == entry[0])][-1]) + 1 + entry = [entry[0], str(chr(ord(pos_list[idx - 1][1]) + 1))] return idx, ''.join(entry) if entry[1] == 'a': self.plugin_list.plugin_list[start]['pos'] = entry[0] + 'b' return start, ''.join(entry) else: self.plugin_list.plugin_list[start]['pos'] = entry[0] + 'a' - return start+1, entry[0] + 'b' + return start + 1, entry[0] + 'b' return self.inc_positions(start, pos_list, entry, 1) # number not in list - entry[0] = str(int(num_list[-1])+1 if num_list else 1) + entry[0] = str(int(num_list[-1]) + 1 if num_list else 1) if len(entry) is 2: entry[1] = 'a' return len(self.plugin_list.plugin_list), ''.join(entry) @@ -306,7 +310,7 @@ def increment_positions(self): start from 1. """ for plugin in self.plugin_list.plugin_list: str_pos = plugin['pos'] - num = str(int(re.findall("\d+", str_pos)[0]) + 1) + num = str(int(re.findall(r'\d+', str_pos)[0]) + 1) letter = re.findall("[a-z]", str_pos) plugin['pos'] = ''.join([num, letter[0]] if letter else [num]) @@ -323,7 +327,7 @@ def get_split_positions(self): positions = self.get_positions() split_pos = [] for i in range(len(positions)): - num = re.findall('\d+', positions[i])[0] + num = re.findall(r'\d+', positions[i])[0] letter = re.findall('[a-z]', positions[i]) split_pos.append([num, letter[0]] if letter else [num]) return split_pos @@ -346,12 +350,12 @@ def inc_positions(self, start, pos_list, entry, inc): def inc_numbers(self, start, pos_list, inc): for i in range(start, len(pos_list)): - pos_list[i][0] = str(int(pos_list[i][0])+inc) + pos_list[i][0] = str(int(pos_list[i][0]) + inc) self.plugin_list.plugin_list[i]['pos'] = ''.join(pos_list[i]) def inc_letters(self, idx, pos_list, inc): for i in idx: - pos_list[i][1] = str(unichr(ord(pos_list[i][1])+inc)) + pos_list[i][1] = str(chr(ord(pos_list[i][1]) + inc)) self.plugin_list.plugin_list[i]['pos'] = ''.join(pos_list[i]) def insert(self, plugin, pos, str_pos, replace=False): @@ -372,7 +376,7 @@ def create_plugin_dict(self, plugin): plugin_dict['hide'] = plugin.parameters_hide plugin_dict['user'] = plugin.parameters_user - dev_keys = [k for k in plugin_dict['data'].keys() if k not in + dev_keys = [k for k in list(plugin_dict['data'].keys()) if k not in plugin_dict['user'] + plugin_dict['hide']] plugin_dict['map'] = \ plugin_dict['user'] + dev_keys + plugin_dict['hide'] @@ -390,5 +394,6 @@ def remove(self, pos): pos_list = self.get_split_positions() self.inc_positions(pos, pos_list, pos_str, -1) + @property def size(self): return len(self.plugin_list.plugin_list) diff --git a/scripts/config_generator/display_formatter.py b/scripts/config_generator/display_formatter.py index 4d2e7e479..ffa683c86 100644 --- a/scripts/config_generator/display_formatter.py +++ b/scripts/config_generator/display_formatter.py @@ -90,7 +90,7 @@ def _get_param_details(self, level, p_dict, width, desc=False): joiner = "\n" + " "*margin params = '' - dev_keys = [k for k in p_dict['data'].keys() if k not in + dev_keys = [k for k in list(p_dict['data'].keys()) if k not in p_dict['user'] + p_dict['hide']] keys = p_dict['user'] if level == 'user' else p_dict['user'] + dev_keys @@ -141,7 +141,7 @@ def _get_quiet(self, p_dict, count, width, quiet=True): active = \ '***OFF***' if 'active' in p_dict and not p_dict['active'] else '' p_dict['data'] = self._remove_quotes(p_dict['data']) - pos = p_dict['pos'].strip() if 'pos' in p_dict.keys() else count + pos = p_dict['pos'].strip() if 'pos' in list(p_dict.keys()) else count fore = Fore.RED + Style.DIM if active else Fore.LIGHTWHITE_EX back = Back.LIGHTBLACK_EX return self._get_plugin_title(p_dict, width, fore, back, @@ -176,7 +176,7 @@ def _get_verbose_verbose(self, level, p_dict, count, width): def _remove_quotes(self, data_dict): """ Remove quotes around variables for display """ - for key, val in data_dict.iteritems(): + for key, val in data_dict.items(): val = str(val).replace("'", "") data_dict[key] = val return data_dict @@ -188,7 +188,7 @@ def _notices(self): notice = Back.RED + Fore.WHITE + "IMPORTANT PLUGIN NOTICES" +\ Back.RESET + Fore.RESET + "\n" border = "*"*width + '\n' - print (border + notice + warnings + '\n'+border) + print((border + notice + warnings + '\n'+border)) def get_warnings(self, width): # remove display styling outside of this class diff --git a/scripts/config_generator/hdf5_template_extractor.py b/scripts/config_generator/hdf5_template_extractor.py index 2f1990a2b..53c7c701b 100644 --- a/scripts/config_generator/hdf5_template_extractor.py +++ b/scripts/config_generator/hdf5_template_extractor.py @@ -33,7 +33,7 @@ def get_parameter_value(nxsfile, plugin_name, plugin_param): found_params = [] for plugin in plist: if plugin['name'] == plugin_name: - if plugin_param in plugin['data'].keys(): + if plugin_param in list(plugin['data'].keys()): found_params.append(plugin['data'][plugin_param]) return found_params @@ -58,7 +58,7 @@ def get_data_dict(paths): def get_string_result(key, data_dict, mData, res=[]): if '*' in key: - for data in data_dict.keys(): + for data in list(data_dict.keys()): res = get_string_result( key.replace('*', data), data_dict, mData, res) else: @@ -74,6 +74,6 @@ def get_string_result(key, data_dict, mData, res=[]): paths = check_yaml_path(get_parameter_value(arg.nxsfile, plugin, param)) data_dict = get_data_dict(paths) res = get_string_result(arg.key, data_dict, MetaData(data_dict)) - print ','.join(res) + print(','.join(res)) \ No newline at end of file diff --git a/scripts/config_generator/mutations.py b/scripts/config_generator/mutations.py index d6e517510..1aca985b7 100644 --- a/scripts/config_generator/mutations.py +++ b/scripts/config_generator/mutations.py @@ -24,7 +24,7 @@ import textwrap from colorama import Back, Fore -import display_formatter as df +from . import display_formatter as df def wrap(string): @@ -77,9 +77,9 @@ def param_change_str(old, new, plugin, keys): removed = list(set(old).difference(set(new))) added = list(set(new).difference(set(old))) replaced = [entry['old'] for k in keys for entry in param_mutations[k] - if entry['old'] in old.keys()] + if entry['old'] in list(old.keys())] replacing = [entry['new'] for k in keys for entry in param_mutations[k] - if entry['old'] in old.keys()] + if entry['old'] in list(old.keys())] removed = [x for x in removed if x not in replaced] added = [x for x in added if x not in replacing] @@ -89,8 +89,8 @@ def param_change_str(old, new, plugin, keys): added_str = ["Adding parameter %s" % a for a in added] replaced_str = ["Replacing parameter %s with %s" % ( replaced[i], replacing[i]) for i in range(len(replaced))] - print wrap(param_changes_str(plugin) + '%s' % ( - '\n'.join(removed_str + added_str + replaced_str))) + print(wrap(param_changes_str(plugin) + '%s' % ( + '\n'.join(removed_str + added_str + replaced_str)))) hdf5_notice = 'is now used by default.\nPlease remove from the process list, '\ 'unless you wish to override the default parameters (which must be done '\ @@ -103,6 +103,18 @@ def param_change_str(old, new, plugin, keys): ' the version available in 2.3 \nand below being renamed as '\ 'DistortionCorrectionDeprecated. Please replace with \nthe new version.' +medianfilt_notice = '\nThis version of MedianFilter is now deprecated. Please'\ +' replace with the newer faster versions - MedianFilter or MedianFilterGpu.' + +dezinger_dep_notice ='is now deprecated. Please replace with the new version'\ + ' of Dezinger (or DezingerGPU).' + +dezinger_notice = '\nDezinger plugin has been replaced with a new version, '\ + 'please update the parameters. '\ + '\nNB: Dezinger should now be applied to normalised data. A GPU version '\ + 'DezingerGPU is also available.' + + plugin_mutations = \ {'TimeseriesFieldCorrections': {'replace': 'DarkFlatFieldCorrection', @@ -113,14 +125,30 @@ def param_change_str(old, new, plugin, keys): 'desc': replace_str('Hdf5TomoSaver', 'Hdf5Saver')}, 'DezingFilter': {'replace': 'DezingerSimple', - 'desc': rename_str('DezingFilter', 'DezingerSimple') + dezing_notice}, + 'desc': rename_str('DezingFilter', 'DezingerSimple') + wrap(dezing_notice)}, 'SavuLoader': {'replace': 'SavuNexusLoader', 'desc': replace_str('SavuLoader', 'SavuNexusLoader')}, 'DistortionCorrection': {'replace': 'DistortionCorrectionDeprecated', 'up_to_version': '2.4', # if the plist version is less than 2.4 (or not defined) then apply this mutation - 'desc': '\n' + Fore.RED + auto_replace_str() + distortion_notice + Fore.RESET} + 'desc': '\n' + Fore.RED + auto_replace_str() + wrap(distortion_notice) + Fore.RESET}, + 'MedianFilter': + {'replace': 'MedianFilterDeprecated', + 'up_to_version': '3.0', # if the plist version is less than 3.0 (or not defined) then apply this mutation + 'desc': '\n' + Fore.RED + auto_replace_str() + wrap(medianfilt_notice) + Fore.RESET}, + 'Dezinger': + {'replace': 'Dezinger', + 'up_to_version': '3.0', # if the plist version is less than 3.0 (or not defined) then apply this mutation + 'desc': '\n' + Fore.RED + auto_replace_str() + wrap(dezinger_notice) + Fore.RESET}, + 'DezingerSimple': + {'replace': 'DezingerSimpleDeprecated', + 'up_to_version': '3.0', # if the plist version is less than 3.0 (or not defined) then apply this mutation + 'desc': '\n' + Fore.RED + auto_replace_str() + wrap("\nDezingerSimple " + dezinger_dep_notice) + Fore.RESET}, + 'DezingerSinogram': + {'replace': 'DezingerSinogramDeprecated', + 'up_to_version': '3.0', # if the plist version is less than 3.0 (or not defined) then apply this mutation + 'desc': '\n' + Fore.RED + auto_replace_str() + wrap("\nDezingerSinogram " + dezinger_dep_notice) + Fore.RESET} } param_mutations = \ diff --git a/scripts/config_generator/parameter_extractor.py b/scripts/config_generator/parameter_extractor.py index ac5f42aab..5513aa13e 100644 --- a/scripts/config_generator/parameter_extractor.py +++ b/scripts/config_generator/parameter_extractor.py @@ -27,8 +27,8 @@ def get_parameter_value(nxsfile, plugin_name, plugin_param): for plugin in plist: if plugin['name'] == plugin_name: - if plugin_param in plugin['data'].keys(): - print plugin_name, plugin['data'][plugin_param] + if plugin_param in list(plugin['data'].keys()): + print(plugin_name, plugin['data'][plugin_param]) if __name__ == '__main__': arg = arg_parser() diff --git a/scripts/config_generator/savu_config.py b/scripts/config_generator/savu_config.py index 2c160eaac..40bb5bf9b 100644 --- a/scripts/config_generator/savu_config.py +++ b/scripts/config_generator/savu_config.py @@ -21,7 +21,7 @@ """ -from __future__ import print_function + import re import sys @@ -30,20 +30,20 @@ import warnings with warnings.catch_warnings(): warnings.simplefilter("ignore") - from content import Content - from completer import Completer - from display_formatter import ListDisplay, DispDisplay - import arg_parsers as parsers + from .content import Content + from .completer import Completer + from .display_formatter import ListDisplay, DispDisplay + from . import arg_parsers as parsers from savu.plugins import utils as pu - import config_utils as utils - from config_utils import parse_args - from config_utils import error_catcher + from . import config_utils as utils + from .config_utils import parse_args + from .config_utils import error_catcher def _help(content, args): """ Display the help information""" print('%s Savu configurator commands %s\n' % tuple(['*'*21]*2)) - for key in commands.keys(): + for key in list(commands.keys()): doc = commands[key].__doc__ if doc: print("%8s : %s" % (key, commands[key].__doc__)) @@ -97,7 +97,7 @@ def _save(content, args): content.check_file(out_file) print() DispDisplay(content.plugin_list)._notices() - content.save(out_file, check=raw_input("Are you sure you want to save the " + content.save(out_file, check=input("Are you sure you want to save the " "current data to %s' [y/N]" % (out_file)), template=args.template) return content @@ -178,14 +178,14 @@ def _coll(content, arg): def _clear(content, arg): """ Clear the current plugin list.""" - content.clear(check=raw_input("Are you sure you want to clear the current " + content.clear(check=input("Are you sure you want to clear the current " "plugin list? [y/N]")) return content def _exit(content, arg): """ Close the program.""" - content.set_finished(check=raw_input("Are you sure? [y/N]")) + content.set_finished(check=input("Are you sure? [y/N]")) return content @@ -213,12 +213,27 @@ def _history(content, arg): 'history': _history} -def main(): +def main(test=False): + """ + :param test: If test is True the last argument from sys.argv is removed, + as it contains the directory of the test scripts, which fails the + parsing of the arguments as it has an unexpected argument. + + If test is False then nothing is touched. + """ print("Running the configurator") - # required for travis tests - if len(sys.argv) > 2 and sys.argv[-2] == 'scripts/configurator_tests/': - sys.argv = [sys.argv[:-2]] + # required for running the tests locally or on travis + # drops the last argument from pytest which is the test file/module + if test: + try: + # find where the /scripts argument is + index_of_scripts_argument = ["scripts" in arg for arg in sys.argv].index(True) + # remove it, including every arguments after it (e.g --cov) + sys.argv = sys.argv[:index_of_scripts_argument] + except ValueError: + # scripts was not part of the arguments passed in by the test + pass args = parsers._config_arg_parser() if args.error: @@ -232,6 +247,7 @@ def main(): with warnings.catch_warnings(): warnings.simplefilter("ignore") + # imports all the (working) plugin modules content.failed = utils.populate_plugins(error_mode=args.error, examples=args.examples) @@ -249,10 +265,13 @@ def main(): while True: try: - in_list = raw_input(">>> ").strip().split(' ', 1) + in_list = input(">>> ").strip().split(' ', 1) except KeyboardInterrupt: print() continue + except EOFError: + # makes possible exiting on CTRL + D (EOF, like Python interpreter) + break command, arg = in_list if len(in_list) == 2 else in_list+[''] command = command if command else 'help' diff --git a/scripts/config_generator/update_template.py b/scripts/config_generator/update_template.py index 9daa65cae..a14114327 100644 --- a/scripts/config_generator/update_template.py +++ b/scripts/config_generator/update_template.py @@ -38,7 +38,7 @@ def update_template(filename, entry, key, val): template = yu.read_yaml(filename) entry = _string_to_val(entry) val = _string_to_val(val) - template[entry][template[entry].keys()[0]][key] = val + template[entry][list(template[entry].keys())[0]][key] = val with open(filename, 'w') as stream: yu.dump_yaml(template, stream) diff --git a/scripts/config_generator/win_readline.py b/scripts/config_generator/win_readline.py index 29cbea152..8139b421d 100644 --- a/scripts/config_generator/win_readline.py +++ b/scripts/config_generator/win_readline.py @@ -1,76 +1,76 @@ -from __future__ import print_function, unicode_literals, absolute_import -from pyreadline.rlmain import Readline - -__all__ = [ 'parse_and_bind', - 'get_line_buffer', - 'insert_text', - 'clear_history', - 'read_init_file', - 'read_history_file', - 'write_history_file', - 'get_current_history_length', - 'get_history_length', - 'get_history_item', - 'set_history_length', - 'set_startup_hook', - 'set_pre_input_hook', - 'set_completer', - 'get_completer', - 'get_begidx', - 'get_endidx', - 'set_completer_delims', - 'get_completer_delims', - 'add_history', - 'callback_handler_install', - 'callback_handler_remove', - 'callback_read_char',] #Some other objects are added below - - -# create a Readline object to contain the state -rl = Readline() - -if rl.disable_readline: - def dummy(completer=""): - pass - for funk in __all__: - globals()[funk] = dummy -else: - def GetOutputFile(): - '''Return the console object used by readline so that it can be used for printing in color.''' - return rl.console - __all__.append("GetOutputFile") - - import pyreadline.console as console - - # make these available so this looks like the python readline module - read_init_file = rl.read_init_file - parse_and_bind = rl.parse_and_bind - clear_history = rl.clear_history - add_history = rl.add_history - insert_text = rl.insert_text - - write_history_file = rl.write_history_file - read_history_file = rl.read_history_file - - get_completer_delims = rl.get_completer_delims - get_current_history_length = rl.get_current_history_length - get_history_length = rl.get_history_length - get_history_item = rl.get_history_item - get_line_buffer = rl.get_line_buffer - set_completer = rl.set_completer - get_completer = rl.get_completer - get_begidx = rl.get_begidx - get_endidx = rl.get_endidx - - set_completer_delims = rl.set_completer_delims - set_history_length = rl.set_history_length - set_pre_input_hook = rl.set_pre_input_hook - set_startup_hook = rl.set_startup_hook - - callback_handler_install=rl.callback_handler_install - callback_handler_remove=rl.callback_handler_remove - callback_read_char=rl.callback_read_char - - console.install_readline(rl.readline) - + +from pyreadline.rlmain import Readline + +__all__ = [ 'parse_and_bind', + 'get_line_buffer', + 'insert_text', + 'clear_history', + 'read_init_file', + 'read_history_file', + 'write_history_file', + 'get_current_history_length', + 'get_history_length', + 'get_history_item', + 'set_history_length', + 'set_startup_hook', + 'set_pre_input_hook', + 'set_completer', + 'get_completer', + 'get_begidx', + 'get_endidx', + 'set_completer_delims', + 'get_completer_delims', + 'add_history', + 'callback_handler_install', + 'callback_handler_remove', + 'callback_read_char',] #Some other objects are added below + + +# create a Readline object to contain the state +rl = Readline() + +if rl.disable_readline: + def dummy(completer=""): + pass + for funk in __all__: + globals()[funk] = dummy +else: + def GetOutputFile(): + '''Return the console object used by readline so that it can be used for printing in color.''' + return rl.console + __all__.append("GetOutputFile") + + import pyreadline.console as console + + # make these available so this looks like the python readline module + read_init_file = rl.read_init_file + parse_and_bind = rl.parse_and_bind + clear_history = rl.clear_history + add_history = rl.add_history + insert_text = rl.insert_text + + write_history_file = rl.write_history_file + read_history_file = rl.read_history_file + + get_completer_delims = rl.get_completer_delims + get_current_history_length = rl.get_current_history_length + get_history_length = rl.get_history_length + get_history_item = rl.get_history_item + get_line_buffer = rl.get_line_buffer + set_completer = rl.set_completer + get_completer = rl.get_completer + get_begidx = rl.get_begidx + get_endidx = rl.get_endidx + + set_completer_delims = rl.set_completer_delims + set_history_length = rl.set_history_length + set_pre_input_hook = rl.set_pre_input_hook + set_startup_hook = rl.set_startup_hook + + callback_handler_install=rl.callback_handler_install + callback_handler_remove=rl.callback_handler_remove + callback_read_char=rl.callback_read_char + + console.install_readline(rl.readline) + __all__.append("rl") \ No newline at end of file diff --git a/scripts/configurator_tests/dawn_compatible_test.py b/scripts/configurator_tests/dawn_compatible_test.py deleted file mode 100644 index 52485253b..000000000 --- a/scripts/configurator_tests/dawn_compatible_test.py +++ /dev/null @@ -1,35 +0,0 @@ -''' -This tests the functions required by dawn. If these tests break, the dawn \ -integration will certainly fail. -''' - -import unittest -import scripts.config_generator.config_utils as cu -import savu.plugins.utils as pu -from savu.plugins.utils import dawn_plugins - - -class DawnCompatibleTest(unittest.TestCase): - - def test_populate_plugins(self): - cu.populate_plugins() - - def test_dawn_plugins_found(self): - cu.populate_plugins() - self.assertGreater(len(pu.dawn_plugins), 0) - - def test_dawn_plugin_params_found(self): - cu.populate_plugins(dawn=True) - self.assertTrue(isinstance( - pu.dawn_plugin_params[pu.dawn_plugins.keys()[0]], dict)) - - def test_load_plugin(self): - cu.populate_plugins() - plugin_path = pu.dawn_plugins[dawn_plugins.keys()[0]]['path2plugin'] - inst = pu.load_class(plugin_path)() - sl = inst.__dict__['slice_list'] - exp = inst.__dict__['exp'] - - -if __name__ == '__main__': - unittest.main() diff --git a/scripts/configurator_tests/refresh_process_lists_test.py b/scripts/configurator_tests/refresh_process_lists_test.py index a06047338..561cf29cf 100644 --- a/scripts/configurator_tests/refresh_process_lists_test.py +++ b/scripts/configurator_tests/refresh_process_lists_test.py @@ -12,8 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - """ .. module:: refresh_process_lists_test :platform: Unix @@ -31,27 +29,6 @@ class RefreshProcessListsTest(unittest.TestCase): - def test_refresh(self): - cu.populate_plugins() - path = os.path.dirname(os.path.realpath(__file__)).split('scripts')[0] - - nxs_in_tests, plugins_in_tests = \ - tplu.get_process_list(path + '/savu/test/travis') - - lists = tplu.get_test_process_list(path + 'test_data/process_lists') \ - + tplu.get_test_process_list(path+'test_data/test_process_lists') - nxs_used = list(set(nxs_in_tests).intersection(set(lists))) - - test_path = path + '/test_data/test_process_lists' - test_path2 = path + '/test_data/process_lists' - exclude = ['multimodal/simple_fit_test_XRF.nxs'] - for f in [n for n in nxs_used if n not in exclude]: - print "Refreshing process list", f, "..." - if os.path.exists(os.path.join(test_path, f)): - self._refresh_process_file(os.path.join(test_path, f)) - else: - self._refresh_process_file(os.path.join(test_path2, f)) - def _refresh_process_file(self, path): content = Content() # open @@ -64,5 +41,36 @@ def _refresh_process_file(self, path): content.save(content.filename) +def generate_test(path): + def test(self): + self._refresh_process_file(path) + return test + + if __name__ == "__main__": + cu.populate_plugins() + path = os.path.dirname(os.path.realpath(__file__)).split('scripts')[0] + + nxs_in_tests, plugins_in_tests = \ + tplu.get_process_list(path + '/savu/test/travis') + + lists = tplu.get_test_process_list(path + 'test_data/process_lists') \ + + tplu.get_test_process_list(path+'test_data/test_process_lists') + nxs_used = list(set(nxs_in_tests).intersection(set(lists))) + + test_path = path + '/test_data/test_process_lists' + test_path2 = path + '/test_data/process_lists' + exclude = ['multimodal/simple_fit_test_XRF.nxs'] + for f in [n for n in nxs_used if n not in exclude]: + print("Refreshing process list", f, "...") + if os.path.exists(os.path.join(test_path, f)): + path = os.path.join(test_path, f) + else: + path = os.path.join(test_path2, f) + + # generates a function that calls refresh_process_file for each file + test = generate_test(path) + # then sets the function as an attribute of the test class, so that + # every process list is ran as an independent test + setattr(RefreshProcessListsTest, f"test_{path}", test) unittest.main() diff --git a/scripts/configurator_tests/savu_config_test.py b/scripts/configurator_tests/savu_config_test.py index bd139e7df..3d5f4a66a 100644 --- a/scripts/configurator_tests/savu_config_test.py +++ b/scripts/configurator_tests/savu_config_test.py @@ -3,26 +3,24 @@ @author: ssg37927 ''' -from __future__ import print_function import sys import unittest from mock import patch -from StringIO import StringIO +from io import StringIO from scripts.config_generator import savu_config class Test(unittest.TestCase): - def savu_config_runner(self, input_list, output_checks): - with patch('__builtin__.raw_input', side_effect=input_list): + with patch('builtins.input', side_effect=input_list): saved_stdout = sys.stdout try: out = StringIO() sys.stdout = out - savu_config.main() + savu_config.main(test=True) output = out.getvalue().strip() for check in output_checks: assert check in output @@ -36,15 +34,18 @@ def testExit(self): def testHelpBlank(self): input_list = ['', 'exit', 'y'] - output_checks = ['help : Display the help information', - 'exit : Close the program'] + output_checks = [ + 'help : Display the help information', 'exit : Close the program' + ] self.savu_config_runner(input_list, output_checks) def testHelpCommand(self): input_list = ['help', 'exit', 'y'] - output_checks = ['help : Display the help information', - 'exit : Close the program'] + output_checks = [ + 'help : Display the help information', 'exit : Close the program' + ] self.savu_config_runner(input_list, output_checks) + if __name__ == "__main__": unittest.main() diff --git a/scripts/dawn_compatible_test.py b/scripts/dawn_compatible_test.py deleted file mode 100644 index e730233eb..000000000 --- a/scripts/dawn_compatible_test.py +++ /dev/null @@ -1,35 +0,0 @@ -''' -This tests the functions required by dawn. If these tests break, the dawn \ -integration will certainly fail. -''' - -import unittest -import scripts.config_generator.config_utils as cu -import savu.plugins.utils as pu -from savu.plugins.utils import dawn_plugins - - -class DawnCompatibleTest(unittest.TestCase): - - def test_populate_plugins(self): - cu.populate_plugins() - - def test_dawn_plugins_found(self): - cu.populate_plugins() - self.assertGreater(len(pu.dawn_plugins), 0) - - def test_dawn_plugin_params_found(self): - cu.populate_plugins() - self.assertTrue(isinstance( - pu.dawn_plugin_params[pu.dawn_plugins.keys()[0]], dict)) - - def test_load_plugin(self): - cu.populate_plugins() - plugin_path = pu.dawn_plugins[dawn_plugins.keys()[0]]['path2plugin'] - inst = pu.get_plugin(plugin_path) - sl = inst.__dict__['slice_list'] - exp = inst.__dict__['exp'] - - -if __name__ == '__main__': - unittest.main() diff --git a/scripts/dawn_runner/run_savu.py b/scripts/dawn_runner/run_savu.py index 2a1fd48dc..218416075 100644 --- a/scripts/dawn_runner/run_savu.py +++ b/scripts/dawn_runner/run_savu.py @@ -21,7 +21,7 @@ def get_output_rank(path2plugin, inputs, params, persistence): try: parameters = {} # slight repack here - for key in params.keys(): + for key in list(params.keys()): val = params[key]["value"] if type(val)==type(''): val = val.replace('\n','').strip() @@ -67,14 +67,14 @@ def runSavu(path2plugin, params, metaOnly, inputs, persistence): if not plugin_object: parameters = {} # slight repack here - for key in params.keys(): + for key in list(params.keys()): # print "here" val = params[key]["value"] if type(val)==type(''): val = val.replace('\n','').strip() # print val parameters[key] = val - print("val: {}".format(val)) + print(("val: {}".format(val))) # print "initialising the object" plugin_object = _savu_setup(path2plugin, inputs, parameters) persistence['plugin_object'] = plugin_object @@ -114,7 +114,7 @@ def runSavu(path2plugin, params, metaOnly, inputs, persistence): else: data = inputs['data'] - print("metaOnly: {}".format(metaOnly)) + print(("metaOnly: {}".format(metaOnly))) if not metaOnly: @@ -134,7 +134,7 @@ def runSavu(path2plugin, params, metaOnly, inputs, persistence): result['auxiliary'] = aux t2 = time.time() - print "time to runSavu = "+str((t2-t1)) + print("time to runSavu = "+str((t2-t1))) return result @@ -179,11 +179,11 @@ def setup_exp_and_data(inputs, data, plugin): data_obj.add_pattern('PROJECTION', core_dims=(1,), slice_dims=(0, )) if len(inputs['data'].shape)==2: if inputs['xaxis_title'] is None or inputs['xaxis_title'].isspace(): - print "set x" + print("set x") inputs['xaxis_title']='x' inputs['xaxis'] = np.arange(inputs['data'].shape[0]) if inputs['yaxis_title'] is None or inputs['yaxis_title'].isspace(): - print "set y" + print("set y") inputs['yaxis_title']='y' size_y_axis = inputs['data'].shape[1] inputs['yaxis'] = np.arange(size_y_axis) diff --git a/scripts/log_evaluation/GraphicalThreadProfiler.py b/scripts/log_evaluation/GraphicalThreadProfiler.py index 7085b354c..22d864c34 100644 --- a/scripts/log_evaluation/GraphicalThreadProfiler.py +++ b/scripts/log_evaluation/GraphicalThreadProfiler.py @@ -65,7 +65,7 @@ def get_frame(log_file, the_key, log_level): data['Key'] = data['Machine'] + data['CPU'] frame = ((data[data.Type == log_level])[data.columns[[6, 5, 1]]]) - frame.insert(0, 'Index', range(len(frame))) + frame.insert(0, 'Index', list(range(len(frame)))) frame = frame.sort_values(by=['Key', 'Index']) del frame['Index'] diff --git a/scripts/log_evaluation/GraphicalThreadProfiler_multi.py b/scripts/log_evaluation/GraphicalThreadProfiler_multi.py index d4634d7a9..d90d67031 100644 --- a/scripts/log_evaluation/GraphicalThreadProfiler_multi.py +++ b/scripts/log_evaluation/GraphicalThreadProfiler_multi.py @@ -41,7 +41,7 @@ def get_index(frame): index = [] for i in range(np.size(frame.Key.unique())): nth.append(frame[frame.Key == frame.Key.unique()[i]].count()[0]) - index.append(range(nth[i])) + index.append(list(range(nth[i]))) return [index, nth] @@ -131,6 +131,6 @@ def get_base_path(filename): parser = optparse.OptionParser(usage=usage) (options, args) = parser.parse_args() - print args + print(args) filename = [(os.getcwd() + '/' + file) for file in args] convert(filename) diff --git a/scripts/log_evaluation/VisualiseProfileData.py b/scripts/log_evaluation/VisualiseProfileData.py index aa1416ae5..f0437a290 100644 --- a/scripts/log_evaluation/VisualiseProfileData.py +++ b/scripts/log_evaluation/VisualiseProfileData.py @@ -1,5 +1,5 @@ -import GraphicalThreadProfiler as GTP -import GraphicalThreadProfiler_multi as GTP_m +from . import GraphicalThreadProfiler as GTP +from . import GraphicalThreadProfiler_multi as GTP_m import fnmatch import os @@ -42,7 +42,7 @@ def get_files(dir_path): def render_template(frame, outfilename, title, size, params, header_shift, max_std): from jinja2 import Template - import template_strings as ts + from . import template_strings as ts nVals = len(frame) @@ -51,8 +51,8 @@ def render_template(frame, outfilename, title, size, params, header_shift, header_shift)) style = os.path.dirname(__file__) + '/style_sheet.css' - print outfilename - f_out.write(template.render(frame=[map(list, f) for f in frame], + print(outfilename) + f_out.write(template.render(frame=[list(map(list, f)) for f in frame], style_sheet=style, max_bubble=max_std)) f_out.close() diff --git a/scripts/log_evaluation/template_strings.py b/scripts/log_evaluation/template_strings.py index 997101431..f7926da03 100644 --- a/scripts/log_evaluation/template_strings.py +++ b/scripts/log_evaluation/template_strings.py @@ -8,13 +8,10 @@ def set_template_string_multi(chart_width): - - + - - + -