├── .gitignore ├── BUILD_ME_LIKE_THIS_FOR_CVL.sh ├── BUILD_ME_LIKE_THIS_FOR_DEB.sh ├── BUILD_ME_LIKE_THIS_FOR_RPM.sh ├── COPYING ├── README ├── cvl ├── BUILD_ME_LIKE_THIS_FOR_CVL.sh ├── CMakeLists.txt ├── Test │ └── test1 ├── check ├── config └── validate_module.sh ├── data ├── colormaps │ ├── blue │ ├── bluered │ ├── bluered_4sd │ ├── cyan │ ├── green │ ├── grey │ ├── half_hotblue │ ├── half_hotgreen │ ├── half_hotred │ ├── hot │ ├── hotblue │ ├── hotgreen │ ├── hotmetal-reduced │ ├── hotred │ ├── magenta │ ├── phase │ ├── pt_blue │ ├── pt_green │ ├── pt_red │ ├── rainbow │ ├── red │ ├── spectral │ └── yellow └── labels │ ├── rgb-to-index.txt │ └── test.labels ├── deb ├── clients │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── install │ ├── rules │ └── source │ │ └── format └── server │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── install │ ├── rules │ └── source │ └── format ├── docker ├── README.md ├── default.env ├── docker-compose.yml ├── init-db.sh ├── postgres.Dockerfile └── tissuestack.Dockerfile ├── jars ├── TS_CL_Tool.jar ├── TissueStackBioFormatsConverter.jar └── bioformats-5.1.1.jar ├── packaging ├── BioFormats2TissueStackConverter ├── post-install-cvl.sh ├── post-install.sh ├── post-uninstall-cvl.sh ├── post-uninstall.sh ├── pre-install-cvl.sh ├── pre-install.sh ├── pre-uninstall-cvl.sh ├── pre-uninstall.sh ├── tissuestack-httpd.conf ├── tissuestack.service ├── tissuestack.sh ├── tissuestack_deb_init.sh ├── tissuestack_init.sh ├── tissuestack_modules.sh ├── tissuestack_rpm_init.sh ├── tissuestack_sysctl.sh └── ts_cl ├── rpm ├── tissuestack.spec ├── tissuestack_clients.spec ├── tissuestack_suse.spec └── tissuestack_sysctl.spec └── src ├── c++ ├── Makefile ├── Makefile.cvl ├── README ├── TissueStackMain.cpp ├── common │ ├── ProcessingStrategy.cpp │ ├── Request.cpp │ ├── RequestFilter.cpp │ ├── RequestTimeStampStore.cpp │ ├── TissueStackApplicationException.cpp │ ├── TissueStackConfigurationParameters.cpp │ ├── TissueStackException.cpp │ ├── TissueStackFileUploadException.cpp │ ├── TissueStackInvalidRequestException.cpp │ ├── TissueStackLogger.cpp │ ├── TissueStackNullPointerException.cpp │ ├── TissueStackObsoleteRequestException.cpp │ ├── TissueStackProcessingStrategy.cpp │ ├── TissueStackServerException.cpp │ └── include │ │ ├── exceptions.h │ │ ├── globals.h │ │ ├── logging.h │ │ ├── parameters.h │ │ └── tissuestack.h ├── database │ ├── AtlasInfo.cpp │ ├── Configuration.cpp │ ├── ConfigurationDataProvider.cpp │ ├── DataSetDataProvider.cpp │ ├── DataSetInfo.cpp │ ├── LabelLookupDataProvider.cpp │ ├── MetaDataProvider.cpp │ ├── SessionDataProvider.cpp │ ├── TissueStackPostgresConnector.cpp │ └── include │ │ └── database.h ├── execution │ ├── SharedLibraryFunctionCall.cpp │ ├── SimpleSequentialExecution.cpp │ ├── ThreadPool.cpp │ ├── TissueStackColorMapAndLookupUpdater.cpp │ ├── TissueStackOfflineExecutor.cpp │ ├── TissueStackOnlineExecutor.cpp │ ├── TissueStackSliceCacheCleaner.cpp │ ├── TissueStackTaskQueueExecutor.cpp │ ├── WorkerThread.cpp │ └── include │ │ └── execution.h ├── imaging │ ├── DataSetSliceCache.cpp │ ├── DicomFileWrapper.cpp │ ├── NoCacheAdapter.cpp │ ├── PreTiler.cpp │ ├── RawConverter.cpp │ ├── SimpleCacheHeuristics.cpp │ ├── SliceCacheEntry.cpp │ ├── TissueStackColorMap.cpp │ ├── TissueStackColorMapStore.cpp │ ├── TissueStackDataBaseData.cpp │ ├── TissueStackDataDimension.cpp │ ├── TissueStackDataSet.cpp │ ├── TissueStackDataSetStore.cpp │ ├── TissueStackDicomData.cpp │ ├── TissueStackImageData.cpp │ ├── TissueStackLabelLookup.cpp │ ├── TissueStackLabelLookupStore.cpp │ ├── TissueStackMincData.cpp │ ├── TissueStackNiftiData.cpp │ ├── TissueStackRawData.cpp │ ├── TissueStackSliceCache.cpp │ ├── UncachedImageExtraction.cpp │ └── include │ │ └── imaging.h ├── networking │ ├── HttpRequest.cpp │ ├── HttpRequestSanityFilter.cpp │ ├── RawHttpRequest.cpp │ ├── TissueStackConversionRequest.cpp │ ├── TissueStackImageRequest.cpp │ ├── TissueStackPreTilingRequest.cpp │ ├── TissueStackQueryRequest.cpp │ ├── TissueStackRequestFilter.cpp │ ├── TissueStackServicesRequest.cpp │ └── include │ │ ├── networking.h │ │ └── server.h ├── services │ ├── ColorMapService.cpp │ ├── ConfigurationService.cpp │ ├── DataSetConfigurationService.cpp │ ├── TissueStackAdminService.cpp │ ├── TissueStackConversionTask.cpp │ ├── TissueStackMetaDataService.cpp │ ├── TissueStackSecurityService.cpp │ ├── TissueStackService.cpp │ ├── TissueStackServiceError.cpp │ ├── TissueStackServicesDelegator.cpp │ ├── TissueStackTask.cpp │ ├── TissueStackTaskQueue.cpp │ ├── TissueStackTilingTask.cpp │ └── include │ │ └── services.h ├── tools │ ├── Makefile │ ├── Makefile.cvl │ ├── TissueStackConverter.cpp │ └── TissueStackPreTiler.cpp └── utils │ ├── Misc.cpp │ ├── System.cpp │ ├── Timer.cpp │ └── include │ └── utils.h ├── java ├── build.xml ├── libs │ └── json-simple-1.1.1.jar ├── main │ └── au │ │ └── edu │ │ └── cai │ │ ├── TissueStackBioFormatsConverter.java │ │ └── cl │ │ ├── TissueStackCLCommunicator.java │ │ ├── TissueStackCLConfig.java │ │ ├── TissueStackCLTool.java │ │ ├── actions │ │ ├── ClAction.java │ │ ├── ClActionResult.java │ │ ├── ConfigAction.java │ │ ├── ConfigurationAction.java │ │ ├── ConversionAction.java │ │ ├── DataSetImportAction.java │ │ ├── DataSetModifyAction.java │ │ ├── DeleteDataSetAction.java │ │ ├── FileAction.java │ │ ├── ListDataSetAction.java │ │ ├── ListUploadDirectoryAction.java │ │ ├── LoginAction.java │ │ ├── PasswordChangeAction.java │ │ ├── QueryDataSetAction.java │ │ └── TilingAction.java │ │ └── json │ │ └── JsonParser.java └── pom.xml ├── sql ├── README ├── create_tissuestack_config.sql ├── create_tissuestack_db.sql ├── create_tissuestack_tables.sql └── patches.sql └── web ├── README ├── ands_dataset_registration.html ├── css ├── admin_login.css ├── default.css ├── images │ ├── ajax-loader.gif │ └── icons-png │ │ ├── action-black.png │ │ ├── action-white.png │ │ ├── alert-black.png │ │ ├── alert-white.png │ │ ├── arrow-d-black.png │ │ ├── arrow-d-l-black.png │ │ ├── arrow-d-l-white.png │ │ ├── arrow-d-r-black.png │ │ ├── arrow-d-r-white.png │ │ ├── arrow-d-white.png │ │ ├── arrow-l-black.png │ │ ├── arrow-l-white.png │ │ ├── arrow-r-black.png │ │ ├── arrow-r-white.png │ │ ├── arrow-u-black.png │ │ ├── arrow-u-l-black.png │ │ ├── arrow-u-l-white.png │ │ ├── arrow-u-r-black.png │ │ ├── arrow-u-r-white.png │ │ ├── arrow-u-white.png │ │ ├── audio-black.png │ │ ├── audio-white.png │ │ ├── back-black.png │ │ ├── back-white.png │ │ ├── bars-black.png │ │ ├── bars-white.png │ │ ├── bullets-black.png │ │ ├── bullets-white.png │ │ ├── calendar-black.png │ │ ├── calendar-white.png │ │ ├── camera-black.png │ │ ├── camera-white.png │ │ ├── carat-d-black.png │ │ ├── carat-d-white.png │ │ ├── carat-l-black.png │ │ ├── carat-l-white.png │ │ ├── carat-r-black.png │ │ ├── carat-r-white.png │ │ ├── carat-u-black.png │ │ ├── carat-u-white.png │ │ ├── check-black.png │ │ ├── check-white.png │ │ ├── clock-black.png │ │ ├── clock-white.png │ │ ├── cloud-black.png │ │ ├── cloud-white.png │ │ ├── comment-black.png │ │ ├── comment-white.png │ │ ├── delete-black.png │ │ ├── delete-white.png │ │ ├── edit-black.png │ │ ├── edit-white.png │ │ ├── eye-black.png │ │ ├── eye-white.png │ │ ├── forbidden-black.png │ │ ├── forbidden-white.png │ │ ├── forward-black.png │ │ ├── forward-white.png │ │ ├── gear-black.png │ │ ├── gear-white.png │ │ ├── grid-black.png │ │ ├── grid-white.png │ │ ├── heart-black.png │ │ ├── heart-white.png │ │ ├── home-black.png │ │ ├── home-white.png │ │ ├── info-black.png │ │ ├── info-white.png │ │ ├── location-black.png │ │ ├── location-white.png │ │ ├── lock-black.png │ │ ├── lock-white.png │ │ ├── mail-black.png │ │ ├── mail-white.png │ │ ├── minus-black.png │ │ ├── minus-white.png │ │ ├── navigation-black.png │ │ ├── navigation-white.png │ │ ├── phone-black.png │ │ ├── phone-white.png │ │ ├── plus-black.png │ │ ├── plus-white.png │ │ ├── power-black.png │ │ ├── power-white.png │ │ ├── recycle-black.png │ │ ├── recycle-white.png │ │ ├── refresh-black.png │ │ ├── refresh-white.png │ │ ├── search-black.png │ │ ├── search-white.png │ │ ├── shop-black.png │ │ ├── shop-white.png │ │ ├── star-black.png │ │ ├── star-white.png │ │ ├── tag-black.png │ │ ├── tag-white.png │ │ ├── user-black.png │ │ ├── user-white.png │ │ ├── video-black.png │ │ └── video-white.png ├── jquery.mobile-1.4.5.min.css ├── jquery.mobile.icons.min.css ├── jquery.mobile.structure-1.4.5.min.css ├── phone.css ├── tissuestack-theme.min.css └── ui.dynatree.css ├── desktop.html ├── embedded.html ├── images ├── admin │ ├── bg.jpg │ ├── bt_close.png │ ├── bt_open.png │ ├── tab_b.png │ ├── tab_l.png │ ├── tab_m.png │ └── tab_r.png ├── ands-full-b.png ├── cursor.cur ├── cursor.gif ├── distance_scale.png ├── favicon_icon.png ├── logo_EIF.gif ├── maximize.png ├── mobile │ ├── ajax-loader.gif │ ├── ajax-loader.png │ ├── dataset-icons.gif │ ├── dataset-loading.gif │ ├── dataset-vline.gif │ ├── icons-18-black.png │ ├── icons-18-white.png │ ├── icons-36-black.png │ ├── icons-36-white.png │ └── ipadscreen.png ├── phone │ ├── iphone3screen.png │ ├── iphone4screen.png │ ├── iphone5screen.png │ ├── iphonescreen.png │ ├── menuBg.gif │ ├── menuBg.png │ ├── menuBgNEW.png │ └── menuIconsSprite.png ├── select_bk.png ├── swap.png ├── swap_button.png └── uq-logo.gif ├── index.html ├── js ├── TissueStack.Admin.js ├── TissueStack.Canvas.js ├── TissueStack.CanvasOverlay.js ├── TissueStack.ComponentFactory.js ├── TissueStack.ContrastCanvas.js ├── TissueStack.DataSetNavigation.js ├── TissueStack.DataSetOverlay.js ├── TissueStack.DataSetStore.js ├── TissueStack.Embedded.js ├── TissueStack.Events.js ├── TissueStack.Extent.js ├── TissueStack.Init.js ├── TissueStack.Measurements.js ├── TissueStack.MouseWheel.js ├── TissueStack.PhoneMenu.js ├── TissueStack.Queue.js ├── TissueStack.SVGOverlay.js ├── TissueStack.Slider.js ├── TissueStack.Tasks.js ├── TissueStack.Utils.js ├── TissueStack.js └── libs │ ├── addToHome.js │ ├── jquery │ ├── jquery-2.1.1.min.js │ ├── jquery-ui.min.js │ ├── jquery.cookie.js │ ├── jquery.dynatree.min.js │ ├── jquery.form.js │ ├── jquery.knob.js │ ├── jquery.mobile-1.4.5.min.js │ ├── jquery.mobile-1.4.5.min.map │ └── skin │ │ ├── dataset.png │ │ ├── image_service.png │ │ ├── ontology.png │ │ ├── ontology_part.png │ │ └── pre_tiled.png │ ├── mobile-detect.min.js │ └── sylvester │ ├── sylvester-min.js │ └── sylvester.js ├── phone.html └── tablet.html /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .classpath 3 | .project 4 | tiles 5 | *.log 6 | .cproject 7 | .libs 8 | .deps 9 | *.lo 10 | *.la 11 | *.o 12 | *.so 13 | config.status 14 | libtool 15 | *.class 16 | target 17 | autom4te.cache 18 | *.scan 19 | *.tar.gz 20 | aclocal.m4 21 | configure 22 | Build (GNU) 23 | .autotools 24 | *.esproj 25 | TissueStackServer 26 | TissueStackPreTiler 27 | TissueStackConverter 28 | binaries 29 | *.war 30 | test 31 | *~ 32 | ~ 33 | /bin/ 34 | dist 35 | build 36 | node_modules 37 | .env 38 | tissuestack-data 39 | postgres-data 40 | docker-compose.override.yml -------------------------------------------------------------------------------- /BUILD_ME_LIKE_THIS_FOR_CVL.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | clear 3 | 4 | #HAS_PQXX_LIB=`yum list installed | grep "libpqxx-devel" | wc -c` 5 | #if [ $HAS_PQXX_LIB -eq 0 ]; then 6 | # echo "Build and install libpqxx first => see tissuestack git branch: libpqxx-devel!" 7 | # exit -1 8 | #fi; 9 | 10 | IS_CENTOS_6_X=`cat /etc/*-release | grep -i "centos release 6."| wc -c` 11 | if [ $IS_CENTOS_6_X -gt 0 ]; then 12 | CENTOS_DEVTOOLS_1_1=`yum list installed | grep "devtoolset-1.1" | wc -c` 13 | if [ $CENTOS_DEVTOOLS_1_1 -eq 0 ]; then 14 | echo "Install devtools 1.1 first. CentOS 6.X needs it to compile C++ V11 code." 15 | echo "Execute: 'cd /etc/yum.repos.d;wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo';" 16 | echo "Then run: 'yum install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++'" 17 | exit -1 18 | fi; 19 | echo -e "\nIMPORTANT:\n" 20 | echo "if the build fails with a message similar to these below, execute the line 'scl enable devtoolset-1.1 bash' prior to running this script" 21 | echo "cc1plus: error: unrecognized command line option -std=c++11" 22 | echo -e "cc1plus: error: unrecognized command line option -std=gnu++11\n" 23 | fi; 24 | 25 | echo -e "\n\n*********************************************************************************************************" 26 | echo -e "!!! THIS BUILD OF TISSUE STACK BUILDS FOR THE PARTICULAR NEEDS OF CVL e.g MODULES AND README.TXT !!!" 27 | echo -e "*********************************************************************************************************\n\n" 28 | 29 | source packaging/tissuestack_modules.sh 30 | module load graphicsmagick 31 | 32 | cd src/c++ 33 | echo -n "Cleaning..." 34 | make -f Makefile.cvl clean > /dev/null 35 | echo -e "Finished Cleaning.\n" 36 | 37 | make -f Makefile.cvl dist 38 | cd ../.. 39 | if [ $? -ne 0 ]; then 40 | exit -1 41 | fi 42 | 43 | echo -e "\n\n*******************************************************************" 44 | echo -e "\tNOW GO AHEAD AND CVL BUILD ME FROM THE TAR JUST CREATED" 45 | echo -e "*******************************************************************" 46 | -------------------------------------------------------------------------------- /BUILD_ME_LIKE_THIS_FOR_DEB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | clear 3 | 4 | export IS_RELEASE=1 5 | export TISSUESTACK_BUILD_VERSION=2.3 6 | 7 | echo "Setting up build directory and copying config files" 8 | BUILD_DIR=/tmp/tissuestack_build_debian 9 | rm -rf $BUILD_DIR 10 | 11 | EXT_BUILD_DIR=$BUILD_DIR/tissuestack-$TISSUESTACK_BUILD_VERSION 12 | 13 | TARGET=server 14 | if [ $# -ne 0 ] && [ "$1" = "CLIENTS" ]; then 15 | TARGET=clients 16 | EXT_BUILD_DIR=$BUILD_DIR/tissuestack-$TARGET-$TISSUESTACK_BUILD_VERSION 17 | fi; 18 | 19 | CURRENT_DIR=`pwd` 20 | 21 | mkdir -p $EXT_BUILD_DIR/debian 22 | cp -rf $CURRENT_DIR/deb/$TARGET/* $EXT_BUILD_DIR/debian 23 | 24 | echo "Calling TissueStack make with target $TARGET" 25 | cd $CURRENT_DIR/src/c++;make $TARGET 26 | 27 | echo "Believe it or not we have to wait for tar to finish off..." 28 | sleep 5 29 | 30 | echo "Starting DEBIAN package build now ..." 31 | cd $EXT_BUILD_DIR 32 | dpkg-buildpackage -us -uc 33 | -------------------------------------------------------------------------------- /BUILD_ME_LIKE_THIS_FOR_RPM.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | clear 3 | 4 | echo "Setting up development tree in $HOME" 5 | rm -rf $HOME/rpmbuild 6 | rpmdev-setuptree 7 | if [ $? -ne 0 ]; then 8 | echo "Install the rpm development tools first!" 9 | exit -1 10 | fi 11 | 12 | export TISSUESTACK_BUILD_VERSION=2.3 13 | export IS_RELEASE=1 14 | 15 | SPEC_FILE=tissuestack.spec 16 | TARGET=server 17 | 18 | IS_SUSE=`cat /etc/*-release | grep -i "suse"| wc -c` 19 | IS_CENTOS=`cat /etc/*-release | grep -i "centos"| wc -c` 20 | IS_CENTOS_6_X=`cat /etc/*-release | grep -i "centos release 6."| wc -c` 21 | PACKAGE_MANAGER="dnf" 22 | if [ $IS_CENTOS -gt 0 ]; then 23 | PACKAGE_MANAGER="yum" 24 | fi; 25 | 26 | REDHAT_RPM_CONFIG=`"$PACKAGE_MANAGER" list installed | grep "redhat-rpm-config" | wc -l` 27 | if [ $IS_SUSE -eq 0 ] && [ $REDHAT_RPM_CONFIG -eq 0 ]; then 28 | echo "Install redhat-rpm-config first!" 29 | exit -1 30 | fi; 31 | 32 | if [ $IS_CENTOS_6_X -gt 0 ]; then 33 | CENTOS_DEVTOOLS_1_1=`yum list installed | grep "devtoolset-1.1" | wc -c` 34 | if [ $CENTOS_DEVTOOLS_1_1 -eq 0 ]; then 35 | echo "Install devtools 1.1 first. CentOS 6.X needs it to compile C++ V11 code." 36 | echo "Execute: 'cd /etc/yum.repos.d;wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo';" 37 | echo "Then run: 'yum install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++'" 38 | exit -1 39 | fi; 40 | echo -e "\nIMPORTANT:\n" 41 | echo "if the build fails with a message similar to these below, execute the line 'scl enable devtoolset-1.1 bash' prior to running this script" 42 | echo "cc1plus: error: unrecognized command line option -std=c++11" 43 | echo -e "cc1plus: error: unrecognized command line option -std=gnu++11\n" 44 | fi; 45 | 46 | CURRENT_DIR=`pwd` 47 | 48 | IS_FEDORA=`cat /etc/*-release | grep -i "fedora"| wc -c` 49 | if [ $IS_CENTOS -ne 0 ] || [ $IS_FEDORA -ne 0 ]; then 50 | export IS_CENTOS_OR_FEDORA=1 51 | fi 52 | 53 | if ( [ $IS_CENTOS -ne 0 ] && [ $IS_CENTOS_6_X -eq 0 ]) || [ $IS_FEDORA -ne 0 ]; then 54 | SPEC_FILE=tissuestack_sysctl.spec 55 | export USES_SYSTEMCTL=1 56 | fi 57 | 58 | if [ $IS_SUSE -ne 0 ]; then 59 | SPEC_FILE=tissuestack_suse.spec 60 | export USES_SYSTEMCTL=1 61 | fi; 62 | 63 | PKI_BUILD=0 64 | if [ $# -ne 0 ]; then 65 | if [ "$1" == "CLIENTS" ]; then 66 | TARGET=clients 67 | SPEC_FILE=tissuestack_clients.spec 68 | else 69 | PKI_BUILD=1 70 | fi; 71 | fi; 72 | 73 | echo "Calling TissueStack make with target $TARGET" 74 | cd $CURRENT_DIR/src/c++;make $TARGET 75 | if [ $? -ne 0 ]; then 76 | echo "Build was NOT successful" 77 | exit -1 78 | fi; 79 | 80 | echo "Copying spec file and source tar" 81 | cp -f $CURRENT_DIR/rpm/$SPEC_FILE $HOME/rpmbuild/SPECS 82 | cd $HOME/rpmbuild/SPECS/ 83 | 84 | # alter the standard apache port for PKI build 85 | if [ $PKI_BUILD -ne 0 ]; then 86 | sed -i "s/APACHE_PORT=80/APACHE_PORT=$1/g" $SPEC_FILE 87 | fi 88 | 89 | echo "Calling RPM build now ..." 90 | rpmbuild -bb $SPEC_FILE 91 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | Tissue Stack is an open source web based image viewer which allows the user to 3 | view 3D data as 2D cross sections. 4 | 5 | While at its core it's modelled after GIS web mapping applications, 6 | it's intended use is for neuro-imaging. 7 | 8 | Tissue Stack aims at serving its data as image tiles which can be both pre- 9 | tiled in advance or created on the fly by extracting from the original source 10 | file. 11 | 12 | The file formats supported are Minc Toolkit files (http://bic-mni.github.io/) and nifti (http://nifti.nimh.nih.gov) 13 | 14 | The TissueStack Image Server will convert the above mentioned formats into 15 | its internal "raw" format which is a stream of bytes (incl. header) 16 | for quick and easy sequential reads. 17 | 18 | ******* 19 | 20 | A Tissue Stack Server Instance consists of the following components: 21 | 22 | 1) The WEB Front End => see src/web/README 23 | 24 | 2) A Configuration Back End => see src/c++/README 25 | 26 | 3) A Configuration Data Base => see src/sql/README 27 | 28 | 4) An Image Server for pre and on-the-fly tiling => see src/c++/README 29 | 30 | -------------------------------------------------------------------------------- /cvl/BUILD_ME_LIKE_THIS_FOR_CVL.sh: -------------------------------------------------------------------------------- 1 | clear 2 | 3 | NAME=tissuestack 4 | VERSION=2.3 5 | BUILD_DIR=/tmp/tissuestack_build 6 | DEST_PATH=${NAME^^}/$VERSION 7 | 8 | if [ `pwd | grep /usr/local/src/$DEST_PATH | wc -c` -eq 0 ]; then 9 | echo "Please copy directory contents to '/usr/local/src/$DEST_PATH' and execute this script there!" 10 | exit -1; 11 | fi 12 | 13 | tar xvzf $NAME-$VERSION-sources.tar.gz 14 | if [ $? -ne 0 ]; then 15 | echo "WARNING: $NAME-$VERSION-sources.tar.gz IS NOT PRESENT! If this is the first run of the script, the build WILL fail later on. If it isn't, you can safely ignore this message." 16 | fi 17 | 18 | echo -e "\n\n*************************************************************************************" 19 | echo -e "!!! THIS IS A CUSTOMIZED BUILD OF TISSUESTACK FOR CVL !!!" 20 | echo -e "*************************************************************************************\n\n" 21 | 22 | 23 | cd sources 24 | ./BUILD_ME_LIKE_THIS_FOR_CVL.sh 25 | if [ $? -ne 0 ]; then 26 | echo "Build aborted! Check for errors..." 27 | exit -1 28 | fi 29 | 30 | cd .. 31 | rm -rf $NAME-$VERSION-sources.tar.gz 32 | rm -rf $NAME-$VERSION-binaries.tar.gz 33 | cp $BUILD_DIR/$NAME-$VERSION.tar.gz $NAME-$VERSION-binaries.tar.gz 34 | rm -rf $BUILD_DIR 35 | -------------------------------------------------------------------------------- /cvl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Local config flag 3 | # 4 | set(${PROJECT_NAME}_LOCAL_CONFIG OFF) 5 | 6 | include(CvlSetVersion) 7 | 8 | if (${PROJECT_NAME}_LOCAL_CONFIG) 9 | # 10 | # Local configuration, using "echo" to escape a command. 11 | # 12 | # Using "echo" to escape a command. 13 | # 14 | # Download command 15 | set(${PROJECT_NAME}_DOWNLOAD_COMMAND echo) 16 | 17 | # Configure command 18 | set(${PROJECT_NAME}_CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/config ) 19 | 20 | # Build command 21 | set(${PROJECT_NAME}_BUILD_COMMAND make) 22 | 23 | # Install command 24 | set(${PROJECT_NAME}_INSTALL_COMMAND echo) 25 | 26 | endif(${PROJECT_NAME}_LOCAL_CONFIG) 27 | 28 | include(CvlBuildConfig) 29 | 30 | -------------------------------------------------------------------------------- /cvl/Test/test1: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # CVL build system. 4 | # 5 | # Test script for cdash test. Each test script should contain only one test 6 | # command. If you wish to run multiple testing commands, copy the test script 7 | # to a series of test scripts such as "test2, test3, ..." in the same 8 | # directory. 9 | # 10 | 11 | echo "CDash ctest ..." 12 | -------------------------------------------------------------------------------- /cvl/check: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # CVL build system to check or configure building process after installation. 4 | # 5 | 6 | SOURCE_DIR=$1 7 | BUILD_DIR=$2 8 | INSTALL_DIR=$3 9 | 10 | # Copy module validation script to package directory. 11 | if [ ! -f ${INSTALL_DIR}/validate_module.sh ]; then 12 | cp ${SOURCE_DIR}/validate_module.sh ${INSTALL_DIR} 13 | fi 14 | 15 | echo -e "$SOURCE_DIR\n$BUILD_DIR\n$INSTALL_DIR" > /tmp/check.txt 16 | -------------------------------------------------------------------------------- /cvl/validate_module.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script is used to verify and validate installed applications. 4 | # 5 | 6 | # Add a single test command 7 | SINGLE_TEST="echo" 8 | 9 | # Add multiple test commands 10 | function MultipleTests() 11 | { 12 | echo 13 | } 14 | 15 | case "$1" in 16 | -s|--single-test) 17 | echo -n ${SINGLE_TEST} 18 | ;; 19 | *) 20 | MultipleTests 21 | ;; 22 | esac 23 | -------------------------------------------------------------------------------- /data/colormaps/blue: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 0.0 0.0 1.0 3 | -------------------------------------------------------------------------------- /data/colormaps/bluered: -------------------------------------------------------------------------------- 1 | 0.000 0.8 0.8 1.0 2 | 0.125 0.4 0.8 1.0 3 | 0.250 0.0 0.4 1.0 4 | 0.375 0.0 0.0 0.5 5 | 0.500 0.0 0.0 0.0 6 | 0.625 0.5 0.0 0.0 7 | 0.750 1.0 0.4 0.0 8 | 0.825 1.0 0.8 0.4 9 | 1.000 1.0 0.8 0.8 10 | -------------------------------------------------------------------------------- /data/colormaps/bluered_4sd: -------------------------------------------------------------------------------- 1 | 0.000 0.8 1.0 0.8 2 | 0.100 0.4 1.0 0.8 3 | 0.200 0.0 1.0 0.4 4 | 0.300 0.0 0.5 0.0 5 | 0.400 0.0 0.0 0.0 6 | 0.500 0.0 0.0 0.0 7 | 0.600 0.0 0.0 0.0 8 | 0.700 0.5 0.0 0.0 9 | 0.800 1.0 0.4 0.0 10 | 0.900 1.0 0.8 0.4 11 | 1.000 1.0 0.8 0.8 12 | -------------------------------------------------------------------------------- /data/colormaps/cyan: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 0.0 1.0 1.0 3 | -------------------------------------------------------------------------------- /data/colormaps/green: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 0.0 1.0 0.0 3 | -------------------------------------------------------------------------------- /data/colormaps/grey: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 1.0 1.0 1.0 3 | -------------------------------------------------------------------------------- /data/colormaps/half_hotblue: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.01 0.0 0.0 0.5 3 | 0.33 0.0 0.5 1.0 4 | 0.66 0.5 1.0 1.0 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/half_hotgreen: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.01 0.0 0.5 0.0 3 | 0.33 0.0 1.0 0.5 4 | 0.66 0.5 1.0 1.0 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/half_hotred: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.01 0.5 0.0 0.0 3 | 0.33 1.0 0.0 0.5 4 | 0.66 1.0 0.5 1.0 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/hot: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.25 0.5 0.0 0.0 3 | 0.50 1.0 0.5 0.0 4 | 0.75 1.0 1.0 0.5 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/hotblue: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.25 0.0 0.0 0.5 3 | 0.50 0.0 0.5 1.0 4 | 0.75 0.5 1.0 1.0 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/hotgreen: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.25 0.0 0.5 0.0 3 | 0.50 0.0 1.0 0.5 4 | 0.75 0.5 1.0 1.0 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/hotmetal-reduced: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.33 0.5 0.0 0.0 3 | 0.66 1.0 0.5 0.0 4 | 1.00 1.0 1.0 0.5 5 | -------------------------------------------------------------------------------- /data/colormaps/hotred: -------------------------------------------------------------------------------- 1 | 0.00 0.0 0.0 0.0 2 | 0.25 0.5 0.0 0.0 3 | 0.50 1.0 0.0 0.5 4 | 0.75 1.0 0.5 1.0 5 | 1.00 1.0 1.0 1.0 6 | -------------------------------------------------------------------------------- /data/colormaps/magenta: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 1.0 0.0 1.0 3 | -------------------------------------------------------------------------------- /data/colormaps/phase: -------------------------------------------------------------------------------- 1 | 0.0000 0.554296875 0.941015625 0.9796875 2 | 0.0625 0.6359375 0.855078125 0.98828125 3 | 0.1250 0.6875 0.769140625 0.9625 4 | 0.1875 0.78203125 0.71328125 0.98828125 5 | 0.2500 0.83359375 0.623046875 0.9625 6 | 0.3125 0.91953125 0.562890625 0.992578125 7 | 0.3750 0.983984375 0.6359375 0.928125 8 | 0.4375 0.9625 0.61875 0.9109375 9 | 0.5000 0.9625 0.69609375 0.837890625 10 | 0.5625 0.9625 0.7734375 0.769140625 11 | 0.6250 0.9625 0.8421875 0.691796875 12 | 0.6875 0.966796875 0.91953125 0.623046875 13 | 0.7500 0.906640625 0.97109375 0.61875 14 | 0.8125 0.837890625 0.966796875 0.691796875 15 | 0.8750 0.7734375 0.966796875 0.76484375 16 | 0.9375 0.6875 0.97109375 0.83359375 17 | 1.0000 0.61875 0.97109375 0.90234375 18 | -------------------------------------------------------------------------------- /data/colormaps/pt_blue: -------------------------------------------------------------------------------- 1 | 0.00 0.0000 0.0000 0.0000 2 | 0.01 0.1992 0.2988 0.5000 3 | 1.00 0.3984 0.5976 1.0000 4 | -------------------------------------------------------------------------------- /data/colormaps/pt_green: -------------------------------------------------------------------------------- 1 | 0.00 0.0000 0.0000 0.0000 2 | 0.01 0.1992 0.3984 0.0000 3 | 1.00 0.3984 0.7968 0.0000 4 | -------------------------------------------------------------------------------- /data/colormaps/pt_red: -------------------------------------------------------------------------------- 1 | 0.00 0.0000 0.0000 0.0000 2 | 0.01 0.3984 0.0996 0.2988 3 | 1.00 0.7968 0.1992 0.5976 4 | -------------------------------------------------------------------------------- /data/colormaps/rainbow: -------------------------------------------------------------------------------- 1 | 0.00 0.0000 0.0000 0.0000 2 | 0.01 1.0000 0.0000 0.0000 3 | 0.25 1.0000 1.0000 0.0000 4 | 0.50 0.0000 1.0000 0.0000 5 | 0.75 0.0000 0.0000 1.0000 6 | 1.00 1.0000 0.0000 1.0000 7 | -------------------------------------------------------------------------------- /data/colormaps/red: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 1.0 0.0 0.0 3 | -------------------------------------------------------------------------------- /data/colormaps/spectral: -------------------------------------------------------------------------------- 1 | 0.00 0.0000 0.0000 0.0000 2 | 0.05 0.4667 0.0000 0.5333 3 | 0.10 0.5333 0.0000 0.6000 4 | 0.15 0.0000 0.0000 0.6667 5 | 0.20 0.0000 0.0000 0.8667 6 | 0.25 0.0000 0.4667 0.8667 7 | 0.30 0.0000 0.6000 0.8667 8 | 0.35 0.0000 0.6667 0.6667 9 | 0.40 0.0000 0.6667 0.5333 10 | 0.45 0.0000 0.6000 0.0000 11 | 0.50 0.0000 0.7333 0.0000 12 | 0.55 0.0000 0.8667 0.0000 13 | 0.60 0.0000 1.0000 0.0000 14 | 0.65 0.7333 1.0000 0.0000 15 | 0.70 0.9333 0.9333 0.0000 16 | 0.75 1.0000 0.8000 0.0000 17 | 0.80 1.0000 0.6000 0.0000 18 | 0.85 1.0000 0.0000 0.0000 19 | 0.90 0.8667 0.0000 0.0000 20 | 0.95 0.8000 0.0000 0.0000 21 | 1.00 0.8000 0.8000 0.8000 22 | -------------------------------------------------------------------------------- /data/colormaps/yellow: -------------------------------------------------------------------------------- 1 | 0.0 0.0 0.0 0.0 2 | 1.0 1.0 1.0 0.0 3 | -------------------------------------------------------------------------------- /data/labels/rgb-to-index.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 0 Black (Background) 2 | 1 191 184 121 aca 3 | 2 214 141 149 acp 4 | 3 152 107 122 AI 5 | 4 112 193 179 AID 6 | 5 219 109 194 AIP 7 | 6 150 215 224 AIV 8 | 7 220 191 140 Au1 9 | 8 118 122 110 Au 10 | 9 173 165 190 AuD 11 | 10 153 112 189 AuV 12 | 11 115 160 166 cc/ec 13 | 12 150 129 163 CEnt 14 | 13 180 106 159 cg 15 | 14 116 107 219 Cg1 16 | 15 106 114 188 Cg2 17 | 16 199 175 200 Cl 18 | 17 185 171 221 CxA 19 | 18 211 156 205 DCl 20 | 19 201 202 152 DEn 21 | 20 166 109 107 df 22 | 21 179 148 221 dhc 23 | 22 147 159 108 DIEnt 24 | 23 186 150 118 DLEnt 25 | 24 105 101 208 DLO 26 | 25 104 184 139 DP 27 | 26 225 173 160 DS 28 | 27 124 104 99 DTr 29 | 28 198 189 174 DTT 30 | 29 193 223 190 Ect 31 | 30 224 117 223 fmi 32 | 31 181 172 186 Fr3 33 | 32 124 204 208 FrA 34 | 33 124 121 124 IEn 35 | 34 188 119 122 IL 36 | 35 205 163 146 Ins 37 | 36 132 205 205 LO 38 | 37 106 187 213 lo 39 | 38 205 141 119 LPtA 40 | 39 219 193 152 M1 41 | 40 177 218 169 M2 42 | 41 154 196 151 MEnt 43 | 42 167 136 117 MO 44 | 43 176 143 198 MPtA 45 | 44 119 134 188 PaS 46 | 45 213 190 147 Pir 47 | 46 210 160 154 Post 48 | 47 155 125 113 PRh 49 | 48 167 105 134 PrL 50 | 49 193 118 186 PrS 51 | 50 180 119 189 PtPR 52 | 51 188 148 195 RAPir 53 | 52 204 225 152 RSD 54 | 53 152 216 222 RSGa 55 | 54 198 133 130 RSGb 56 | 55 109 112 185 RSGc 57 | 56 191 151 132 S1 58 | 57 126 223 208 S1BF 59 | 58 190 193 172 S1DZ 60 | 59 115 108 212 S1FL 61 | 60 215 171 143 S1HL 62 | 61 144 146 209 S1J 63 | 62 191 162 204 S1Sh 64 | 63 183 191 178 S1Tr 65 | 64 112 187 134 S1ULp 66 | 65 225 145 121 S2 67 | 66 151 153 180 STr 68 | 67 118 142 153 TeA 69 | 68 166 165 188 V1 70 | 69 180 120 182 V1B 71 | 70 163 156 203 V1M 72 | 71 218 211 183 V2L 73 | 72 171 217 205 V2ML 74 | 73 163 110 216 V2MM 75 | 74 188 144 204 VCl 76 | 75 202 129 140 VEn 77 | 76 225 214 114 VIEnt 78 | 77 169 162 218 VO 79 | 78 115 131 122 VTT 80 | 79 255 255 255 White (White) 81 | -------------------------------------------------------------------------------- /data/labels/test.labels: -------------------------------------------------------------------------------- 1 | 0 0 0 0 Black (Background) 2 | 1 165 83 0 Middle of Brain 3 | 2 197 197 99 yellow (hot) 4 | 3 198 198 99 yellow (hot) 5 | 4 199 199 100 yellow (hot) 6 | 5 195 195 98 yellow (hot) 7 | 6 194 194 97 yellow (hot) 8 | 7 170 170 0 middle of brain (spectral) 9 | 8 172 172 0 middle of brain (spectral 10 | 9 171 171 0 middle of brain (spectral 11 | 10 175 175 0 middle of brain (spectral) 12 | 11 177 177 0 middle of brain (spectral) 13 | 12 174 174 0 middle of brain (spectral) 14 | 13 168 168 0 middle of brain (spectral) 15 | 14 173 173 0 middle of brain (spectral) 16 | 15 1 1 1 Black (Background) 17 | 16 2 2 2 Black (Background) 18 | 17 3 3 3 Black (Background) 19 | 18 4 4 4 Black (Background) 20 | 19 5 5 5 Black (Background) 21 | 20 6 6 6 Black (Background) 22 | 21 7 7 7 Black (Background) 23 | 22 181 91 0 Center 24 | 23 181 181 181 Center 25 | 24 169 169 0 Center 26 | 25 179 179 179 Center 27 | 26 179 90 0 Center 28 | 27 167 167 0 Center 29 | -------------------------------------------------------------------------------- /deb/clients/changelog: -------------------------------------------------------------------------------- 1 | tissuestack-clients (2.3) stable; urgency=low 2 | 3 | * VERSION 2.3 4 | 5 | -- tissuestack Thu, 4 Aug 2016 10:40:15 +1000 6 | 7 | tissuestack-clients (2.2) stable; urgency=low 8 | 9 | * VERSION 2.2 10 | 11 | -- tissuestack Thu, 7 Jul 2016 14:56:11 +1000 12 | -------------------------------------------------------------------------------- /deb/clients/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /deb/clients/control: -------------------------------------------------------------------------------- 1 | Source: tissuestack-clients 2 | Section: graphics 3 | Priority: extra 4 | Maintainer: Tissue Stack 5 | Build-Depends: debhelper (>= 7.5.0), libminc-dev, libnifti-dev, libgraphicsmagick-dev, libglib2.0-dev, libc6-dev 6 | Standards-Version: 3.9.3 7 | Homepage: http://tissuestack.com 8 | 9 | Package: tissuestack-clients 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: Tissue Stack Clients 13 | -------------------------------------------------------------------------------- /deb/clients/install: -------------------------------------------------------------------------------- 1 | install_files/etc/profile.d/tissuestack_clients_env.sh etc/profile.d 2 | install_files/usr/local/tissuestack/* usr/local/tissuestack 3 | -------------------------------------------------------------------------------- /deb/clients/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | override_dh_auto_build: 16 | mkdir install_files 17 | cd install_files; tar xvzf /tmp/tissuestack_build/tissuestack-clients-${TISSUESTACK_BUILD_VERSION}.tar.gz 18 | 19 | override_dh_auto_install: 20 | 21 | override_dh_usrlocal: 22 | 23 | override_dh_shlibdeps: 24 | dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info 25 | -------------------------------------------------------------------------------- /deb/clients/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /deb/server/changelog: -------------------------------------------------------------------------------- 1 | tissuestack (2.3) stable; urgency=low 2 | 3 | * VERSION 2.3 4 | 5 | -- tissuestack Thu, 4 Aug 2016 11:15:22 +1000 6 | 7 | tissuestack (2.2) stable; urgency=low 8 | 9 | * VERSION 2.2 10 | 11 | -- tissuestack Thu, 7 Jul 2016 14:56:11 +1000 12 | 13 | tissuestack (2.1) stable; urgency=low 14 | 15 | * VERSION 2.1 16 | 17 | -- Harald Waxenegger Thu, 18 Jun 2015 14:33:11 +1000 18 | 19 | tissuestack (2.0) stable; urgency=low 20 | 21 | * VERSION 2.0 22 | 23 | -- Harald Waxenegger Mon, 04 May 2015 6:22:16 +1000 24 | 25 | tissuestack (1.9) stable; urgency=low 26 | 27 | * VERSION 1.9 28 | 29 | -- Harald Waxenegger Fri, 06 Mar 2015 7:52:46 +1000 30 | 31 | tissuestack (1.8) stable; urgency=low 32 | 33 | * VERSION 1.8 34 | 35 | -- Harald Waxenegger Tue, 17 Feb 2015 10:12:36 +1000 36 | 37 | tissuestack (1.7) stable; urgency=low 38 | 39 | * VERSION 1.7 40 | 41 | -- Harald Waxenegger Tue, 23 Dec 2014 9:57:15 +1000 42 | 43 | tissuestack (1.6) stable; urgency=low 44 | 45 | * VERSION 1.6 46 | 47 | -- Harald Waxenegger Mon, 03 Nov 2014 10:20:31 +1000 48 | 49 | tissuestack (1.5) stable; urgency=low 50 | 51 | * VERSION 1.5 52 | 53 | -- Harald Waxenegger Mon, 29 Sep 2014 15:42:45 +1000 54 | 55 | tissuestack (1.4) stable; urgency=low 56 | 57 | * new VERSION 1.4 58 | 59 | -- Harald Waxenegger Fri, 11 Apr 2014 15:42:45 +1000 60 | 61 | tissuestack (1.3) stable; urgency=low 62 | 63 | * new VERSION 1.3 64 | 65 | -- Harald Waxenegger Thu, 17 Oct 2013 14:51:21 +1000 66 | 67 | tissuestack (1.2) stable; urgency=low 68 | 69 | * new VERSION 1.2 70 | 71 | -- Harald Waxenegger Mon, 26 Aug 2013 16:28:44 +1000 72 | 73 | tissuestack (1.1) stable; urgency=low 74 | 75 | * Initial release (Closes: #nnnn) 76 | 77 | -- Harald Waxenegger Mon, 25 Feb 2013 10:41:33 +1000 78 | -------------------------------------------------------------------------------- /deb/server/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /deb/server/control: -------------------------------------------------------------------------------- 1 | Source: tissuestack 2 | Section: graphics 3 | Priority: extra 4 | Maintainer: Tissue Stack 5 | Build-Depends: debhelper (>= 7.5.0), libminc-dev, libnifti-dev, libgraphicsmagick-dev, libglib2.0-dev, libc6-dev 6 | Standards-Version: 3.9.3 7 | Homepage: http://tissuestack.com 8 | 9 | Package: tissuestack 10 | Architecture: any 11 | Pre-Depends: apache2, postgresql 12 | Depends: ${shlibs:Depends}, ${misc:Depends} 13 | Description: Tissue Stack is an open source web based image viewer which allows the user to view 3D data as 2D cross sections. While at its core it's modelled after GIS web mapping applications, it's intended use is for neuro-imaging. Tissue Stack aims at serving its data as image tiles which can be both pre-tiled in advance or created on the fly by extracting from the original source file. The used file formats will be anything that is supported by the MINC Tool Kit (http://www.bic.mni.mcgill.ca/ServicesSoftware/ServicesSoftwareMincToolKit) as well as the nifti format(http://nifti.nimh.nih.gov/). 14 | -------------------------------------------------------------------------------- /deb/server/install: -------------------------------------------------------------------------------- 1 | install_files/etc/profile.d/tissuestack_env.sh etc/profile.d 2 | install_files/usr/local/tissuestack/* usr/local/tissuestack 3 | install_files/opt/tissuestack/* opt/tissuestack 4 | -------------------------------------------------------------------------------- /deb/server/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | override_dh_auto_build: 16 | mkdir install_files 17 | cd install_files; tar xvzf /tmp/tissuestack_build/tissuestack-${TISSUESTACK_BUILD_VERSION}.tar.gz 18 | 19 | override_dh_auto_install: 20 | mv install_files/post-install.sh debian/postinst 21 | mv install_files/pre-install.sh debian/preinst 22 | mv install_files/pre-uninstall.sh debian/prerm 23 | mv install_files/post-uninstall.sh debian/postrm 24 | 25 | override_dh_usrlocal: 26 | 27 | override_dh_shlibdeps: 28 | dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info 29 | -------------------------------------------------------------------------------- /deb/server/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # docker compose 2 | 3 | ## Create .env file 4 | 5 | Copy default.env into .env and update parameters 6 | ``` 7 | cd docker 8 | cp default.env .env 9 | # Modify .env here 10 | ``` 11 | 12 | ## docker compose build 13 | 14 | ``` 15 | docker compose down 16 | docker compose build 17 | docker compose up -d 18 | ``` 19 | 20 | ## Initialise database (new database only) 21 | 22 | Wait for `container for service "tissuestack-db" is unhealthy` 23 | 24 | Shell into tissuestack-db container 25 | ``` 26 | docker compose exec tissuestack-db /bin/bash 27 | cd /sql 28 | bash init-db.sh 29 | ``` 30 | 31 | Restart docker containers 32 | 33 | ## Initialise tissuestack data 34 | Copy src/web into ${TISSUESTACK_DATA_DIR} 35 | -------------------------------------------------------------------------------- /docker/default.env: -------------------------------------------------------------------------------- 1 | POSTGRES_PASSWORD=postgres 2 | POSTGRES_DATA_DIR=/opt/tissuestack/tissuestack-db 3 | TISSUESTACK_DATA_DIR=/opt/tissuestack/tissuestack-data -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | tissuestack-server: 4 | restart: always 5 | image: tissuestack-server 6 | build: 7 | context: ../ 8 | dockerfile: ./docker/tissuestack.Dockerfile 9 | # ports: 10 | # - 4242:4242 11 | depends_on: 12 | tissuestack-db: 13 | condition: service_healthy 14 | network_mode: "host" 15 | volumes: 16 | - ${TISSUESTACK_DATA_DIR}:/opt/tissuestack 17 | 18 | tissuestack-db: 19 | restart: always 20 | image: tissuestack-db 21 | build: 22 | context: ../ 23 | dockerfile: ./docker/postgres.Dockerfile 24 | ports: 25 | - 5432:5432 26 | environment: 27 | POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} 28 | volumes: 29 | - ${POSTGRES_DATA_DIR}:/var/lib/postgresql/data 30 | healthcheck: 31 | test: ["CMD-SHELL", "sh -c 'psql -U tissuestack -d tissuestack'"] 32 | interval: 1s 33 | timeout: 3s 34 | retries: 3 35 | -------------------------------------------------------------------------------- /docker/init-db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | psql -U postgres -a -f create_tissuestack_db.sql 5 | psql -U tissuestack -d tissuestack -a -f create_tissuestack_tables.sql 6 | psql -U tissuestack -d tissuestack -a -f create_tissuestack_config.sql 7 | # psql -U tissuestack -d tissuestack -a -f patches.sql 8 | -------------------------------------------------------------------------------- /docker/postgres.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:8.4.22 2 | 3 | COPY ./src/sql /sql 4 | COPY ./docker/init-db.sh /sql/init-db.sh 5 | -------------------------------------------------------------------------------- /docker/tissuestack.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | RUN apt-get update 4 | RUN apt-get -y install make 5 | RUN apt-get -y install g++ 6 | RUN apt-get -y install libgraphicsmagick1-dev 7 | RUN apt-get -y install uuid-dev 8 | RUN apt-get -y install libzip-dev 9 | RUN apt-get -y install libnifti-dev 10 | RUN apt-get -y install libminc-dev 11 | RUN apt-get -y install libpqxx-dev 12 | RUN apt-get -y install libdcmtk-dev 13 | 14 | RUN mkdir -p /src 15 | COPY ./src/c++ /src/c++ 16 | 17 | WORKDIR /src/c++ 18 | 19 | RUN make && make compile && make install 20 | 21 | CMD /usr/local/tissuestack/2.3/bin/TissueStackServer 22 | -------------------------------------------------------------------------------- /jars/TS_CL_Tool.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/jars/TS_CL_Tool.jar -------------------------------------------------------------------------------- /jars/TissueStackBioFormatsConverter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/jars/TissueStackBioFormatsConverter.jar -------------------------------------------------------------------------------- /jars/bioformats-5.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/jars/bioformats-5.1.1.jar -------------------------------------------------------------------------------- /packaging/BioFormats2TissueStackConverter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | let arg_num="$#"+0 3 | if [ $arg_num -lt 2 ]; then 4 | echo "" 5 | echo "Error: we didn't receive a minimum of 2 arguments as input!!!" 6 | echo "USAGE: BioFormats2TissueStackConverter input.format output.raw [optional: temporary dir] [optional: avoid 3D reconstr. (false/true)]" 7 | echo "" 8 | exit -1 9 | fi 10 | 11 | #for cvl 12 | source /opt/tissuestack/conf/tissuestack_modules.sh 2> /dev/null 13 | source $TISSUE_STACK_ENV 2> /dev/null 14 | 15 | java -Xmx1024m -cp $TISSUE_STACK_JARS/bioformats-5.1.1.jar:$TISSUE_STACK_JARS/TissueStackBioFormatsConverter.jar au.edu.cai.TissueStackBioFormatsConverter $1 $2 $3 $4 16 | -------------------------------------------------------------------------------- /packaging/post-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f /tmp/post-install.log 3 | touch /tmp/post-install.log 4 | chmod 666 /tmp/post-install.log 5 | useradd -c "tissuestack" -m -d /opt/tissuestack -s /bin/bash -U tissuestack &>> /tmp/post-install.log 6 | chown tissuestack:tissuestack /opt/tissuestack &>> /tmp/post-install.log 7 | chown tissuestack:tissuestack /opt/tissuestack &>> /tmp/post-install.log 8 | for dirs in `find /opt/tissuestack/* -prune -type d`;do 9 | if [ $dirs = "/opt/tissuestack/tiles" ]; then 10 | chown tissuestack:tissuestack $dirs &>> /tmp/post-install.log 11 | else 12 | chown -R tissuestack:tissuestack $dirs &>> /tmp/post-install.log 13 | chown -R -H -h tissuestack:tissuestack $dirs &>> /tmp/post-install.log 14 | fi 15 | done 16 | service postgresql start &>> /tmp/post-install.log 17 | sleep 5s 18 | sudo su - postgres <> /tmp/post-install.log 20 | psql -f /opt/tissuestack/sql/create_tissuestack_tables.sql tissuestack &>> /tmp/post-install.log 21 | psql -f /opt/tissuestack/sql/patches.sql tissuestack &>> /tmp/post-install.log 22 | psql -f /opt/tissuestack/sql/create_tissuestack_config.sql tissuestack &>> /tmp/post-install.log 23 | psql -f /opt/tissuestack/sql/update_tissuestack_config.sql tissuestack &>> /tmp/post-install.log 24 | EOF 25 | echo "/opt/tissuestack" > /tmp/escaped.string 26 | sed -i 's/\//\\\//g' /tmp/escaped.string &>> /tmp/post-install.log 27 | ESCAPED_STRING=`cat /tmp/escaped.string` &>> /tmp/post-install.log 28 | cp -f /opt/tissuestack/conf/tissuestack.conf /etc/apache2/sites-available/tissuestack.conf &>> /tmp/post-install.log 29 | sed -i "s/##DOC_ROOT##/$ESCAPED_STRING\/web/g" /etc/apache2/sites-available/tissuestack.conf &>> /tmp/post-install.log 30 | sed -i 's/##ERROR_LOG##/\/var\/log\/apache2\/tissuestack-error.log/g' /etc/apache2/sites-available/tissuestack.conf &>> /tmp/post-install.log 31 | APACHE_VERSION=`apache2 -v | grep "Apache/" | cut -f2 -d "/" | cut -f1 -d " " | cut -f1,2 -d "." | sed 's/\.//g'` &>> /tmp/post-install.log 32 | if [ $APACHE_VERSION -gt 23 ]; then sed -i 's/#Require all granted/Require all granted/g' /etc/apache2/sites-available/tissuestack.conf; fi &>> /tmp/post-install.log 33 | a2ensite tissuestack.conf &>> /tmp/post-install.log 34 | a2dissite 000-default &>> /tmp/post-install.log 35 | a2enmod headers proxy proxy_http &>> /tmp/post-install.log 36 | /etc/init.d/apache2 restart &>> /tmp/post-install.log 37 | if [ `iptables -S | grep -e "-A INPUT -i lo -j ACCEPT" | wc -c` -eq 0 ]; then 38 | iptables -I INPUT 1 -i lo -p all -j ACCEPT &>> /tmp/post-install.log 39 | fi 40 | if [ `iptables -S | grep -e "-A INPUT -p tcp -m tcp --dport 4242 -j DROP" | wc -c` -eq 0 ]; then 41 | iptables -A INPUT -p tcp --destination-port 4242 -j DROP &>> /tmp/post-install.log 42 | fi 43 | if [ `iptables -S | grep -e "-A INPUT -p tcp -m tcp --dport 5432 -j DROP" | wc -c` -eq 0 ]; then 44 | iptables -A INPUT -p tcp --destination-port 5432 -j DROP &>> /tmp/post-install.log 45 | fi 46 | iptables-save &>> /tmp/post-install.log 47 | cp -f /opt/tissuestack/conf/tissuestack_init.sh /etc/init.d/tissuestack &>> /tmp/post-install.log 48 | chmod 755 /etc/init.d/tissuestack &>> /tmp/post-install.log 49 | cd /etc/init.d; update-rc.d tissuestack defaults &>> /tmp/post-install.log 50 | /etc/init.d/tissuestack start &>> /tmp/post-install.log 51 | exit 0 52 | -------------------------------------------------------------------------------- /packaging/post-uninstall-cvl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ $1 -ne 1 ]; then 3 | chkconfig --del tissuestack &>> /tmp/uninstall.log 4 | rm -rf /etc/init.d/tissuestack &>> /tmp/uninstall.log 5 | rm -rf /etc/profile.d/tissuestack_modules.sh &>> /tmp/uninstall.log 6 | rm -rf /etc/httpd/conf.d/tissuestack.conf &>> /tmp/uninstall.log 7 | mv /etc/httpd/conf.d/welcome.conf.disabled /etc/httpd/conf.d/welcome.conf &>> /tmp/uninstall.log 8 | rm -rf /tmp/tissue_stack_communication &>> /tmp/uninstall.log 9 | service httpd restart &>> /tmp/uninstall.log 10 | fi 11 | /sbin/ldconfig 12 | exit 0 13 | -------------------------------------------------------------------------------- /packaging/post-uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -z "$2" ]; then 3 | rm -rf /etc/init.d/tissuestack &>> /tmp/uninstall.log 4 | cd /etc/init.d; update-rc.d -f tissuestack remove &>> /tmp/uninstall.log 5 | a2dissite tissuestack.conf &>> /tmp/uninstall.log 6 | a2ensite 000-default &>> /tmp/uninstall.log 7 | /etc/init.d/apache2 restart &>> /tmp/uninstall.log 8 | fi 9 | exit 0 10 | -------------------------------------------------------------------------------- /packaging/pre-install-cvl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f /tmp/pre-install.log 3 | touch /tmp/pre-install.log 4 | chmod 666 /tmp/pre-install.log 5 | /etc/init.d/tissuestack stop &>> /tmp/pre-install.log 6 | service httpd stop &>> /tmp/uninstall.log 7 | #clean directories that don't contain user data 8 | rm -rf /etc/profile.d/tissuestack_modules.sh &>> /tmp/pre-install.log 9 | rm -rf /opt/tissuestack/web/* &>> /tmp/pre-install.log 10 | rm -rf /opt/tissuestack/sql &>> /tmp/pre-install.log 11 | rm -rf /opt/tissuestack/conf &>> /tmp/pre-install.log 12 | exit 0 13 | -------------------------------------------------------------------------------- /packaging/pre-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f /tmp/pre-install.log 3 | touch /tmp/pre-install.log 4 | chmod 666 /tmp/pre-install.log 5 | /etc/init.d/tissuestack stop &>> /tmp/pre-install.log 6 | /etc/init.d/apache2 stop &>> /tmp/pre-install.log 7 | #clean directories that don't contain user data 8 | rm -rf /opt/tissuestack/web/* &>> /tmp/pre-install.log 9 | rm -rf /opt/tissuestack/sql &>> /tmp/pre-install.log 10 | rm -rf /opt/tissuestack/conf &>> /tmp/pre-install.log 11 | exit 0 12 | -------------------------------------------------------------------------------- /packaging/pre-uninstall-cvl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f /tmp/uninstall.log 3 | touch /tmp/uninstall.log 4 | chmod 666 /tmp/uninstall.log 5 | if [ $1 -ne 1 ]; then 6 | /etc/init.d/tissuestack stop &>> /tmp/uninstall.log 7 | fi 8 | exit 0 9 | -------------------------------------------------------------------------------- /packaging/pre-uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f /tmp/uninstall.log 3 | touch /tmp/uninstall.log 4 | chmod 666 /tmp/uninstall.log 5 | if [ -z "$2" ]; then 6 | /etc/init.d/tissuestack stop &>> /tmp/uninstall.log 7 | fi 8 | exit 0 9 | -------------------------------------------------------------------------------- /packaging/tissuestack-httpd.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerAdmin tissuestack@localhost 3 | 4 | DocumentRoot ##DOC_ROOT## 5 | 6 | Header set Access-Control-Allow-Origin "*" 7 | 8 | ProxyPass /server http://localhost:4242 9 | 10 | 11 | Options FollowSymLinks 12 | AllowOverride None 13 | Order Deny,Allow 14 | Allow from all 15 | #Require all granted 16 | 17 | 18 | ErrorLog ##ERROR_LOG## 19 | 20 | # Possible values include: debug, info, notice, warn, error, crit, 21 | # alert, emerg. 22 | LogLevel error 23 | 24 | -------------------------------------------------------------------------------- /packaging/tissuestack.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=TissueStack Image Server 3 | After=network.target postgresql.service 4 | 5 | [Service] 6 | Type=simple 7 | User=tissuestack 8 | ExecStart=##TS_BIN_DIR##/tissuestack start 9 | ExecReload=##TS_BIN_DIR##/tissuestack restart 10 | ExecStop=##TS_BIN_DIR##/tissuestack stop 11 | Restart=always 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /packaging/tissuestack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # load some environment variables 4 | if [ -a /etc/profile.d/tissuestack_env.sh ]; then 5 | source /etc/profile.d/tissuestack_env.sh 6 | else 7 | if [ "$TISSUE_STACK_ENV" != "" ];then 8 | source $TISSUE_STACK_ENV 9 | else 10 | echo "ERROR: You are missing environment variables!!" 11 | exit -1 12 | fi 13 | fi 14 | 15 | # actual script 16 | SHUTDOWN_TRIES=10 17 | EVERYTHING_IS_DOWN=false 18 | PROCESSES=(TissueStackServer) 19 | PROCESS_COUNT=${#PROCESSES[*]} 20 | FIRST_ARGUMENT=none 21 | SECOND_ARGUMENT=none 22 | 23 | if [ $# -gt 0 ] && [[ $1 -eq "start" || $1 -eq "stop" || $1 -eq "restart" ]]; then 24 | FIRST_ARGUMENT=$1 25 | else 26 | echo -e "No/invalid command line argument given, falling back onto default: 'restart'. Other options are 'start' and 'stop'" 27 | FIRST_ARGUMENT="restart" 28 | fi 29 | 30 | if [ $# -gt 1 ] && [ $2 == "force" ]; then 31 | SECOND_ARGUMENT=$2 32 | fi 33 | 34 | while [ $SHUTDOWN_TRIES -gt 0 ] && [ $EVERYTHING_IS_DOWN == false ]; do 35 | echo -e "Checking for running TissueStack components...\n" 36 | for i in ${PROCESSES[*]}; do 37 | PID_OF_PROCESS=`pgrep -f $i` 38 | if [ "$PID_OF_PROCESS" != "" ]; then 39 | echo "$PID_OF_PROCESS ($i) is running. Shutting it down now... Number of global retries left: $SHUTDOWN_TRIES" 40 | if [ $SECOND_ARGUMENT == "force" ]; then 41 | kill -9 $PID_OF_PROCESS 42 | else 43 | kill $PID_OF_PROCESS 44 | fi 45 | (( SHUTDOWN_TRIES -= 1 )) 46 | sleep 5 47 | else 48 | (( PROCESS_COUNT -= 1 )) 49 | fi 50 | done 51 | if [ $PROCESS_COUNT -eq 0 ] || [ $PROCESS_COUNT -lt 0 ] ; then 52 | EVERYTHING_IS_DOWN=true 53 | fi 54 | done 55 | 56 | echo -e "\nEverything's down!" 57 | 58 | if [ $FIRST_ARGUMENT == "stop" ]; then 59 | exit 1 60 | fi 61 | 62 | echo -e "\nNow start everything again ... (Check following output for errors during during Tissue Stack startup!!) \n" 63 | 64 | $IMAGE_SERVER_EXE & 65 | if [ $! -lt 1 ]; then exit -1;fi 66 | 67 | exit 1 -------------------------------------------------------------------------------- /packaging/tissuestack_deb_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: tissuestack 4 | # Required-Start: $remote_fs $syslog 5 | # Required-Stop: $remote_fs $syslog 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: tissueStack init script 9 | # Description: tissueStack rudimentary init script (delegating to .../bin/tissuestack where the path depends on the install path). 10 | ### END INIT INFO 11 | 12 | 13 | start () { 14 | echo -n "Starting Tissuestack..." 15 | su -c 'echo "Starting Tissuestack..." >> /tmp/messages;. /etc/profile.d/tissuestack_env.sh >> /tmp/messages;tissuestack start >> /tmp/messages' tissuestack >> /var/log/messages 16 | if [ $? -eq 1 ]; then 17 | echo "OK"; echo "TissueStack started." >> /var/log/syslog 18 | else 19 | echo "FAILED";echo "Failed to start TissueStack." >> /var/log/syslog 20 | return -1; 21 | fi; 22 | touch /var/lock/tissuestack >> /var/log/syslog 23 | return 0 24 | } 25 | 26 | stop () { 27 | echo -n "Stopping Tissuestack..." 28 | echo "Stopping Tissuestack..." >> /var/log/syslog 29 | . /etc/profile.d/tissuestack_env.sh 30 | tissuestack stop >> /var/log/syslog 31 | if [ $? -eq 1 ]; then 32 | echo "OK"; echo "TissueStack stopped." >> /var/log/syslog 33 | else 34 | echo "FAILED";echo "Failed to stop TissueStack." >> /var/log/syslog 35 | return -1; 36 | fi; 37 | rm -rf /var/lock/tissuestack >> /var/log/syslog 38 | return 0; 39 | } 40 | 41 | case "$1" in 42 | start) 43 | start 44 | ;; 45 | stop) 46 | stop 47 | ;; 48 | restart) 49 | stop 50 | start 51 | ;; 52 | *) 53 | echo $"Usage: $0 {start|stop|restart}" 54 | esac -------------------------------------------------------------------------------- /packaging/tissuestack_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # chkconfig: 345 70 30 4 | # description: TissueStack rudimentary init script (delegating to .../bin/tissuestack where the path depends on the install path) 5 | # processname: tissuestack 6 | 7 | 8 | start () { 9 | echo -n "Starting Tissuestack..." 10 | su -c 'echo "Starting Tissuestack..." >> /tmp/messages;. /etc/profile.d/tissuestack_env.sh >> /tmp/messages;tissuestack start >> /tmp/messages' tissuestack >> /var/log/messages 11 | if [ $? -eq 1 ]; then 12 | echo "OK"; echo "TissueStack started." >> /var/log/messages 13 | else 14 | echo "FAILED";echo "Failed to start TissueStack." >> /var/log/messages 15 | return -1; 16 | fi; 17 | touch /var/lock/subsys/tissuestack >> /var/log/messages 18 | return 0 19 | } 20 | 21 | stop () { 22 | echo -n "Stopping Tissuestack..." 23 | echo "Stopping Tissuestack..." >> /var/log/messages 24 | source /etc/profile.d/tissuestack_env.sh 25 | tissuestack stop >> /var/log/messages 26 | if [ $? -eq 1 ]; then 27 | echo "OK"; echo "TissueStack stopped." >> /var/log/messages 28 | else 29 | echo "FAILED";echo "Failed to stop TissueStack." >> /var/log/messages 30 | return -1; 31 | fi; 32 | rm -rf /var/lock/subsys/tissuestack >> /var/log/messages 33 | return 0; 34 | } 35 | 36 | case "$1" in 37 | start) 38 | start 39 | ;; 40 | stop) 41 | stop 42 | ;; 43 | restart) 44 | stop 45 | start 46 | ;; 47 | *) 48 | echo $"Usage: $0 {start|stop|restart}" 49 | esac -------------------------------------------------------------------------------- /packaging/tissuestack_modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /etc/profile.d/modules.sh 3 | 4 | module load gcc 2> /dev/null 5 | module load tissuestack/2.3 6 | -------------------------------------------------------------------------------- /packaging/tissuestack_rpm_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # chkconfig: 345 70 30 4 | # description: TissueStack rudimentary init script (delegating to .../bin/tissuestack where the path depends on the install path) 5 | # processname: tissuestack 6 | 7 | start () { 8 | echo -n "Starting Tissuestack..." 9 | if [ `mount | grep /mnt | wc -c` -eq 0 ]; then 10 | mount /mnt 11 | fi 12 | if [ -d "/mnt/tissuestack/data" ]; then 13 | su -c 'mkdir -p /mnt/tissuestack/data >> /tmp/messages' tissuestack 14 | fi 15 | if [ -d "/mnt/tissuestack/upload" ]; then 16 | su -c 'mkdir -p /mnt/tissuestack/upload >> /tmp/messages' tissuestack 17 | fi 18 | if [ -d "/mnt/tissuestack/tiles" ]; then 19 | su -c 'mkdir -p /mnt/tissuestack/tiles >> /tmp/messages' tissuestack 20 | fi 21 | su -c 'echo "Starting Tissuestack..." >> /tmp/messages;. /etc/profile.d/modules.sh >> /tmp/messages;. /opt/tissuestack/conf/tissuestack_modules.sh >> /tmp/messages;tissuestack start >> /tmp/messages' tissuestack >> /var/log/messages 22 | if [ $? -eq 1 ]; then 23 | echo "OK"; echo "TissueStack started." >> /var/log/messages 24 | else 25 | echo "FAILED";echo "Failed to start TissueStack." >> /var/log/messages 26 | return -1; 27 | fi; 28 | touch /var/lock/subsys/tissuestack >> /var/log/messages 29 | return 0 30 | } 31 | 32 | stop () { 33 | echo -n "Stopping Tissuestack..." 34 | echo "Stopping Tissuestack..." >> /var/log/messages 35 | . /etc/profile.d/modules.sh >> /var/log/messages 36 | . /opt/tissuestack/conf/tissuestack_modules.sh >> /var/log/messages 37 | tissuestack stop >> /var/log/messages 38 | if [ $? -eq 1 ]; then 39 | echo "OK"; echo "TissueStack stopped." >> /var/log/messages 40 | else 41 | echo "FAILED";echo "Failed to stop TissueStack." >> /var/log/messages 42 | return -1; 43 | fi; 44 | rm -rf /var/lock/subsys/tissuestack >> /var/log/messages 45 | rm -rf /tmp/tissue_stack_communication >> /var/log/messages 46 | return 0; 47 | } 48 | 49 | case "$1" in 50 | start) 51 | start 52 | ;; 53 | stop) 54 | stop 55 | ;; 56 | restart) 57 | stop 58 | start 59 | ;; 60 | *) 61 | echo $"Usage: $0 {start|stop|restart}" 62 | esac 63 | -------------------------------------------------------------------------------- /packaging/tissuestack_sysctl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # load some environment variables 4 | if [ -a /etc/profile.d/tissuestack_env.sh ]; then 5 | source /etc/profile.d/tissuestack_env.sh 6 | else 7 | if [ "$TISSUE_STACK_ENV" != "" ];then 8 | source $TISSUE_STACK_ENV 9 | else 10 | echo "ERROR: You are missing environment variables!!" 11 | exit -1 12 | fi 13 | fi 14 | 15 | # actual script 16 | SHUTDOWN_TRIES=10 17 | EVERYTHING_IS_DOWN=false 18 | PROCESSES=(TissueStackServer) 19 | PROCESS_COUNT=${#PROCESSES[*]} 20 | FIRST_ARGUMENT=none 21 | SECOND_ARGUMENT=none 22 | 23 | if [ $# -gt 0 ] && [[ $1 -eq "start" || $1 -eq "stop" || $1 -eq "restart" ]]; then 24 | FIRST_ARGUMENT=$1 25 | else 26 | echo -e "No/invalid command line argument given, falling back onto default: 'restart'. Other options are 'start' and 'stop'" 27 | FIRST_ARGUMENT="restart" 28 | fi 29 | 30 | if [ $# -gt 1 ] && [ $2 == "force" ]; then 31 | SECOND_ARGUMENT=$2 32 | fi 33 | 34 | while [ $SHUTDOWN_TRIES -gt 0 ] && [ $EVERYTHING_IS_DOWN == false ]; do 35 | echo -e "Checking for running TissueStack components...\n" 36 | for i in ${PROCESSES[*]}; do 37 | PID_OF_PROCESS=`pgrep -f $i` 38 | if [ "$PID_OF_PROCESS" != "" ]; then 39 | echo "$PID_OF_PROCESS ($i) is running. Shutting it down now... Number of global retries left: $SHUTDOWN_TRIES" 40 | if [ $SECOND_ARGUMENT == "force" ]; then 41 | kill -9 $PID_OF_PROCESS 42 | else 43 | kill $PID_OF_PROCESS 44 | fi 45 | (( SHUTDOWN_TRIES -= 1 )) 46 | sleep 5 47 | else 48 | (( PROCESS_COUNT -= 1 )) 49 | fi 50 | done 51 | if [ $PROCESS_COUNT -eq 0 ] || [ $PROCESS_COUNT -lt 0 ] ; then 52 | EVERYTHING_IS_DOWN=true 53 | fi 54 | done 55 | 56 | echo -e "\nEverything's down!" 57 | 58 | if [ $FIRST_ARGUMENT == "stop" ]; then 59 | exit 0 60 | fi 61 | 62 | echo -e "\nNow start everything again ... (Check following output for errors during during Tissue Stack startup!!) \n" 63 | 64 | $IMAGE_SERVER_EXE 65 | -------------------------------------------------------------------------------- /packaging/ts_cl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | java -jar $TISSUE_STACK_JARS/TS_CL_Tool.jar "$@" 3 | 4 | -------------------------------------------------------------------------------- /rpm/tissuestack_clients.spec: -------------------------------------------------------------------------------- 1 | %global _enable_debug_package 0 2 | %global debug_package %{nil} 3 | %global __os_install_post /usr/lib/rpm/brp-compress %{nil} 4 | Name: tissuestack-clients 5 | Version: 2.3 6 | Release: 0%{?dist} 7 | Summary: TissueStack Clients 8 | 9 | Group: Graphics 10 | License: GPLv3+ 11 | URL: https://github.com/NIF-au/TissueStack 12 | Source: %{name}-%{version}.tar.gz 13 | 14 | BuildRequires: minc GraphicsMagick-devel 15 | Requires: minc nifticlib GraphicsMagick dcmtk 16 | 17 | %description 18 | Tissue Stack Clients 19 | 20 | %prep 21 | tar xvzf /tmp/tissuestack_build/%{name}-%{version}.tar.gz 22 | 23 | %build 24 | mkdir -p %{buildroot} 25 | cp -r * %{buildroot} 26 | 27 | %files 28 | /etc/profile.d/* 29 | /usr/local/tissuestack/%{version}/* 30 | 31 | #%doc 32 | 33 | %clean 34 | rm -rf /tmp/tissuestack_build 35 | 36 | %postun 37 | /sbin/ldconfig 38 | exit 0 39 | 40 | %post 41 | /sbin/ldconfig 42 | exit 0 43 | -------------------------------------------------------------------------------- /src/c++/README: -------------------------------------------------------------------------------- 1 | ################################################################################## 2 | ############### TISSUE STACK - BACKEND [ WEB & IMAGE SERVER ] ################# 3 | ################################################################################## 4 | 5 | The C++ code can be built by simply typing: make 6 | 7 | Here are a few further options that may be useful: 8 | 9 | "make compile" just compile the code after a change to any cpp (not .h !!!) 10 | "make install" will compile (see above) and copy the binary to: 11 | /usr/local/tissustack/version.number 12 | "make compile-tools" same as compile option (see above) but for the tools only 13 | "make install-tools" same as install option (see above) but for the tools only 14 | 15 | Note: the targets above are "shortcuts" and do deliberately not clean before 16 | so as to not trigger a (slower) entire rebuild. If this is what you want 17 | then use "make" (simply) or "make clean ...." 18 | 19 | For a more refined building based on targets, please consult the Makefile. 20 | -------------------------------------------------------------------------------- /src/c++/common/ProcessingStrategy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "tissuestack.h" 18 | 19 | tissuestack::common::ProcessingStrategy::ProcessingStrategy() 20 | { 21 | // abstract 22 | } 23 | 24 | tissuestack::common::ProcessingStrategy::~ProcessingStrategy() 25 | { 26 | //abstract 27 | } 28 | 29 | void tissuestack::common::ProcessingStrategy::setRunningFlag(bool isRunning) 30 | { 31 | this->_isRunning = isRunning; 32 | } 33 | 34 | void tissuestack::common::ProcessingStrategy::setOfflineStrategyFlag() 35 | { 36 | this->_isOnline = false; 37 | } 38 | 39 | 40 | bool tissuestack::common::ProcessingStrategy::isRunning() const 41 | { 42 | return this->_isRunning; 43 | } 44 | 45 | bool tissuestack::common::ProcessingStrategy::isStopFlagRaised() const 46 | { 47 | return this->_stopFlagRaised; 48 | } 49 | 50 | bool tissuestack::common::ProcessingStrategy::isOnlineStrategy() const 51 | { 52 | return this->_isOnline; 53 | } 54 | 55 | void tissuestack::common::ProcessingStrategy::raiseStopFlag() 56 | { 57 | this->_stopFlagRaised = true; 58 | } 59 | 60 | void tissuestack::common::ProcessingStrategy::resetStopFlag() 61 | { 62 | this->_stopFlagRaised = false; 63 | } 64 | -------------------------------------------------------------------------------- /src/c++/common/Request.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "tissuestack.h" 18 | 19 | tissuestack::common::Request::Request() : _type(tissuestack::common::Request::Type::RAW_HTTP) {}; 20 | 21 | tissuestack::common::Request::~Request() 22 | { 23 | // nothing to be done, after all we are abstract 24 | }; 25 | 26 | const tissuestack::common::Request::Type tissuestack::common::Request::getType() const 27 | { 28 | return this->_type; 29 | } 30 | 31 | void tissuestack::common::Request::setType(tissuestack::common::Request::Type type) 32 | { 33 | this->_type = type; 34 | } 35 | -------------------------------------------------------------------------------- /src/c++/common/RequestFilter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "tissuestack.h" 18 | 19 | tissuestack::common::RequestFilter::RequestFilter() 20 | { 21 | // nothing to be done, after all we are abstract 22 | }; 23 | 24 | tissuestack::common::RequestFilter::~RequestFilter() 25 | { 26 | // nothing to be done, after all we are abstract 27 | }; 28 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackApplicationException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackApplicationException::TissueStackApplicationException(std::string what) : 20 | tissuestack::common::TissueStackException(what) {} 21 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackException::TissueStackException() : _what("Exception not properly specified!") {} 20 | 21 | tissuestack::common::TissueStackException::TissueStackException(const std::string what) : _what(what) {} 22 | 23 | const char * tissuestack::common::TissueStackException::what() const throw() 24 | { 25 | if (this->_what.empty()) return static_cast("Generic Tissue Stack Application Exception"); 26 | 27 | return this->_what.c_str(); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackFileUploadException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackFileUploadException::TissueStackFileUploadException(std::string what) : 20 | tissuestack::common::TissueStackApplicationException(what) {} 21 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackInvalidRequestException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackInvalidRequestException::TissueStackInvalidRequestException(std::string what) : 20 | tissuestack::common::TissueStackApplicationException(what) {} 21 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackNullPointerException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackNullPointerException::TissueStackNullPointerException(std::string what) : 20 | tissuestack::common::TissueStackApplicationException(what) {} 21 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackObsoleteRequestException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackObsoleteRequestException::TissueStackObsoleteRequestException(std::string what) : 20 | tissuestack::common::TissueStackInvalidRequestException(what) {} 21 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackProcessingStrategy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "execution.h" 18 | 19 | tissuestack::common::TissueStackProcessingStrategy::TissueStackProcessingStrategy() : 20 | _task_queue_executor(new tissuestack::execution::TissueStackTaskQueueExecutor()), 21 | _slice_cache_cleaner(new tissuestack::execution::TissueStackSliceCacheCleaner()), 22 | _colormap_lookup_updater(new tissuestack::execution::TissueStackColorMapAndLookupUpdater()) 23 | { 24 | unsigned int cores = tissuestack::utils::System::getNumberOfCores(); 25 | 26 | // heck let's be greedy 27 | short numberOfThreads = 5; 28 | if (cores > 2 && cores <= 5) 29 | numberOfThreads = 10; 30 | else if (cores > 5 && cores <= 10) 31 | numberOfThreads = 15; 32 | else if (cores > 10) 33 | numberOfThreads = 20; 34 | 35 | this->_default_strategy = new tissuestack::execution::ThreadPool(numberOfThreads); 36 | }; 37 | 38 | tissuestack::common::TissueStackProcessingStrategy::~TissueStackProcessingStrategy() 39 | { 40 | delete this->_default_strategy; 41 | delete this->_task_queue_executor; 42 | delete this->_slice_cache_cleaner; 43 | delete this->_colormap_lookup_updater; 44 | }; 45 | 46 | void tissuestack::common::TissueStackProcessingStrategy::init() 47 | { 48 | // delegate 49 | this->_default_strategy->init(); 50 | this->_task_queue_executor->init(); 51 | this->_slice_cache_cleaner->init(); 52 | this->_colormap_lookup_updater->init(); 53 | if (this->_default_strategy->isRunning() && 54 | this->_task_queue_executor->isRunning() && 55 | this->_slice_cache_cleaner->isRunning() && 56 | this->_colormap_lookup_updater->isRunning()) 57 | this->setRunningFlag(true); 58 | }; 59 | 60 | void tissuestack::common::TissueStackProcessingStrategy::process( 61 | const std::function * functionality) 62 | { 63 | // delegate 64 | this->_default_strategy->process(functionality); 65 | }; 66 | 67 | void tissuestack::common::TissueStackProcessingStrategy::stop() 68 | { 69 | // delegate 70 | if (this->_default_strategy->isRunning()) 71 | this->_default_strategy->stop(); 72 | if (this->_task_queue_executor->isRunning()) 73 | this->_task_queue_executor->stop(); 74 | if (this->_slice_cache_cleaner->isRunning()) 75 | this->_slice_cache_cleaner->stop(); 76 | if (this->_colormap_lookup_updater->isRunning()) 77 | this->_colormap_lookup_updater->stop(); 78 | 79 | if (!this->_default_strategy->isRunning() && 80 | !this->_task_queue_executor->isRunning() && 81 | !this->_slice_cache_cleaner->isRunning() && 82 | !this->_colormap_lookup_updater->isRunning()) 83 | this->setRunningFlag(false); 84 | }; 85 | -------------------------------------------------------------------------------- /src/c++/common/TissueStackServerException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "exceptions.h" 18 | 19 | tissuestack::common::TissueStackServerException::TissueStackServerException() : 20 | tissuestack::common::TissueStackServerException::TissueStackServerException(std::string("Tissue Stack Server Exception")) {} 21 | 22 | 23 | tissuestack::common::TissueStackServerException::TissueStackServerException(std::string what) : 24 | tissuestack::common::TissueStackServerException::TissueStackException(what) {} 25 | -------------------------------------------------------------------------------- /src/c++/common/include/exceptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #ifndef __EXCEPTIONS_H__ 18 | #define __EXCEPTIONS_H__ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | //#define THROW_TS_EXCEPTION(ex, message) throw ex (message "[ " __FILE__ " @ " __LINE__ " ]") 26 | #define EXPANDER(x) #x 27 | #define EXPANDER2(x) EXPANDER(x) 28 | #define THROW_TS_EXCEPTION(ex, message) throw ex ("ERROR: " message " [" __FILE__ "@ LINE: " EXPANDER2(__LINE__) "]"); 29 | 30 | namespace tissuestack 31 | { 32 | namespace common 33 | { 34 | class TissueStackException : public std::exception 35 | { 36 | public: 37 | TissueStackException(); 38 | explicit TissueStackException(std::string what); 39 | //void virtual setWhat(std::string what); 40 | virtual const char * what() const throw(); 41 | //virtual ~TissueStackException() throw(); 42 | private: 43 | std::string _what; 44 | }; 45 | 46 | class TissueStackServerException : public TissueStackException 47 | { 48 | public: 49 | TissueStackServerException(); 50 | explicit TissueStackServerException(std::string what); 51 | }; 52 | 53 | class TissueStackApplicationException : public TissueStackException 54 | { 55 | public: 56 | explicit TissueStackApplicationException(std::string what); 57 | }; 58 | 59 | class TissueStackFileUploadException : public TissueStackApplicationException 60 | { 61 | public: 62 | explicit TissueStackFileUploadException(std::string what); 63 | }; 64 | 65 | 66 | class TissueStackInvalidRequestException : public TissueStackApplicationException 67 | { 68 | public: 69 | explicit TissueStackInvalidRequestException(std::string what); 70 | }; 71 | 72 | class TissueStackObsoleteRequestException : public TissueStackInvalidRequestException 73 | { 74 | public: 75 | explicit TissueStackObsoleteRequestException(std::string what); 76 | }; 77 | 78 | class TissueStackNullPointerException : public TissueStackApplicationException 79 | { 80 | public: 81 | explicit TissueStackNullPointerException(std::string what); 82 | }; 83 | } 84 | } 85 | 86 | #endif /* __EXCEPTIONS_H__ */ 87 | -------------------------------------------------------------------------------- /src/c++/common/include/globals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #ifndef __GLOBALS_H__ 18 | #define __GLOBALS_H__ 19 | 20 | // GLOBAL APPLICATION (DATA) PATH 21 | #ifndef APPLICATION_PATH 22 | #define APPLICATION_PATH "/opt/tissuestack" 23 | #endif 24 | // HELPS US TO ASSEMBLE SUB-DIRECTORIES BASED ON THE ROOT PATH 25 | #define CONCAT_APP_PATH(PATH_TO_BE_ADDED) APPLICATION_PATH "/" PATH_TO_BE_ADDED 26 | 27 | #define DATASET_PATH CONCAT_APP_PATH("data") 28 | #define COLORMAP_PATH CONCAT_APP_PATH("colormaps") 29 | #define LOG_PATH CONCAT_APP_PATH("logs") 30 | #define LABEL_LOOKUP_PATH CONCAT_APP_PATH("lookup") 31 | #define TASKS_PATH CONCAT_APP_PATH("tasks") 32 | #define UPLOAD_PATH CONCAT_APP_PATH("upload") 33 | #define TISSUESTACK_TMP_DIR "/tmp" 34 | 35 | #endif /* __GLOBALS_H__ */ 36 | -------------------------------------------------------------------------------- /src/c++/common/include/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #ifndef __LOGGING_H__ 18 | #define __LOGGING_H__ 19 | 20 | #include "globals.h" 21 | #include "utils.h" 22 | #include "exceptions.h" 23 | #include 24 | #include 25 | 26 | namespace tissuestack 27 | { 28 | namespace logging 29 | { 30 | class TissueStackLogger final 31 | { 32 | private: 33 | const static std::string TIMESTAMP_FORMAT; 34 | const std::string _log_path; 35 | FILE * _info_log; 36 | FILE * _error_log; 37 | FILE * _debug_log; 38 | TissueStackLogger(); 39 | void log(FILE * log_file, const char * log_args, va_list args); 40 | static TissueStackLogger * _instance; 41 | std::mutex _log_mutex; 42 | public: 43 | ~TissueStackLogger(); 44 | static const bool doesInstanceExist(); 45 | static TissueStackLogger * instance(); 46 | static void purgeInstance(); 47 | TissueStackLogger & operator=(const TissueStackLogger&) = delete; 48 | TissueStackLogger(const TissueStackLogger&) = delete; 49 | 50 | void info(const char * log_args, ...); 51 | void error(const char * log_args, ...); 52 | void debug(const char * log_args, ...); 53 | void all(const std::string & log_line); 54 | }; 55 | } 56 | } 57 | 58 | #endif /* __LOGGING_H__ */ 59 | -------------------------------------------------------------------------------- /src/c++/common/include/parameters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #ifndef __TS_PARAMETERS_H__ 18 | #define __TS_PARAMETERS_H__ 19 | 20 | namespace tissuestack 21 | { 22 | namespace database 23 | { 24 | class Configuration; // forward declaration 25 | } 26 | class TissueStackConfigurationParameters final 27 | { 28 | public: 29 | const std::string getParameter(const std::string & name) const; 30 | static const bool doesInstanceExist(); 31 | static TissueStackConfigurationParameters * instance(); 32 | void readInConfigurationFile(const std::string & configuration_file); 33 | void purgeInstance(); 34 | void dumpConfigurationToDebugLog() const ; 35 | private: 36 | void addOrReplaceConfiguration(tissuestack::database::Configuration * conf); 37 | inline tissuestack::database::Configuration * findConfiguration(const std::string & name) const; 38 | TissueStackConfigurationParameters(); 39 | const std::string eliminateWhitespaceAndUnwantedEscapeCharacters(const std::string & someString) const; 40 | std::unordered_map _parameters; 41 | static TissueStackConfigurationParameters * _instance; 42 | }; 43 | } 44 | 45 | #endif /* __TS_PARAMETERS_H__ */ 46 | -------------------------------------------------------------------------------- /src/c++/database/AtlasInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "database.h" 18 | 19 | tissuestack::database::AtlasInfo::AtlasInfo( 20 | const unsigned long long int id, 21 | const std::string prefix, 22 | const std::string description, 23 | const std::string query_url) : 24 | _id(id), _prefix(prefix), _description(description), _query_url(query_url) {} 25 | 26 | const unsigned long long int tissuestack::database::AtlasInfo::getDataBaseId() const 27 | { 28 | return this->_id; 29 | } 30 | 31 | const std::string tissuestack::database::AtlasInfo::getPrefix() const 32 | { 33 | return this->_prefix; 34 | } 35 | 36 | const std::string tissuestack::database::AtlasInfo::getDescription() const 37 | { 38 | return this->_description; 39 | } 40 | 41 | const std::string tissuestack::database::AtlasInfo::getQueryUrl() const 42 | { 43 | return this->_query_url; 44 | } 45 | 46 | 47 | const std::string tissuestack::database::AtlasInfo::toJson() const 48 | { 49 | std::ostringstream json; 50 | json << "{ \"id\": " << std::to_string(this->_id); 51 | json << ", \"prefix\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_prefix) << "\""; 52 | json << ", \"description\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_description) << "\""; 53 | if (!this->_query_url.empty()) 54 | json << ", \"queryUrl\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_query_url) << "\""; 55 | json << " }"; 56 | 57 | return json.str(); 58 | } 59 | -------------------------------------------------------------------------------- /src/c++/database/Configuration.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "database.h" 18 | 19 | tissuestack::database::Configuration::Configuration( 20 | const std::string name, const std::string value, const std::string description) : 21 | _name(name), _value(value), _description(description) { 22 | if (name.empty() || value.empty()) 23 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackApplicationException, 24 | "Configuration Data Object needs a non-empty name/value pair!"); 25 | } 26 | 27 | const std::string tissuestack::database::Configuration::getName() const 28 | { 29 | return this->_name; 30 | } 31 | 32 | const std::string tissuestack::database::Configuration::getValue() const 33 | { 34 | return this->_value; 35 | } 36 | 37 | const std::string tissuestack::database::Configuration::getDescription() const 38 | { 39 | return this->_description; 40 | } 41 | 42 | void tissuestack::database::Configuration::setValue(const std::string value) 43 | { 44 | if (value.empty()) return; 45 | 46 | this->_value = value; 47 | } 48 | 49 | 50 | const std::string tissuestack::database::Configuration::getJson() const 51 | { 52 | std::ostringstream json; 53 | json << "{ \"name\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_name) << "\""; 54 | json << ", \"value\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_value) << "\""; 55 | if (!this->_description.empty()) 56 | json << ", \"description\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_description) << "\""; 57 | json << " }"; 58 | 59 | return json.str(); 60 | } 61 | -------------------------------------------------------------------------------- /src/c++/database/DataSetInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "database.h" 18 | 19 | tissuestack::database::DataSetInfo::DataSetInfo( 20 | const unsigned long long int id, const std::string filename) : 21 | _id(id), _filename(filename) { 22 | if (id < 0 || filename.empty() || filename.empty()) 23 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackApplicationException, 24 | "DataSetInfo Data Object needs a positive id and a non-empty filename!"); 25 | } 26 | 27 | const unsigned long long int tissuestack::database::DataSetInfo::getId() const 28 | { 29 | return this->_id; 30 | } 31 | 32 | const std::string tissuestack::database::DataSetInfo::getFileName() const 33 | { 34 | return this->_filename; 35 | } 36 | 37 | const std::string tissuestack::database::DataSetInfo::getDescription() const 38 | { 39 | return this->_description; 40 | } 41 | 42 | void tissuestack::database::DataSetInfo::setDescription(const std::string description) 43 | { 44 | if (description.empty()) return; 45 | 46 | this->_description = description; 47 | } 48 | 49 | const std::string tissuestack::database::DataSetInfo::getZoomLevels() const 50 | { 51 | return this->_zoom_levels; 52 | } 53 | 54 | void tissuestack::database::DataSetInfo::setZoomLevels(const std::string zoom_levels) 55 | { 56 | if (zoom_levels.empty()) return; 57 | 58 | this->_zoom_levels = zoom_levels; 59 | } 60 | 61 | const bool tissuestack::database::DataSetInfo::isTiled() const 62 | { 63 | return this->_is_tiled; 64 | } 65 | 66 | void tissuestack::database::DataSetInfo::setTiled(const bool is_tiled) 67 | { 68 | this->_is_tiled = is_tiled; 69 | } 70 | 71 | void tissuestack::database::DataSetInfo::setOneToOneZoomLevel(const unsigned int one_to_one_zoom_level) 72 | { 73 | if (one_to_one_zoom_level < 0) return; 74 | 75 | this->_one_to_one_zoom_level = one_to_one_zoom_level; 76 | } 77 | 78 | const unsigned int tissuestack::database::DataSetInfo::getOneToOneZoomLevel() const 79 | { 80 | return this->_one_to_one_zoom_level; 81 | } 82 | 83 | void tissuestack::database::DataSetInfo::setResolutionMm(const float resolution_mm) 84 | { 85 | if (resolution_mm < 0) return; 86 | 87 | this->_resolution_mm = resolution_mm; 88 | } 89 | 90 | const float tissuestack::database::DataSetInfo::getResolutionMm() const 91 | { 92 | return this->_resolution_mm; 93 | } 94 | 95 | 96 | const std::string tissuestack::database::DataSetInfo::getJson(const bool everything) const 97 | { 98 | std::ostringstream json; 99 | json << "{ \"id\": " << std::to_string(this->_id); 100 | json << ", \"filename\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_filename) << "\""; 101 | if (!this->_description.empty()) 102 | json << ", \"description\": \"" << tissuestack::utils::Misc::maskQuotesInJson(this->_description) << "\""; 103 | if (everything) 104 | { 105 | // TODO: add more 106 | } 107 | json << " }"; 108 | 109 | return json.str(); 110 | } 111 | -------------------------------------------------------------------------------- /src/c++/execution/SimpleSequentialExecution.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "execution.h" 18 | 19 | tissuestack::execution::SimpleSequentialExecution::SimpleSequentialExecution() {} 20 | 21 | void tissuestack::execution::SimpleSequentialExecution::init() 22 | { 23 | // empty for now 24 | } 25 | 26 | void tissuestack::execution::SimpleSequentialExecution::process( 27 | const std::function * functionality) 28 | { 29 | // delegate only if we haven't received a null pointer for a closure 30 | // AND if the stop flag is down 31 | if (!this->isStopFlagRaised() && functionality) 32 | { 33 | this->setRunningFlag(true); // mark us as running 34 | try 35 | { 36 | ((*functionality)(this)); 37 | this->setRunningFlag(false); // mark us as finished 38 | this->resetStopFlag(); // reset any stop flag that was raised 39 | 40 | // clean up pointer 41 | delete functionality; 42 | } catch (std::exception& bad) 43 | { 44 | this->setRunningFlag(false); // mark us as finished 45 | this->resetStopFlag(); // reset any stop flag that was raised 46 | // clean up and propagate 47 | delete functionality; 48 | throw bad; 49 | } 50 | } 51 | } 52 | 53 | void tissuestack::execution::SimpleSequentialExecution::stop() 54 | { 55 | // these lines are mostly of a 'rhethorical' nature given sequential execution 56 | // but what the heck ... for completeness sake 57 | if (this->isRunning()) 58 | this->raiseStopFlag(); 59 | } 60 | -------------------------------------------------------------------------------- /src/c++/execution/TissueStackSliceCacheCleaner.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "services.h" 20 | #include "execution.h" 21 | 22 | tissuestack::execution::TissueStackSliceCacheCleaner::TissueStackSliceCacheCleaner() : 23 | tissuestack::execution::ThreadPool(1) 24 | { 25 | tissuestack::logging::TissueStackLogger::instance()->info("Launching Slice Cache Cleaner"); 26 | 27 | try 28 | { 29 | tissuestack::imaging::TissueStackSliceCache::instance(); 30 | } catch (std::exception & bad) 31 | { 32 | tissuestack::logging::TissueStackLogger::instance()->error("Could not instantiate TissueStackSliceCache:\n%s\n", bad.what()); 33 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackApplicationException, 34 | "Could not instantiate the Slice Cache!"); 35 | } 36 | } 37 | 38 | void tissuestack::execution::TissueStackSliceCacheCleaner::init() 39 | { 40 | // the clean loop 41 | std::function clean_loop = 42 | [this] (tissuestack::execution::WorkerThread * assigned_worker) 43 | { 44 | tissuestack::logging::TissueStackLogger::instance()->info( 45 | "Slice Cache Cleaner Thread %u is ready\n", 46 | std::hash()(std::this_thread::get_id())); 47 | 48 | while (!this->isStopFlagRaised()) 49 | { 50 | usleep(5000000); // 5,000,000 micro seconds /5 seconds 51 | 52 | if (this->hasNoTasksQueued()) 53 | break; 54 | 55 | if (tissuestack::utils::System::getFreeRam() > tissuestack::imaging::TissueStackSliceCache::MINIMUM_FREE_RAM_IN_BYTES) 56 | continue; 57 | 58 | tissuestack::imaging::TissueStackSliceCache::instance()->cleanUpCache(); 59 | } 60 | tissuestack::logging::TissueStackLogger::instance()->info( 61 | "Slice Cache Cleaner Thread %u is about to stop working!\n", 62 | std::hash()(std::this_thread::get_id())); 63 | assigned_worker->stop(); 64 | }; 65 | 66 | this->init0(clean_loop); 67 | } 68 | 69 | void tissuestack::execution::TissueStackSliceCacheCleaner::process( 70 | const std::function * functionality) 71 | { 72 | if (functionality) 73 | delete functionality; 74 | } 75 | 76 | void tissuestack::execution::TissueStackSliceCacheCleaner::addTask(const std::function * functionality) 77 | { 78 | if (functionality) 79 | delete functionality; 80 | } 81 | 82 | const std::function * tissuestack::execution::TissueStackSliceCacheCleaner::removeTask() 83 | { 84 | return nullptr; 85 | } 86 | 87 | bool tissuestack::execution::TissueStackSliceCacheCleaner::hasNoTasksQueued() 88 | { 89 | return !tissuestack::imaging::TissueStackSliceCache::doesInstanceExist(); 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/c++/execution/TissueStackTaskQueueExecutor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "services.h" 20 | #include "execution.h" 21 | 22 | tissuestack::execution::TissueStackTaskQueueExecutor::TissueStackTaskQueueExecutor() : 23 | tissuestack::execution::ThreadPool(1) 24 | { 25 | tissuestack::logging::TissueStackLogger::instance()->info("Launching Task Queue Executor"); 26 | } 27 | 28 | void tissuestack::execution::TissueStackTaskQueueExecutor::init() 29 | { 30 | // the wait loop 31 | std::function wait_loop = 32 | [this] (tissuestack::execution::WorkerThread * assigned_worker) 33 | { 34 | tissuestack::logging::TissueStackLogger::instance()->info( 35 | "Task Queue Thread %u is ready\n", 36 | std::hash()(std::this_thread::get_id())); 37 | 38 | while (!this->isStopFlagRaised()) 39 | { 40 | //std::this_thread::sleep_for(std::chrono::milliseconds(100)); 41 | usleep(100000); // 100,000 micro seconds /100 milli seconds 42 | 43 | if (!tissuestack::services::TissueStackTaskQueue::doesInstanceExist()) 44 | break; 45 | 46 | // fetch next item from the globale task queue 47 | tissuestack::services::TissueStackTask * next_task = 48 | const_cast( 49 | tissuestack::services::TissueStackTaskQueue::instance()->getNextTask()); 50 | if (next_task == nullptr) continue; 51 | 52 | // delegate to online executor 53 | tissuestack::execution::TissueStackOnlineExecutor::instance()->executeTask( 54 | this, next_task); 55 | } 56 | tissuestack::logging::TissueStackLogger::instance()->info( 57 | "Task Queue Thread %u is about to stop working!\n", 58 | std::hash()(std::this_thread::get_id())); 59 | assigned_worker->stop(); 60 | }; 61 | this->init0(wait_loop); 62 | } 63 | 64 | void tissuestack::execution::TissueStackTaskQueueExecutor::process( 65 | const std::function * functionality) 66 | { 67 | if (functionality) 68 | delete functionality; 69 | } 70 | 71 | void tissuestack::execution::TissueStackTaskQueueExecutor::addTask(const std::function * functionality) 72 | { 73 | if (functionality) 74 | delete functionality; 75 | } 76 | 77 | const std::function * tissuestack::execution::TissueStackTaskQueueExecutor::removeTask() 78 | { 79 | return nullptr; 80 | } 81 | 82 | bool tissuestack::execution::TissueStackTaskQueueExecutor::hasNoTasksQueued() 83 | { 84 | if (tissuestack::services::TissueStackTaskQueue::instance() == nullptr) return true; 85 | 86 | return tissuestack::services::TissueStackTaskQueue::instance()->getNextTask() == nullptr; 87 | } 88 | 89 | -------------------------------------------------------------------------------- /src/c++/execution/WorkerThread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "execution.h" 18 | 19 | tissuestack::execution::WorkerThread::WorkerThread( 20 | std::function wait_loop) 21 | : std::thread(wait_loop, this) 22 | { 23 | this->_is_running = true; 24 | } 25 | 26 | bool tissuestack::execution::WorkerThread::isRunning() const 27 | { 28 | return this->_is_running; 29 | } 30 | 31 | void tissuestack::execution::WorkerThread::stop() 32 | { 33 | this->_is_running = false; 34 | } 35 | -------------------------------------------------------------------------------- /src/c++/imaging/DataSetSliceCache.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | 20 | tissuestack::imaging::DataSetSliceCache::~DataSetSliceCache() 21 | { 22 | if (this->_cache == nullptr) return; 23 | 24 | for (unsigned long int i=0;i_numberOfCachedSlices;i++) 25 | if (this->_cache[i]) 26 | delete this->_cache[i]; 27 | 28 | delete [] this->_cache; 29 | } 30 | 31 | tissuestack::imaging::DataSetSliceCache::DataSetSliceCache(const TissueStackRawData * image) : _numberOfCachedSlices(0), _cache(nullptr) 32 | { 33 | if (image == nullptr) 34 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackNullPointerException, 35 | "image param is null"); 36 | 37 | for (auto dim : image->getDimensionOrder()) 38 | this->_numberOfCachedSlices += image->getDimensionByLongName(dim)->getNumberOfSlices(); 39 | 40 | this->_cache = new tissuestack::imaging::SliceCacheEntry * [this->_numberOfCachedSlices]; 41 | for (unsigned long int x=0;x_numberOfCachedSlices;x++) 42 | this->_cache[x] = nullptr; 43 | } 44 | 45 | const unsigned long int tissuestack::imaging::DataSetSliceCache::getNumberOfCachedSlices() const 46 | { 47 | return this->_numberOfCachedSlices; 48 | } 49 | 50 | const long int tissuestack::imaging::DataSetSliceCache::getMostRecentCacheFailure() const 51 | { 52 | return this->_mostRecentCacheFailure; 53 | } 54 | 55 | void tissuestack::imaging::DataSetSliceCache::setMostRecentCacheFailure(const long int slice) 56 | { 57 | this->_mostRecentCacheFailure = slice; 58 | } 59 | 60 | const bool tissuestack::imaging::DataSetSliceCache::setSlice( 61 | const unsigned long int slice, tissuestack::imaging::SliceCacheEntry * cache_data) 62 | { 63 | if (slice >= this->_numberOfCachedSlices || cache_data == nullptr) 64 | return false; 65 | 66 | if (this->_cache && this->_cache[slice]) 67 | { 68 | delete cache_data; 69 | return true; 70 | } 71 | 72 | this->_cache[slice] = cache_data; 73 | 74 | return true; 75 | } 76 | 77 | tissuestack::imaging::SliceCacheEntry * tissuestack::imaging::DataSetSliceCache::getSlice(const unsigned long int slice) const 78 | { 79 | if (slice >= this->_numberOfCachedSlices) return nullptr; 80 | 81 | return this->_cache[slice]; 82 | } 83 | 84 | const bool tissuestack::imaging::DataSetSliceCache::isSliceCached(const unsigned long int slice) const 85 | { 86 | if (slice >= this->_numberOfCachedSlices) 87 | return false; 88 | 89 | return (this->_cache != nullptr && this->_cache[slice] != nullptr); 90 | } 91 | 92 | void tissuestack::imaging::DataSetSliceCache::eraseSlice(const unsigned long int slice) 93 | { 94 | if (slice >= this->_numberOfCachedSlices) return; 95 | 96 | if (this->_cache[slice]) 97 | { 98 | delete this->_cache[slice]; 99 | this->_cache[slice] = nullptr; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/c++/imaging/SliceCacheEntry.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | 20 | tissuestack::imaging::SliceCacheEntry::~SliceCacheEntry() 21 | { 22 | if (this->_cache_data) 23 | delete [] this->_cache_data; 24 | } 25 | 26 | tissuestack::imaging::SliceCacheEntry::SliceCacheEntry(const unsigned char * cache_data) : 27 | _cache_data(cache_data), _timestamp_accessed(tissuestack::utils::System::getSystemTimeInMillis()), _access_count(0) 28 | {} 29 | 30 | 31 | const unsigned char * tissuestack::imaging::SliceCacheEntry::getCacheData() 32 | { 33 | // every time this method is called we increment the access count 34 | // and update the last access timestamp 35 | const unsigned long long int MAX_UNSIGNED_LONG_LONG_INT = 36 | std::numeric_limits::max(); 37 | if (this->_access_count != MAX_UNSIGNED_LONG_LONG_INT) 38 | this->_access_count++; 39 | this->_timestamp_accessed = tissuestack::utils::System::getSystemTimeInMillis(); 40 | 41 | return this->_cache_data; 42 | } 43 | 44 | const unsigned long long int tissuestack::imaging::SliceCacheEntry::getAccessCount() const 45 | { 46 | return this->_access_count; 47 | } 48 | 49 | const unsigned long long int tissuestack::imaging::SliceCacheEntry::getTimeStampForLastAccess() const 50 | { 51 | return this->_timestamp_accessed; 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/c++/imaging/TissueStackDataBaseData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | 20 | const bool tissuestack::imaging::TissueStackDataBaseData::isRaw() const 21 | { 22 | return false; 23 | } 24 | 25 | tissuestack::imaging::TissueStackDataBaseData::TissueStackDataBaseData( 26 | const unsigned long long int id, const std::string filename) : 27 | tissuestack::imaging::TissueStackImageData(id, filename) {} 28 | 29 | tissuestack::imaging::TissueStackDataBaseData::~TissueStackDataBaseData() 30 | { 31 | // do nothing for now 32 | } 33 | -------------------------------------------------------------------------------- /src/c++/imaging/TissueStackDataSet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "database.h" 20 | 21 | tissuestack::imaging::TissueStackDataSet::TissueStackDataSet( 22 | const TissueStackImageData * image_data) : _image_data(image_data) {} 23 | 24 | tissuestack::imaging::TissueStackDataSet::~TissueStackDataSet() 25 | { 26 | if (this->_image_data) 27 | delete this->_image_data; 28 | } 29 | 30 | const tissuestack::imaging::TissueStackDataSet * tissuestack::imaging::TissueStackDataSet::fromFile(const std::string & filename) 31 | { 32 | return tissuestack::imaging::TissueStackDataSet::fromTissueStackImageData( 33 | tissuestack::imaging::TissueStackImageData::fromFile(filename)); 34 | } 35 | 36 | const tissuestack::imaging::TissueStackDataSet * tissuestack::imaging::TissueStackDataSet::fromTissueStackImageData(const TissueStackImageData * image_data) 37 | { 38 | if (image_data == nullptr) 39 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackNullPointerException, "Cannot construct data set from null image data"); 40 | 41 | if (!image_data->isRaw() && image_data->getFormat() != tissuestack::imaging::FORMAT::DATABASE) 42 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackNullPointerException, "Cannot construct data set from image data that is not raw or database!"); 43 | 44 | return new tissuestack::imaging::TissueStackDataSet(image_data); 45 | } 46 | 47 | const tissuestack::imaging::TissueStackDataSet * tissuestack::imaging::TissueStackDataSet::fromDataBaseRecordWithId( 48 | const unsigned long long id, 49 | const bool includePlanes) 50 | { 51 | if (id <=0) 52 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackApplicationException, "DataSet Record Id has to greated than 0"); 53 | 54 | // delegate 55 | return tissuestack::imaging::TissueStackDataSet::fromTissueStackImageData( 56 | tissuestack::imaging::TissueStackImageData::fromDataBaseRecordWithId(id, includePlanes)); 57 | } 58 | 59 | void tissuestack::imaging::TissueStackDataSet::dumpDataSetContentIntoDebugLog() const 60 | { 61 | this->_image_data->dumpImageDataIntoDebugLog(); 62 | } 63 | 64 | void tissuestack::imaging::TissueStackDataSet::associateDataSets() 65 | { 66 | if (!this->_image_data->hasNoAssociatedDataSets()) 67 | const_cast(this->_image_data)->clearAssociatedDataSets(); 68 | tissuestack::database::DataSetDataProvider::findAssociatedDataSets( 69 | this->_image_data->getDataBaseId(), const_cast(this->_image_data)); 70 | } 71 | 72 | const std::string tissuestack::imaging::TissueStackDataSet::getDataSetId() const 73 | { 74 | return this->_image_data->getFileName(); 75 | } 76 | 77 | const tissuestack::imaging::TissueStackImageData * tissuestack::imaging::TissueStackDataSet::getImageData() const 78 | { 79 | return this->_image_data; 80 | } 81 | -------------------------------------------------------------------------------- /src/c++/networking/HttpRequestSanityFilter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | 19 | tissuestack::networking::HttpRequestSanityFilter::~HttpRequestSanityFilter() 20 | { 21 | // not doing anything at the moment 22 | }; 23 | 24 | tissuestack::networking::HttpRequestSanityFilter::HttpRequestSanityFilter() 25 | { 26 | // not doing anything at the moment 27 | }; 28 | 29 | const tissuestack::common::Request * const tissuestack::networking::HttpRequestSanityFilter::applyFilter(const tissuestack::common::Request * const request) const 30 | { 31 | if (request == nullptr) THROW_TS_EXCEPTION(tissuestack::common::TissueStackNullPointerException, "applyFilter was called with NULL"); 32 | 33 | if (request->getType() != tissuestack::common::Request::Type::RAW_HTTP) 34 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, "applyFilter was called with non raw request"); 35 | 36 | // quick check if we begin the right way ... 37 | const std::string raw_content = request->getContent(); 38 | 39 | // there need to be 14 characters at a bare minimum, e.g. GET / HTTP/X.X 40 | // of course, there better be more but we check that later 41 | if (raw_content.length() < 10) 42 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, "applyFilter was called with incomplete http request"); 43 | 44 | // apart from a file upload we are not interested in any NON GET type of requests 45 | if (!(raw_content.find("POST") == 0 && 46 | raw_content.find("service=services") != std::string::npos && 47 | raw_content.find("sub_service=admin") != std::string::npos && 48 | raw_content.find("action=upload") != std::string::npos) && 49 | raw_content.find("GET") != 0) 50 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, "Tissue Stack only wants to deal with GET requests"); 51 | 52 | // annoying favicon 53 | if (raw_content.find("favicon.ico") != std::string::npos) 54 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, "Tissue Stack does not like favicon.ico requests"); 55 | 56 | 57 | // we are good => return a proper HttpRequest instance 58 | return new tissuestack::networking::HttpRequest(static_cast(request), true);; 59 | }; 60 | -------------------------------------------------------------------------------- /src/c++/networking/RawHttpRequest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | 19 | tissuestack::networking::RawHttpRequest::~RawHttpRequest() 20 | { 21 | // not doing anything at the moment 22 | }; 23 | 24 | tissuestack::networking::RawHttpRequest::RawHttpRequest(const std::string raw_content) : _content(raw_content) 25 | { 26 | this->setType(tissuestack::common::Request::Type::RAW_HTTP); 27 | }; 28 | 29 | const std::string tissuestack::networking::RawHttpRequest::getContent() const 30 | { 31 | return this->_content; 32 | }; 33 | 34 | const bool tissuestack::networking::RawHttpRequest::isObsolete() const 35 | { 36 | // at this level we are false by default 37 | return false; 38 | } 39 | -------------------------------------------------------------------------------- /src/c++/networking/TissueStackConversionRequest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "services.h" 20 | 21 | const std::string tissuestack::networking::TissueStackConversionRequest::SERVICE = "CONVERSION"; 22 | 23 | 24 | tissuestack::networking::TissueStackConversionRequest::~TissueStackConversionRequest() 25 | { 26 | if (this->_conversion) 27 | delete this->_conversion; 28 | } 29 | 30 | tissuestack::networking::TissueStackConversionRequest::TissueStackConversionRequest(std::unordered_map & request_parameters) { 31 | // we need a valid session 32 | if (tissuestack::services::TissueStackSecurityService::hasSessionExpired( 33 | tissuestack::utils::Misc::findUnorderedMapEntryWithUpperCaseStringKey(request_parameters, "session"))) 34 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 35 | "Invalid Session! Please Log In."); 36 | 37 | const std::string in_file = 38 | tissuestack::utils::Misc::findUnorderedMapEntryWithUpperCaseStringKey(request_parameters, "file"); 39 | if (in_file.empty()) 40 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 41 | "Mandatory parameter 'file' was not supplied!"); 42 | 43 | this->_conversion = 44 | new tissuestack::services::TissueStackConversionTask( 45 | tissuestack::services::TissueStackTaskQueue::instance()->generateTaskId(), 46 | in_file, 47 | tissuestack::utils::Misc::findUnorderedMapEntryWithUpperCaseStringKey(request_parameters, "new_raw_file")); 48 | 49 | // we have passed all preliminary checks => assign us the new type 50 | this->setType(tissuestack::common::Request::Type::TS_CONVERSION); 51 | 52 | } 53 | 54 | const tissuestack::services::TissueStackConversionTask * 55 | tissuestack::networking::TissueStackConversionRequest::getTask( 56 | const bool nullOutPointer) 57 | { 58 | if (!nullOutPointer) 59 | return this->_conversion; 60 | 61 | const tissuestack::services::TissueStackConversionTask * cpy = this->_conversion; 62 | this->_conversion = nullptr; 63 | 64 | return cpy; 65 | } 66 | 67 | const bool tissuestack::networking::TissueStackConversionRequest::isObsolete() const 68 | { 69 | // we regard a conversion request 'obsolete' 70 | //if there exists a running conversion task that works on that file 71 | return tissuestack::services::TissueStackTaskQueue::instance()->isBeingConverted( 72 | this->_conversion->getInputImageData() == nullptr ? 73 | this->_conversion->getInputFileName() : 74 | this->_conversion->getInputImageData()->getFileName()); 75 | } 76 | 77 | const std::string tissuestack::networking::TissueStackConversionRequest::getContent() const 78 | { 79 | return std::string("TS_CONVERSION"); 80 | } 81 | -------------------------------------------------------------------------------- /src/c++/networking/TissueStackQueryRequest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | 19 | const std::string tissuestack::networking::TissueStackQueryRequest::SERVICE = "QUERY"; 20 | 21 | tissuestack::networking::TissueStackQueryRequest::TissueStackQueryRequest( 22 | std::unordered_map & request_parameters) 23 | { 24 | this->setTimeStampInfoFromRequestParameters(request_parameters); 25 | this->setDataSetFromRequestParameters(request_parameters); 26 | this->setDimensionFromRequestParameters(request_parameters); 27 | this->setSliceFromRequestParameters(request_parameters); 28 | this->setCoordinatesFromRequestParameters(request_parameters, true); 29 | 30 | // we have passed all preliminary checks => assign us the new type 31 | this->setType(tissuestack::common::Request::Type::TS_QUERY); 32 | } 33 | 34 | const std::string tissuestack::networking::TissueStackQueryRequest::getContent() const 35 | { 36 | return std::string("TS_QUERY"); 37 | } 38 | -------------------------------------------------------------------------------- /src/c++/networking/TissueStackServicesRequest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | 19 | const std::string tissuestack::networking::TissueStackServicesRequest::SERVICE = "SERVICES"; 20 | 21 | 22 | tissuestack::networking::TissueStackServicesRequest::~TissueStackServicesRequest() {} 23 | 24 | tissuestack::networking::TissueStackServicesRequest::TissueStackServicesRequest( 25 | std::unordered_map & request_parameters, 26 | const std::string file_upload_start) : _request_parameters(request_parameters) { 27 | 28 | this->_subService = this->getRequestParameter("SUB_SERVICE", true); 29 | if (this->_subService.empty()) 30 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 31 | "TissueStack Services Request have to have a parameter 'SUB_SERVICE'!"); 32 | 33 | this->_file_upload_start = file_upload_start; 34 | 35 | // we have passed all preliminary checks => assign us the new type 36 | this->setType(tissuestack::common::Request::Type::TS_SERVICES); 37 | } 38 | 39 | const bool tissuestack::networking::TissueStackServicesRequest::isObsolete() const 40 | { 41 | return false; 42 | } 43 | 44 | const std::string tissuestack::networking::TissueStackServicesRequest::getRequestParameter( 45 | const std::string & which, const bool convertUpperCase) const 46 | { 47 | std::string param = tissuestack::utils::Misc::findUnorderedMapEntryWithUpperCaseStringKey(this->_request_parameters, which); 48 | if (!param.empty() && convertUpperCase) 49 | std::transform(param.begin(), param.end(), param.begin(), toupper); 50 | 51 | return param; 52 | } 53 | 54 | const std::string tissuestack::networking::TissueStackServicesRequest::getSubService() const 55 | { 56 | return this->_subService; 57 | } 58 | 59 | const std::string tissuestack::networking::TissueStackServicesRequest::getContent() const 60 | { 61 | return std::string("TS_SERVICES"); 62 | } 63 | 64 | const std::string tissuestack::networking::TissueStackServicesRequest::getFileUploadStart() const 65 | { 66 | return this->_file_upload_start; 67 | } 68 | -------------------------------------------------------------------------------- /src/c++/services/ColorMapService.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "services.h" 20 | 21 | const std::string tissuestack::services::ColorMapService::SUB_SERVICE_ID = "COLORMAPS"; 22 | 23 | 24 | 25 | tissuestack::services::ColorMapService::ColorMapService() { 26 | this->addMandatoryParametersForRequest("ALL", std::vector{}); 27 | this->addMandatoryParametersForRequest("QUERY", std::vector{"NAME"}); 28 | }; 29 | 30 | tissuestack::services::ColorMapService::~ColorMapService() {}; 31 | 32 | void tissuestack::services::ColorMapService::checkRequest( 33 | const tissuestack::networking::TissueStackServicesRequest * request) const 34 | { 35 | this->checkMandatoryRequestParameters(request); 36 | } 37 | 38 | void tissuestack::services::ColorMapService::streamResponse( 39 | const tissuestack::common::ProcessingStrategy * processing_strategy, 40 | const tissuestack::networking::TissueStackServicesRequest * request, 41 | const int file_descriptor) const 42 | { 43 | const std::string action = request->getRequestParameter("ACTION", true); 44 | const bool originalColorMappingFileContents = 45 | request->getRequestParameter("FINAL").empty() ? true : false; 46 | 47 | std::ostringstream json; 48 | 49 | if (action.compare("ALL") == 0) 50 | json << tissuestack::imaging::TissueStackColorMapStore::instance()->toJson(originalColorMappingFileContents); 51 | else if (action.compare("QUERY") == 0) 52 | { 53 | const tissuestack::imaging::TissueStackColorMap * map = 54 | tissuestack::imaging::TissueStackColorMapStore::instance()->findColorMap( 55 | request->getRequestParameter("NAME")); 56 | if (map == nullptr) 57 | json << ""; 58 | else 59 | json << "{" << map->toJson(originalColorMappingFileContents) << "}"; 60 | } 61 | std::string sJson = json.str(); 62 | if (sJson.empty()) 63 | sJson = tissuestack::common::NO_RESULTS_JSON; 64 | 65 | const std::string response = 66 | tissuestack::utils::Misc::composeHttpResponse("200 OK", "application/json", sJson); 67 | write(file_descriptor, response.c_str(), response.length()); 68 | } 69 | -------------------------------------------------------------------------------- /src/c++/services/TissueStackService.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "database.h" 20 | #include "services.h" 21 | 22 | tissuestack::services::TissueStackService::TissueStackService() {} 23 | tissuestack::services::TissueStackService::~TissueStackService() {} 24 | 25 | void tissuestack::services::TissueStackService::addMandatoryParametersForRequest( 26 | const std::string action, const std::vector mandatoryParams) 27 | { 28 | this->_MANDATORY_PARAMETERS[action] = mandatoryParams; 29 | } 30 | 31 | void tissuestack::services::TissueStackService::checkMandatoryRequestParameters( 32 | const tissuestack::networking::TissueStackServicesRequest * request) const 33 | { 34 | const std::string action = request->getRequestParameter("ACTION", true); 35 | if (action.empty()) 36 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 37 | "There has to be a 'action' parameter for a TissueStack Services request !"); 38 | 39 | try 40 | { 41 | const std::vector mandatoryParams = 42 | this->_MANDATORY_PARAMETERS.at(action); 43 | 44 | // now loop over list and check if we have all of them 45 | for (auto p : mandatoryParams) 46 | if (request->getRequestParameter(p).empty()) 47 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 48 | "Mandatory parameter " + p + " is missing!"); 49 | } catch (std::out_of_range & not_found) { 50 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 51 | "(A) mandatory parameter(s) for the action do(es) not exist!"); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/c++/services/TissueStackServiceError.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "database.h" 20 | #include "services.h" 21 | 22 | tissuestack::services::TissueStackServiceError::TissueStackServiceError( 23 | const std::exception & exception) : _exception(std::string(exception.what())) {} 24 | 25 | tissuestack::services::TissueStackServiceError::TissueStackServiceError( 26 | const tissuestack::common::TissueStackException & exception) : _exception(std::string(exception.what())) {} 27 | 28 | const std::string tissuestack::services::TissueStackServiceError::toJson() const 29 | { 30 | std::ostringstream json; 31 | 32 | json << "{\"error\": { \"exception\": \""; 33 | std::string sWhat(this->_exception); 34 | std::string sException = "Exception"; 35 | std::string sDescription = sWhat; 36 | 37 | if (sWhat.empty()) // not specified 38 | { 39 | sException = "N/A"; 40 | sDescription = "An unexpected exception without further description occurred"; 41 | } else if (sWhat.at(sWhat.length()-1) == ']') 42 | { 43 | // if it is a tissuestack exception we can dissect it into a description and exception part 44 | size_t iPos = sWhat.rfind("@ LINE:"); 45 | if (iPos != std::string::npos && 46 | ((iPos = sWhat.rfind("[", iPos)) != std::string::npos)) 47 | { 48 | sDescription = sWhat.substr(0, iPos-1); 49 | sException = sWhat.substr(iPos, sWhat.length()-iPos); 50 | } 51 | } 52 | if (sDescription.find("ERROR: ") == 0) // remove leading ERROR: term 53 | sDescription = sDescription.substr(7); 54 | json << tissuestack::utils::Misc::maskQuotesInJson(sException) << "\", \"description\": \""; 55 | json << tissuestack::utils::Misc::maskQuotesInJson(sDescription) << "\"}}"; 56 | 57 | return json.str(); 58 | } 59 | -------------------------------------------------------------------------------- /src/c++/services/TissueStackServicesDelegator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "networking.h" 18 | #include "imaging.h" 19 | #include "database.h" 20 | #include "services.h" 21 | 22 | tissuestack::services::TissueStackServicesDelegator::TissueStackServicesDelegator() 23 | { 24 | // register some standard services 25 | this->_registeredServices[tissuestack::services::TissueStackSecurityService::SUB_SERVICE_ID] = 26 | new tissuestack::services::TissueStackSecurityService(); 27 | this->_registeredServices[tissuestack::services::TissueStackAdminService::SUB_SERVICE_ID] = 28 | new tissuestack::services::TissueStackAdminService(); 29 | this->_registeredServices[tissuestack::services::ConfigurationService::SUB_SERVICE_ID] = 30 | new tissuestack::services::ConfigurationService(); 31 | this->_registeredServices[tissuestack::services::ColorMapService::SUB_SERVICE_ID] = 32 | new tissuestack::services::ColorMapService(); 33 | this->_registeredServices[tissuestack::services::DataSetConfigurationService::SUB_SERVICE_ID] = 34 | new tissuestack::services::DataSetConfigurationService(); 35 | this->_registeredServices[tissuestack::services::TissueStackMetaDataService::SUB_SERVICE_ID] = 36 | new tissuestack::services::TissueStackMetaDataService(); 37 | } 38 | 39 | tissuestack::services::TissueStackServicesDelegator::~TissueStackServicesDelegator() 40 | { 41 | for (auto pair : this->_registeredServices) 42 | delete pair.second; 43 | } 44 | 45 | void tissuestack::services::TissueStackServicesDelegator::processRequest( 46 | const tissuestack::common::ProcessingStrategy * processing_strategy, 47 | const tissuestack::networking::TissueStackServicesRequest * request, 48 | const int file_descriptor) 49 | { 50 | const tissuestack::services::TissueStackService * subService = 51 | this->_registeredServices[request->getSubService()]; 52 | if (subService == nullptr) 53 | THROW_TS_EXCEPTION(tissuestack::common::TissueStackInvalidRequestException, 54 | "Failed to find a registered sub service to deal with this request!"); 55 | 56 | subService->checkRequest(request); 57 | subService->streamResponse(processing_strategy, request, file_descriptor); 58 | } 59 | 60 | -------------------------------------------------------------------------------- /src/c++/utils/Timer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | #include "utils.h" 18 | 19 | 20 | /* abstract factory method */ 21 | tissuestack::utils::Timer * const tissuestack::utils::Timer::getInstance(Type type_of_timer) 22 | { 23 | if (type_of_timer == tissuestack::utils::Timer::Type::CLOCK_GET_TIME) return new tissuestack::utils::OrdinaryTimer(); 24 | else if (type_of_timer == tissuestack::utils::Timer::Type::CLOCK_TICKS) return new tissuestack::utils::ClockTimer(); 25 | 26 | return 0; 27 | } 28 | 29 | /* 'Ordinary' Timer Implementation */ 30 | void tissuestack::utils::OrdinaryTimer::start() { 31 | ::clock_gettime(CLOCK_MONOTONIC_RAW,&this->_clock_start); 32 | } 33 | 34 | const unsigned long long int tissuestack::utils::OrdinaryTimer::stop() { 35 | ::clock_gettime(CLOCK_MONOTONIC_RAW,&this->_clock_end); 36 | 37 | unsigned long long int nanosecs_start = 38 | static_cast(this->_clock_start.tv_sec) * tissuestack::utils::Timer::NANO_SECONDS_PER_SEC 39 | + static_cast(this->_clock_start.tv_nsec); 40 | unsigned long long int nanosecs_end = 41 | static_cast(this->_clock_end.tv_sec) * tissuestack::utils::Timer::NANO_SECONDS_PER_SEC 42 | + static_cast(this->_clock_end.tv_nsec); 43 | 44 | return (nanosecs_end - nanosecs_start); 45 | } 46 | 47 | /* Clock Timer Implementation */ 48 | void tissuestack::utils::ClockTimer::start() { 49 | this->_clock_start = ::clock(); 50 | } 51 | 52 | const unsigned long long int tissuestack::utils::ClockTimer::stop() { 53 | this->_clock_end = ::clock(); 54 | 55 | return static_cast((( 56 | static_cast(this->_clock_end - this->_clock_start) / CLOCKS_PER_SEC) * tissuestack::utils::Timer::NANO_SECONDS_PER_SEC) ); 57 | } 58 | -------------------------------------------------------------------------------- /src/java/build.xml: -------------------------------------------------------------------------------- 1 | 2 | TissueStackCLTool 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/java/libs/json-simple-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/java/libs/json-simple-1.1.1.jar -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/TissueStackCLCommunicator.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStream; 5 | import java.io.InputStreamReader; 6 | import java.net.HttpURLConnection; 7 | import java.net.URL; 8 | import java.net.URLEncoder; 9 | 10 | public final class TissueStackCLCommunicator { 11 | 12 | public static String sendHttpRequest(final URL url, final String request) throws Exception { 13 | 14 | try { 15 | final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 16 | 17 | // receive response 18 | connection.setDoInput(true); 19 | InputStream in = null; 20 | StringBuilder respBuffer = new StringBuilder(); 21 | try { 22 | in = connection.getInputStream(); 23 | final BufferedReader reader = new BufferedReader(new InputStreamReader(in)); 24 | final char [] buffer = new char[1024]; 25 | int charRead = -1; 26 | while((charRead = reader.read(buffer)) != -1) 27 | respBuffer.append(buffer, 0, charRead); 28 | } finally { 29 | try { 30 | in.close(); 31 | } catch (Exception ignored) {} 32 | } 33 | 34 | return respBuffer.toString(); 35 | } catch(java.io.IOException io) { 36 | if (io.getMessage().indexOf("HTTP response code: 408") != -1) { 37 | return 38 | "{\"error\": {\"description\": \"Request obsolete, i.e. it's been/being processed already\"}}"; 39 | } else throw io; 40 | } 41 | } 42 | 43 | 44 | public static String encodeQueryStringParam(String param) { 45 | try { 46 | return URLEncoder.encode(param, "UTF-8") 47 | .replaceAll("\\+", "%20") 48 | .replaceAll("\\%21", "!") 49 | .replaceAll("\\%27", "'") 50 | .replaceAll("\\%28", "(") 51 | .replaceAll("\\%29", ")") 52 | .replaceAll("\\%7E", "~") 53 | .replaceAll("\\%2C", ",") 54 | .replaceAll("\\%5B", "[") 55 | .replaceAll("\\%5D", "]") 56 | .replaceAll("\\%5C", "\\") 57 | .replaceAll("\\%40", "@") 58 | .replaceAll("\\%7C", "|") 59 | .replaceAll("\\%5E", "^"); 60 | } catch (Exception e) { 61 | System.err.println("Failed to encode query string param"); 62 | } 63 | return null; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/TissueStackCLConfig.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.FileOutputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | import java.util.Properties; 10 | 11 | public final class TissueStackCLConfig { 12 | private static final String DEFAULT_CONFIG = 13 | System.getProperty("user.home") + File.separatorChar + ".tissuestack.conf"; 14 | private static TissueStackCLConfig myself; 15 | 16 | private File config_file = null; 17 | private Properties configuration = null; 18 | private Exception exceptionLoadingConfig = null; 19 | 20 | private TissueStackCLConfig(String location) { 21 | if (location == null || location.isEmpty()) 22 | location = TissueStackCLConfig.DEFAULT_CONFIG; 23 | 24 | if (!new File(location).exists()) { 25 | try { 26 | new File(location).createNewFile(); 27 | } catch (IOException ignored) {} 28 | } 29 | 30 | this.config_file = new File(location); 31 | this.configuration = new Properties(); 32 | if (this.config_file.exists() && this.config_file.canRead()) { 33 | InputStream in = null; 34 | try { 35 | in = new FileInputStream(this.config_file); 36 | this.configuration.load(in); 37 | } catch(Exception ignored) { 38 | // nothing we can do but make a note 39 | this.exceptionLoadingConfig = ignored; 40 | } finally { 41 | try { 42 | in.close(); 43 | } catch (Exception e) {} 44 | } 45 | } 46 | }; 47 | 48 | public static TissueStackCLConfig instance(String location) { 49 | if (TissueStackCLConfig.myself == null) 50 | TissueStackCLConfig.myself = new TissueStackCLConfig(location); 51 | return TissueStackCLConfig.myself; 52 | 53 | } 54 | 55 | public static TissueStackCLConfig instance() { 56 | return TissueStackCLConfig.instance(null); 57 | } 58 | 59 | public Exception getException() { 60 | return this.exceptionLoadingConfig; 61 | } 62 | 63 | public void setProperty(final String key, final String value) { 64 | if (key == null || value == null) return; 65 | this.configuration.setProperty(key, value); 66 | } 67 | 68 | public String get(final String key) { 69 | return this.configuration.getProperty(key); 70 | } 71 | 72 | public void saveConfig() { 73 | if (!this.config_file.canWrite()) { 74 | System.err.println("Cannot write to configuration file!"); 75 | return; 76 | } 77 | 78 | OutputStream out = null; 79 | try { 80 | out = new FileOutputStream(this.config_file); 81 | this.configuration.store(out, null); 82 | } catch(Exception ignored) { 83 | System.err.println("Failed to store changes to configuration file!"); 84 | } finally { 85 | try { 86 | out.close(); 87 | } catch (Exception e) {} 88 | } 89 | } 90 | 91 | public void deletePropertiesFile() { 92 | this.config_file.delete(); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/ClAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | public interface ClAction { 6 | enum STATUS { 7 | UNDEFINED, 8 | SUCCESS, 9 | PENDING, 10 | ERROR 11 | } 12 | 13 | String getRequestUrl(); 14 | boolean needsSession(); 15 | boolean setMandatoryParameters(String[] args); 16 | String getUsage(); 17 | 18 | ClActionResult performAction(final URL TissueStackServerURL); 19 | } 20 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/ClActionResult.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | public class ClActionResult { 4 | private ClAction.STATUS status; 5 | private String response; 6 | 7 | public ClActionResult() { 8 | this(null); 9 | } 10 | 11 | public ClActionResult(ClAction.STATUS status) { 12 | this(status, null); 13 | } 14 | 15 | public ClActionResult(ClAction.STATUS status, String response) { 16 | if (status == null) 17 | status = ClAction.STATUS.UNDEFINED; 18 | 19 | if (response == null || response.isEmpty()) 20 | response = "Response: N/A"; 21 | 22 | this.status = status; 23 | this.response = response; 24 | } 25 | 26 | public ClAction.STATUS getStatus() { 27 | return status; 28 | } 29 | 30 | public void setStatus(ClAction.STATUS status) { 31 | this.status = status; 32 | } 33 | 34 | public String getResponse() { 35 | return response; 36 | } 37 | 38 | public void setResponse(String response) { 39 | this.response = response; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/ConfigAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.io.File; 4 | import java.net.URL; 5 | 6 | import au.edu.cai.cl.TissueStackCLConfig; 7 | 8 | public class ConfigAction implements ClAction { 9 | 10 | private File location = null; 11 | 12 | public boolean needsSession() { 13 | return false; 14 | } 15 | 16 | public String getRequestUrl() { 17 | return ""; 18 | } 19 | 20 | public boolean setMandatoryParameters(String[] args) { 21 | 22 | if (args.length < 1) { 23 | System.err.println("ERROR: --ts-conf needs a configuration file as its first parameter"); 24 | return false; 25 | } 26 | final File newConfig = new File(args[0]); 27 | if (!newConfig.exists() || !newConfig.canRead()) { 28 | System.out.println("WARNING: --ts-conf file does not exist or cannot be read (but might be created with --server)"); 29 | } 30 | this.location = newConfig; 31 | return true; 32 | } 33 | 34 | public ClActionResult performAction(final URL TissueStackServerURL) { 35 | final TissueStackCLConfig config = 36 | TissueStackCLConfig.instance(this.location.getAbsolutePath()); 37 | if (config.getException() == null) 38 | return new ClActionResult(ClAction.STATUS.SUCCESS, "{ config: " + this.location.getAbsolutePath() + "}"); 39 | 40 | return new ClActionResult(ClAction.STATUS.ERROR, "{ error: " + config.getException().getMessage()); 41 | } 42 | 43 | public String getUsage() { 44 | return "--ts-conf file_location <== uses config file to get connect/session info"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/DataSetImportAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONObject; 6 | 7 | import au.edu.cai.cl.TissueStackCLCommunicator; 8 | import au.edu.cai.cl.json.JsonParser; 9 | 10 | public class DataSetImportAction implements ClAction { 11 | private String session = null; 12 | private String filename = null; 13 | 14 | public boolean setMandatoryParameters(String[] args) { 15 | if (args.length != 2 ) { 16 | System.out.println("--import needs a filename"); 17 | return false; 18 | } 19 | this.session = args[0]; 20 | this.filename = args[1]; 21 | return true; 22 | } 23 | 24 | public boolean needsSession() { 25 | return true; 26 | } 27 | 28 | public String getRequestUrl() { 29 | return "/server/?service=services&sub_service=admin&action=add_dataset&session=" + 30 | this.session + "&filename=" + this.filename; 31 | } 32 | 33 | public ClActionResult performAction(final URL TissueStackServerURL) { 34 | String response = null; 35 | StringBuilder formattedResponse = new StringBuilder(); 36 | try { 37 | final URL combinedURL = new URL(TissueStackServerURL.toString() + this.getRequestUrl()); 38 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 39 | 40 | final JSONObject parseResponse = JsonParser.parseResponse(response); 41 | if (parseResponse.get("response") != null) { // success it seems 42 | JSONObject respObj = (JSONObject) parseResponse.get("response"); 43 | if (respObj.containsKey("id") && respObj.containsKey("filename")) { 44 | formattedResponse.append("\n\tIMPORTED:\t"); 45 | formattedResponse.append(respObj.get("filename")); 46 | formattedResponse.append("\n\tID:\t\t"); 47 | formattedResponse.append(respObj.get("id")); 48 | formattedResponse.append("\n"); 49 | } 50 | return new ClActionResult(ClAction.STATUS.SUCCESS, formattedResponse.toString()); 51 | } else {// potential error 52 | return new ClActionResult(ClAction.STATUS.ERROR, JsonParser.parseError(parseResponse, response)); 53 | } 54 | } catch(Exception any) { 55 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 56 | } 57 | } 58 | 59 | public String getUsage() { 60 | return "--import filename <== imports dataset"; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/DataSetModifyAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONObject; 6 | 7 | import au.edu.cai.cl.TissueStackCLCommunicator; 8 | import au.edu.cai.cl.json.JsonParser; 9 | 10 | public class DataSetModifyAction implements ClAction { 11 | private String session=null; 12 | private long id=-1; 13 | private String column=null; 14 | private String value=null; 15 | 16 | public String getRequestUrl() { 17 | return "/server/?service=services&sub_service=metadata&action=dataset_modify&session=" 18 | + this.session + "&id=" + this.id + "&column=" + this.column + "&value=" + 19 | TissueStackCLCommunicator.encodeQueryStringParam(this.value); 20 | } 21 | 22 | public boolean needsSession() { 23 | return true; 24 | } 25 | 26 | public boolean setMandatoryParameters(String[] args) { 27 | if (args.length < 4) return false; 28 | this.session = args[0]; 29 | try { 30 | this.id = Long.parseLong(args[1]); 31 | } catch(Exception notnumeric) { 32 | System.err.println("ID is not numeric!"); 33 | return false; 34 | } 35 | this.column = args[2]; 36 | this.value = args[3]; 37 | return true; 38 | } 39 | 40 | public String getUsage() { 41 | return "--modify dataset_id column value <== modifies dataset table"; 42 | } 43 | 44 | public ClActionResult performAction(URL TissueStackServerURL) { 45 | String response = null; 46 | try { 47 | final URL combinedURL = new URL( 48 | TissueStackServerURL.toString() + this.getRequestUrl()); 49 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 50 | 51 | final JSONObject parseResponse = JsonParser.parseResponse(response); 52 | if (parseResponse.get("response") != null) { // success it seems 53 | String respObj = (String) parseResponse.get("response"); 54 | return new ClActionResult(ClAction.STATUS.SUCCESS, respObj); 55 | } else // potential error 56 | return new ClActionResult(ClAction.STATUS.SUCCESS, JsonParser.parseError(parseResponse, response)); 57 | } catch(Exception any) { 58 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/DeleteDataSetAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONObject; 6 | 7 | import au.edu.cai.cl.TissueStackCLCommunicator; 8 | import au.edu.cai.cl.json.JsonParser; 9 | 10 | 11 | public class DeleteDataSetAction implements ClAction { 12 | private String session = null; 13 | private long id = -1; 14 | private boolean confirmed = false; 15 | 16 | public boolean setMandatoryParameters(String[] args) { 17 | if (args.length < 2) return false; 18 | this.session = args[0]; 19 | try { 20 | id = Long.parseLong(args[1]); 21 | } catch(Exception notnumeric) { 22 | System.err.println("ID is not numeric!"); 23 | return false; 24 | } 25 | try { 26 | if (args.length > 2) 27 | this.confirmed = Boolean.parseBoolean(args[2]); 28 | } catch(Exception notboolean) { 29 | return false; 30 | } 31 | 32 | return true; 33 | } 34 | 35 | public boolean needsSession() { 36 | return true; 37 | } 38 | 39 | public String getRequestUrl() { 40 | return "/server/?service=services&sub_service=admin&action=delete_dataset&session=" + 41 | this.session + "&id=" + this.id + "&delete_file=" + this.confirmed; 42 | } 43 | 44 | public ClActionResult performAction(final URL TissueStackServerURL) { 45 | String response = null; 46 | try { 47 | final URL combinedURL = new URL(TissueStackServerURL.toString() + this.getRequestUrl()); 48 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 49 | 50 | final JSONObject parseResponse = JsonParser.parseResponse(response); 51 | if (parseResponse.get("response") != null) { // success it seems 52 | JSONObject respObj = (JSONObject) parseResponse.get("response"); 53 | return new ClActionResult(ClAction.STATUS.SUCCESS, (String) respObj.get("result")); 54 | } else // potential error 55 | return new ClActionResult(ClAction.STATUS.SUCCESS, JsonParser.parseError(parseResponse, response)); 56 | } catch(Exception any) { 57 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 58 | } 59 | } 60 | 61 | public String getUsage() { 62 | return "--delete id [delete_file (value: true/false)] <== deletes dataset (configuration and optionally file)"; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/FileAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONObject; 6 | 7 | import au.edu.cai.cl.TissueStackCLCommunicator; 8 | import au.edu.cai.cl.json.JsonParser; 9 | 10 | public class FileAction implements ClAction { 11 | private String option=null; 12 | private String session=null; 13 | private String oldLocation=null; 14 | private String newLocation=null; 15 | 16 | public String getRequestUrl() { 17 | return "/server/?service=services&sub_service=admin&action=" + 18 | (this.option.equals("DELETE") ? "file_delete" : "file_rename") + 19 | "&session=" + this.session + "&file=" + this.oldLocation + 20 | (this.option.equals("RENAME") ? 21 | ("&new_file=" + this.newLocation) : ""); 22 | } 23 | 24 | public boolean needsSession() { 25 | return true; 26 | } 27 | 28 | public boolean setMandatoryParameters(String[] args) { 29 | if (args.length < 2) return false; 30 | this.session = args[0]; 31 | this.option = args[1].toUpperCase(); 32 | if ((this.option.equals("DELETE") && args.length > 2) || 33 | (this.option.equals("RENAME") && args.length > 3)) { 34 | this.oldLocation = args[2]; 35 | if (args.length > 3) this.newLocation = args[3]; 36 | return true; 37 | } 38 | 39 | return false; 40 | } 41 | 42 | public String getUsage() { 43 | return "--file delete file <== deletes a file on the server\n" + 44 | "\t--file rename old_location new_location <== renames a file on the server"; 45 | } 46 | 47 | public ClActionResult performAction(URL TissueStackServerURL) { 48 | String response = null; 49 | try { 50 | final URL combinedURL = new URL( 51 | TissueStackServerURL.toString() + this.getRequestUrl()); 52 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 53 | 54 | final JSONObject parseResponse = JsonParser.parseResponse(response); 55 | if (parseResponse.get("response") != null) { // success it seems 56 | JSONObject respObj = (JSONObject) parseResponse.get("response"); 57 | if (respObj.containsKey("noResults")) 58 | return new ClActionResult(ClAction.STATUS.SUCCESS, 59 | (this.option.equals("DELETE") ? "file deleted" : "file renamed")); 60 | else 61 | return new ClActionResult(ClAction.STATUS.ERROR, 62 | (this.option.equals("DELETE") ? "file delete" : "file rename") + " failed"); 63 | } else // potential error 64 | return new ClActionResult(ClAction.STATUS.SUCCESS, JsonParser.parseError(parseResponse, response)); 65 | } catch(Exception any) { 66 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 67 | } 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/ListDataSetAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONArray; 6 | import org.json.simple.JSONObject; 7 | 8 | import au.edu.cai.cl.TissueStackCLCommunicator; 9 | import au.edu.cai.cl.json.JsonParser; 10 | 11 | 12 | public class ListDataSetAction implements ClAction { 13 | 14 | public boolean setMandatoryParameters(String[] args) { 15 | return true; 16 | } 17 | 18 | public boolean needsSession() { 19 | return false; 20 | } 21 | 22 | public String getRequestUrl() { 23 | return "/server/?service=services&sub_service=data&action=all&include_planes=false"; 24 | } 25 | 26 | public ClActionResult performAction(final URL TissueStackServerURL) { 27 | String response = null; 28 | try { 29 | final URL combinedURL = new URL(TissueStackServerURL.toString() + this.getRequestUrl()); 30 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 31 | StringBuilder formattedResponse = new StringBuilder(); 32 | 33 | final JSONObject parseResponse = JsonParser.parseResponse(response); 34 | if (parseResponse.get("response") != null) { // success it seems 35 | try { 36 | JSONArray respObj = (JSONArray) parseResponse.get("response"); 37 | 38 | @SuppressWarnings("unchecked") 39 | final JSONObject [] datasets = (JSONObject[]) respObj.toArray(new JSONObject[]{}); 40 | for (JSONObject dataset : datasets) { 41 | formattedResponse.append("\n\tID:\t\t"); 42 | formattedResponse.append(dataset.get("id")); 43 | formattedResponse.append("\n"); 44 | formattedResponse.append("\tFILENAME:\t"); 45 | formattedResponse.append(dataset.get("filename")); 46 | formattedResponse.append("\n"); 47 | if (dataset.containsKey("description")) { 48 | formattedResponse.append("\tDESCRIPTION:\t"); 49 | formattedResponse.append(dataset.get("description")); 50 | formattedResponse.append("\n"); 51 | } 52 | } 53 | } catch(Exception parseError) { 54 | if (parseError instanceof ClassCastException) { 55 | JSONObject respObj = (JSONObject) parseResponse.get("response"); 56 | if (respObj.containsKey("noResults")) 57 | return new ClActionResult(ClAction.STATUS.SUCCESS, (String) respObj.get("noResults")); 58 | else 59 | return new ClActionResult(ClAction.STATUS.ERROR, parseError.toString()); 60 | } else 61 | return new ClActionResult(ClAction.STATUS.ERROR, parseError.toString()); 62 | } 63 | return new ClActionResult(ClAction.STATUS.SUCCESS, formattedResponse.toString()); 64 | } else // potential error 65 | return new ClActionResult(ClAction.STATUS.SUCCESS, JsonParser.parseError(parseResponse, response)); 66 | } catch(Exception any) { 67 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 68 | } 69 | } 70 | 71 | public String getUsage() { 72 | return "--list <== lists all datasets, for details use --query"; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/ListUploadDirectoryAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONArray; 6 | import org.json.simple.JSONObject; 7 | 8 | import au.edu.cai.cl.TissueStackCLCommunicator; 9 | import au.edu.cai.cl.json.JsonParser; 10 | 11 | 12 | public class ListUploadDirectoryAction implements ClAction { 13 | private boolean display_raw_only = false; 14 | 15 | public boolean setMandatoryParameters(String[] args) { 16 | if (args.length > 0) { 17 | this.display_raw_only = Boolean.parseBoolean(args[0]); 18 | } 19 | 20 | return true; 21 | } 22 | 23 | public boolean needsSession() { 24 | return false; 25 | } 26 | 27 | public String getRequestUrl() { 28 | return "/server/?service=services&sub_service=admin&action=upload_directory&display_raw_only=" + 29 | this.display_raw_only; 30 | } 31 | 32 | public ClActionResult performAction(final URL TissueStackServerURL) { 33 | String response = null; 34 | try { 35 | final URL combinedURL = new URL(TissueStackServerURL.toString() + this.getRequestUrl()); 36 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 37 | StringBuilder formattedResponse = new StringBuilder(); 38 | 39 | final JSONObject parseResponse = JsonParser.parseResponse(response); 40 | if (parseResponse.get("response") != null) { // success it seems 41 | JSONArray respObj = (JSONArray) parseResponse.get("response"); 42 | 43 | if (respObj.isEmpty()) { 44 | return new ClActionResult(ClAction.STATUS.SUCCESS, "empty"); 45 | } 46 | 47 | @SuppressWarnings("unchecked") 48 | final String [] files = (String[]) respObj.toArray(new String[]{}); 49 | for (String file : files) { 50 | formattedResponse.append("\n\tFILE:\t"); 51 | formattedResponse.append(file); 52 | } 53 | return new ClActionResult(ClAction.STATUS.SUCCESS, formattedResponse.toString()); 54 | } else // potential error 55 | return new ClActionResult(ClAction.STATUS.SUCCESS, JsonParser.parseError(parseResponse, response)); 56 | } catch(Exception any) { 57 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 58 | } 59 | } 60 | 61 | public String getUsage() { 62 | return "--upload-dir [raw-files-only (value: true/false)] <== lists contents of upload directory"; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/LoginAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONObject; 6 | 7 | import au.edu.cai.cl.TissueStackCLCommunicator; 8 | import au.edu.cai.cl.json.JsonParser; 9 | 10 | public class LoginAction implements ClAction { 11 | private String password=null; 12 | 13 | public String getRequestUrl() { 14 | return "/server/?service=services&sub_service=security&action=new_session"; 15 | } 16 | 17 | public boolean needsSession() { 18 | return false; 19 | } 20 | 21 | public boolean setMandatoryParameters(String[] args) { 22 | if (args.length != 1 || args[0] == null) { 23 | System.err.println("Login requires a password parameter."); 24 | return false; 25 | } 26 | this.password = args[0]; 27 | return true; 28 | } 29 | 30 | public String getUsage() { 31 | return "--login password <== logs you in returning a session"; 32 | } 33 | 34 | public ClActionResult performAction(URL TissueStackServerURL) { 35 | String response = null; 36 | try { 37 | final URL combinedURL = new URL( 38 | TissueStackServerURL.toString() + this.getRequestUrl() + 39 | "&password=" + this.password); 40 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 41 | 42 | final JSONObject parseResponse = JsonParser.parseResponse(response); 43 | if (parseResponse.get("response") != null) { // success it seems 44 | JSONObject respObj = (JSONObject) parseResponse.get("response"); 45 | if (respObj.containsKey("expiry")) 46 | return new ClActionResult(ClAction.STATUS.SUCCESS, (String) respObj.get("id")); 47 | 48 | } 49 | } catch(Exception any) { 50 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 51 | } 52 | return new ClActionResult(ClAction.STATUS.ERROR, "Login Failed!"); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/actions/PasswordChangeAction.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.actions; 2 | 3 | import java.net.URL; 4 | 5 | import org.json.simple.JSONObject; 6 | 7 | import au.edu.cai.cl.TissueStackCLCommunicator; 8 | import au.edu.cai.cl.json.JsonParser; 9 | 10 | public class PasswordChangeAction implements ClAction { 11 | private String old_password=null; 12 | private String new_password=null; 13 | 14 | public String getRequestUrl() { 15 | return "/server/?service=services&sub_service=security&action=passwd&old_passwd="; 16 | } 17 | 18 | public boolean needsSession() { 19 | return false; 20 | } 21 | 22 | public boolean setMandatoryParameters(String[] args) { 23 | if (args.length != 2) { 24 | return false; 25 | } 26 | this.old_password = args[0]; 27 | this.new_password = args[1]; 28 | return true; 29 | } 30 | 31 | public String getUsage() { 32 | return "--password old new <== changes the present admin password"; 33 | } 34 | 35 | public ClActionResult performAction(URL TissueStackServerURL) { 36 | String response = null; 37 | try { 38 | final URL combinedURL = new URL( 39 | TissueStackServerURL.toString() + this.getRequestUrl() + 40 | this.old_password + "&new_passwd=" + this.new_password); 41 | response = TissueStackCLCommunicator.sendHttpRequest(combinedURL, null); 42 | 43 | final JSONObject parseResponse = JsonParser.parseResponse(response); 44 | if (parseResponse.get("response") != null) { // success it seems 45 | String respObj = (String) parseResponse.get("response"); 46 | return new ClActionResult(ClAction.STATUS.SUCCESS, respObj); 47 | } else 48 | return new ClActionResult(ClAction.STATUS.SUCCESS, 49 | JsonParser.parseError(parseResponse, response)); 50 | } catch(Exception any) { 51 | return new ClActionResult(ClAction.STATUS.ERROR, any.toString()); 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/java/main/au/edu/cai/cl/json/JsonParser.java: -------------------------------------------------------------------------------- 1 | package au.edu.cai.cl.json; 2 | 3 | import org.json.simple.JSONObject; 4 | import org.json.simple.JSONValue; 5 | 6 | public final class JsonParser { 7 | public static JSONObject parseResponse(final String response) { 8 | Object responseObject = null; 9 | 10 | try { 11 | responseObject = JSONValue.parse(response); 12 | } catch (Exception e) { 13 | // rethrow 14 | throw new RuntimeException("Failed to parse json response!", e); 15 | } 16 | 17 | if (responseObject == null) 18 | throw new RuntimeException("Json Parse gave us a null object!"); 19 | else if (responseObject instanceof JSONObject) 20 | return (JSONObject) responseObject; 21 | else 22 | throw new RuntimeException("Json Parse didn't give us the expected json object!"); 23 | } 24 | 25 | public static String parseError(JSONObject parseResponse, String response) { 26 | if (parseResponse == null) 27 | return null; 28 | 29 | final StringBuilder formattedResponse = new StringBuilder(); 30 | if (parseResponse.get("error") != null) { 31 | formattedResponse.append("Error: " ); 32 | 33 | JSONObject respObj = (JSONObject) parseResponse.get("error"); 34 | 35 | String cause = "unknown"; 36 | if (respObj.get("description") != null) 37 | cause = (String) respObj.get("description"); 38 | else if (respObj.get("exception") != null) 39 | cause = (String) respObj.get("exception"); 40 | 41 | formattedResponse.append(cause); 42 | } else formattedResponse.append("Unexpected Response:\n" + response); 43 | 44 | return formattedResponse.toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/java/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | ${project.basedir}/../../jars 5 | 6 | 4.0.0 7 | au.edu.cai 8 | TissueStackBioFormatsConverter 9 | jar 10 | 1.0 11 | Tissue Stack Bio Formats To Raw Converter 12 | 13 | 14 | 15 | bioformats 16 | bioformats 17 | system 18 | 5.1.1 19 | ${project.basedir}/../../jars/bioformats-5.1.1.jar 20 | 21 | 22 | 23 | 24 | TissueStackBioFormatsConverter 25 | ${project.basedir}/main 26 | /tmp/TissueStackBioFormatsConverter 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-compiler-plugin 31 | 2.3.2 32 | 33 | 1.5 34 | 1.5 35 | false 36 | 37 | 38 | 39 | 40 | maven-resources-plugin 41 | 2.4.3 42 | 43 | 44 | deploy-package 45 | install 46 | 47 | copy-resources 48 | 49 | 50 | ${deployment.directory} 51 | 52 | 53 | ${project.build.directory} 54 | 55 | ${project.build.finalName}.${project.packaging} 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/sql/README: -------------------------------------------------------------------------------- 1 | ################################################################################## 2 | ################### TISSUE STACK - DATABASE [ POSTGRESQL ] #################### 3 | ################################################################################## 4 | 5 | How to create the database: 6 | 7 | 1) Install Postgresql (8.4 or higher) 8 | 2) Run the sql scripts in this folder in the following order: 9 | *_db => *_tables => *_config 10 | 11 | => this will result in a database named 'tissuestack' with user 'tissuestack' 12 | with default password 'tissuestack' 13 | -------------------------------------------------------------------------------- /src/sql/create_tissuestack_config.sql: -------------------------------------------------------------------------------- 1 | -- !!!!! SWITCH TO tissuestack NOW before executing the following lines !!!!! 2 | 3 | -- GENERAL INSTANCE CONFIGURATION - some default values 4 | INSERT INTO configuration VALUES('version', '2.3', 'version'); 5 | INSERT INTO configuration VALUES('session_timeout_minutes', '15', 'The session timeout given in minutes'); 6 | INSERT INTO configuration VALUES('admin_passwd', '101ee9fe7aceaa8bea949e75a529d796da02e08bced78c6c4dde60768183fa14', 'Admin Password'); 7 | INSERT INTO configuration VALUES('server_proxy_path', 'server', 'server proxy path (relative to the application''s web root directory)'); 8 | INSERT INTO configuration VALUES('tile_directory', 'tiles', 'tile directory (relative to the application''s web root directory)'); 9 | INSERT INTO configuration VALUES('server_tile_directory', '/opt/tissuestack/tiles', 'server side tile directory for pre-tiling'); 10 | INSERT INTO configuration VALUES('upload_directory', '/opt/tissuestack/upload', 'upload directory (absolute system path on server)'); 11 | INSERT INTO configuration VALUES('lookup_directory', '/opt/tissuestack/lookup', 'directory that houses the lookup table files (absolute system path on server)'); 12 | INSERT INTO configuration VALUES('colormaps_directory', '/opt/tissuestack/colormaps', 'directory that houses the color map files (absolute system path on server)'); 13 | INSERT INTO configuration VALUES('tasks_directory', '/opt/tissuestack/tasks', 'directory that houses task queue files (absolute system path on server)'); 14 | INSERT INTO configuration VALUES('data_directory', '/opt/tissuestack/data', 'data directory (absolute system path on server)'); 15 | INSERT INTO configuration VALUES('temp_directory', '/tmp', 'temporary directory (absolute system path on server)'); 16 | INSERT INTO configuration VALUES('ands_dataset_xml', '/opt/tissuestack/ands/datasets.xml', 'ands data set xml'); 17 | INSERT INTO configuration VALUES('max_upload_size', '10000000000', 'the maximum number of bytes allowed to upload in one go'); 18 | INSERT INTO configuration VALUES('default_drawing_interval', '100', 'default drawing interval'); 19 | INSERT INTO configuration VALUES('default_zoom_levels', '[0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5]', 'default zoom levels'); 20 | INSERT INTO configuration VALUES('color_maps', 21 | '{"grey" : [[0, 0, 0, 0],[1, 1, 1, 1]], 22 | "hot" : [[0, 0, 0, 0], 23 | [0.25, 0.5, 0, 0], 24 | [0.5, 1, 0.5, 0], 25 | [0.75, 1, 1, 0.5], 26 | [1, 1, 1, 1]], 27 | "spectral" : [[0, 0, 0, 0], 28 | [0.05, 0.46667, 0, 0.05333], 29 | [0.1, 0.5333, 0, 0.6], 30 | [0.15, 0, 0, 0.6667], 31 | [0.2, 0, 0, 0.8667], 32 | [0.25, 0, 0.4667, 0.8667], 33 | [0.3, 0, 0.6, 0.8667], 34 | [0.35, 0, 0.6667, 0.6667], 35 | [0.4, 0, 0.6667, 0.5333], 36 | [0.45, 0, 0.6, 0], 37 | [0.5, 0, 0.7333, 0], 38 | [0.55, 0, 0.8667, 0], 39 | [0.6, 0, 1, 0], 40 | [0.65, 0.7333, 1, 0], 41 | [0.7, 0.9333, 0.9333, 0], 42 | [0.75, 1, 0.8, 0], 43 | [0.8, 1, 0.6, 0], 44 | [0.85, 1, 0, 0], 45 | [0.9, 0.8667, 0, 0], 46 | [0.95, 0.8, 0, 0], 47 | [1, 0.8, 0.8, 0.8]] 48 | }', 'default color mapping: grey, hot and spectral'); 49 | -------------------------------------------------------------------------------- /src/sql/create_tissuestack_db.sql: -------------------------------------------------------------------------------- 1 | -- CREATE OUR OWN USER 2 | CREATE ROLE tissuestack LOGIN PASSWORD 'tissuestack'; 3 | 4 | -- CREATE DB INSTANCE 5 | CREATE DATABASE tissuestack OWNER tissuestack; 6 | -------------------------------------------------------------------------------- /src/web/README: -------------------------------------------------------------------------------- 1 | ################################################################################## 2 | ########### TISSUE STACK - FRONTEND [ WEB SERVER, HTML, JS, CSS ] ############# 3 | ################################################################################## 4 | 5 | Technically any web server will do, Apache 2.2 or later is what is used 6 | as a dependency for all Tissue Stack binary packages. 7 | 8 | The following additional configuration steps are required: 9 | 10 | 1) If you want to allow other TissueStack instances to access your data sets, 11 | make sure your chosen web-server includes this header in its response: 12 | 13 | Access-Control-Allow-Origin "*" 14 | 15 | 2) The config and image services are accesssed in the front-end code via: 16 | "/server" 17 | 18 | A typical apache configuration (using mod_proxy) is: 19 | 20 | ProxyPass /server http://localhost:8080/TissueStack 21 | ProxyPassReverse /server http://localhost:8080/TissueStack 22 | -------------------------------------------------------------------------------- /src/web/css/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/ajax-loader.gif -------------------------------------------------------------------------------- /src/web/css/images/icons-png/action-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/action-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/action-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/action-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/alert-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/alert-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/alert-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/alert-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-d-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-d-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-d-l-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-d-l-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-d-l-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-d-l-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-d-r-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-d-r-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-d-r-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-d-r-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-d-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-d-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-l-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-l-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-l-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-l-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-r-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-r-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-r-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-r-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-u-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-u-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-u-l-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-u-l-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-u-l-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-u-l-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-u-r-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-u-r-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-u-r-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-u-r-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/arrow-u-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/arrow-u-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/audio-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/audio-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/audio-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/audio-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/back-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/back-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/back-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/back-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/bars-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/bars-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/bars-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/bars-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/bullets-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/bullets-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/bullets-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/bullets-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/calendar-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/calendar-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/calendar-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/calendar-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/camera-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/camera-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/camera-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/camera-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-d-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-d-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-d-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-d-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-l-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-l-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-l-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-l-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-r-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-r-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-r-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-r-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-u-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-u-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/carat-u-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/carat-u-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/check-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/check-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/check-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/check-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/clock-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/clock-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/clock-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/clock-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/cloud-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/cloud-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/cloud-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/cloud-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/comment-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/comment-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/comment-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/comment-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/delete-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/delete-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/delete-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/delete-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/edit-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/edit-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/edit-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/edit-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/eye-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/eye-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/eye-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/eye-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/forbidden-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/forbidden-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/forbidden-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/forbidden-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/forward-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/forward-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/forward-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/forward-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/gear-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/gear-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/gear-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/gear-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/grid-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/grid-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/grid-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/grid-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/heart-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/heart-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/heart-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/heart-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/home-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/home-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/home-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/home-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/info-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/info-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/info-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/info-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/location-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/location-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/location-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/location-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/lock-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/lock-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/lock-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/lock-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/mail-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/mail-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/mail-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/mail-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/minus-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/minus-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/minus-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/minus-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/navigation-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/navigation-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/navigation-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/navigation-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/phone-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/phone-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/phone-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/phone-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/plus-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/plus-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/plus-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/plus-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/power-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/power-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/power-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/power-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/recycle-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/recycle-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/recycle-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/recycle-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/refresh-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/refresh-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/refresh-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/refresh-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/search-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/search-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/search-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/search-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/shop-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/shop-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/shop-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/shop-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/star-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/star-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/star-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/star-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/tag-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/tag-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/tag-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/tag-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/user-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/user-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/user-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/user-white.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/video-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/video-black.png -------------------------------------------------------------------------------- /src/web/css/images/icons-png/video-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/css/images/icons-png/video-white.png -------------------------------------------------------------------------------- /src/web/embedded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tissue Stack - Embedded Example 7 | 8 | 9 | 10 | 11 | 12 | 42 | 43 | 44 |
45 |
Header
46 |
Some header
47 |
Some header
48 |
49 |
50 | 51 | 52 | 53 |
54 | 55 | 56 |
57 | 58 | 59 | 60 |
61 |
62 |
Footer
63 |
Some footer
64 |
Some footer
65 |
66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/web/images/admin/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/bg.jpg -------------------------------------------------------------------------------- /src/web/images/admin/bt_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/bt_close.png -------------------------------------------------------------------------------- /src/web/images/admin/bt_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/bt_open.png -------------------------------------------------------------------------------- /src/web/images/admin/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/tab_b.png -------------------------------------------------------------------------------- /src/web/images/admin/tab_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/tab_l.png -------------------------------------------------------------------------------- /src/web/images/admin/tab_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/tab_m.png -------------------------------------------------------------------------------- /src/web/images/admin/tab_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/admin/tab_r.png -------------------------------------------------------------------------------- /src/web/images/ands-full-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/ands-full-b.png -------------------------------------------------------------------------------- /src/web/images/cursor.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/cursor.cur -------------------------------------------------------------------------------- /src/web/images/cursor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/cursor.gif -------------------------------------------------------------------------------- /src/web/images/distance_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/distance_scale.png -------------------------------------------------------------------------------- /src/web/images/favicon_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/favicon_icon.png -------------------------------------------------------------------------------- /src/web/images/logo_EIF.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/logo_EIF.gif -------------------------------------------------------------------------------- /src/web/images/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/maximize.png -------------------------------------------------------------------------------- /src/web/images/mobile/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/ajax-loader.gif -------------------------------------------------------------------------------- /src/web/images/mobile/ajax-loader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/ajax-loader.png -------------------------------------------------------------------------------- /src/web/images/mobile/dataset-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/dataset-icons.gif -------------------------------------------------------------------------------- /src/web/images/mobile/dataset-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/dataset-loading.gif -------------------------------------------------------------------------------- /src/web/images/mobile/dataset-vline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/dataset-vline.gif -------------------------------------------------------------------------------- /src/web/images/mobile/icons-18-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/icons-18-black.png -------------------------------------------------------------------------------- /src/web/images/mobile/icons-18-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/icons-18-white.png -------------------------------------------------------------------------------- /src/web/images/mobile/icons-36-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/icons-36-black.png -------------------------------------------------------------------------------- /src/web/images/mobile/icons-36-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/icons-36-white.png -------------------------------------------------------------------------------- /src/web/images/mobile/ipadscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/mobile/ipadscreen.png -------------------------------------------------------------------------------- /src/web/images/phone/iphone3screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/iphone3screen.png -------------------------------------------------------------------------------- /src/web/images/phone/iphone4screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/iphone4screen.png -------------------------------------------------------------------------------- /src/web/images/phone/iphone5screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/iphone5screen.png -------------------------------------------------------------------------------- /src/web/images/phone/iphonescreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/iphonescreen.png -------------------------------------------------------------------------------- /src/web/images/phone/menuBg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/menuBg.gif -------------------------------------------------------------------------------- /src/web/images/phone/menuBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/menuBg.png -------------------------------------------------------------------------------- /src/web/images/phone/menuBgNEW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/menuBgNEW.png -------------------------------------------------------------------------------- /src/web/images/phone/menuIconsSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/phone/menuIconsSprite.png -------------------------------------------------------------------------------- /src/web/images/select_bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/select_bk.png -------------------------------------------------------------------------------- /src/web/images/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/swap.png -------------------------------------------------------------------------------- /src/web/images/swap_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/swap_button.png -------------------------------------------------------------------------------- /src/web/images/uq-logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/images/uq-logo.gif -------------------------------------------------------------------------------- /src/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tissue Stack 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/web/js/TissueStack.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of TissueStack. 3 | * 4 | * TissueStack is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * TissueStack is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with TissueStack. If not, see . 16 | */ 17 | if (typeof(TissueStack) == 'undefined') { 18 | TissueStack = {}; 19 | }; 20 | 21 | TissueStack.configuration = { 22 | server_proxy_path : 23 | { value: "server", 24 | description: "tissue stack server proxy path (relative to the application''s web root directory)" 25 | }, 26 | tile_directory : 27 | { value: "tile_directory", 28 | description: "tissue stack tile directory (relative to the application''s web root directory)" 29 | } 30 | }; 31 | TissueStack.debug = true; 32 | TissueStack.color_maps = null; 33 | TissueStack.sync_datasets = false; 34 | TissueStack.overlay_datasets = false; 35 | TissueStack.planes_swapped = false; 36 | TissueStack.indexed_color_maps = { 37 | "grey" : null, 38 | "hot" : null, 39 | "spectral" : null 40 | }; 41 | TissueStack.tasks = {}; 42 | TissueStack.cookie_lock = false; 43 | TissueStack.lastWindowResizing = new Date().getTime(); 44 | TissueStack.transparency = 0.5; 45 | TissueStack.reverseOverlayOrder = false; 46 | TissueStack.swappedOverlayOrder = false; 47 | TissueStack.mouseOverDataSet = -1; 48 | TissueStack.useUserParameters = false; 49 | -------------------------------------------------------------------------------- /src/web/js/libs/jquery/skin/dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/js/libs/jquery/skin/dataset.png -------------------------------------------------------------------------------- /src/web/js/libs/jquery/skin/image_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/js/libs/jquery/skin/image_service.png -------------------------------------------------------------------------------- /src/web/js/libs/jquery/skin/ontology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/js/libs/jquery/skin/ontology.png -------------------------------------------------------------------------------- /src/web/js/libs/jquery/skin/ontology_part.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/js/libs/jquery/skin/ontology_part.png -------------------------------------------------------------------------------- /src/web/js/libs/jquery/skin/pre_tiled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NIF-au/TissueStack/5db61724f294dd2ca77e89161ef95324e98d5c17/src/web/js/libs/jquery/skin/pre_tiled.png --------------------------------------------------------------------------------