Permalink
Browse files

first working iip + openslide build

  • Loading branch information...
1 parent 8613d63 commit eca4004303f847c09cff5dc055b46c75695b0886 @richstoner committed Sep 24, 2013
Showing with 825 additions and 4 deletions.
  1. +25 −0 src/CVT.cc
  2. +1 −1 src/Environment.h
  3. +12 −0 src/FIF.cc
  4. +1 −1 src/Main.cc
  5. +5 −2 src/Makefile.am
  6. +638 −0 src/OpenSlideImage.cc
  7. +143 −0 src/OpenSlideImage.h
View
@@ -178,6 +178,10 @@ void CVT::run( Session* session, const std::string& a ){
session->view->getLayers(),
view_left, view_top, view_width, view_height );
+ *(session->logfile) << "Openslide test :: getting here" << endl;
+
+
+
if( session->loglevel >= 4 ){
if( session->view->getContrast() != 1.0 ){
*(session->logfile) << "CVT :: Applying contrast of: " << session->view->getContrast() << endl;
@@ -186,6 +190,8 @@ void CVT::run( Session* session, const std::string& a ){
<< " bit data to 8" << endl;
}
+ *(session->logfile) << "Openslide test :: getting here 1" << endl;
+
// Convert CIELAB to sRGB
if( (*session->image)->getColourSpace() == CIELAB ){
@@ -201,6 +207,8 @@ void CVT::run( Session* session, const std::string& a ){
}
}
+ *(session->logfile) << "Openslide test :: getting here 2" << endl;
+
// Apply color mapping if requested
if( session->view->cmapped ){
@@ -212,6 +220,8 @@ void CVT::run( Session* session, const std::string& a ){
channels = 3;
}
+ *(session->logfile) << "Openslide test :: getting here 3" << endl;
+
// Apply hill shading if requested
if( session->view->shaded ){
@@ -223,6 +233,8 @@ void CVT::run( Session* session, const std::string& a ){
channels = 1;
}
+ *(session->logfile) << "Openslide test :: getting here 4" << endl;
+
// Resize our image as requested. Use the interpolation method requested in the server configuration.
// - Use bilinear interpolation by default
@@ -249,6 +261,9 @@ void CVT::run( Session* session, const std::string& a ){
}
}
+ *(session->logfile) << "Openslide test :: getting here 5" << endl;
+
+
// Apply any gamma correction
if( session->view->getGamma() != 1.0 ){
@@ -260,10 +275,17 @@ void CVT::run( Session* session, const std::string& a ){
}
+ *(session->logfile) << "Openslide test :: getting here 6" << endl;
+
+
// Apply any contrast adjustments and/or clipping to 8bit from 16bit or 32bit
filter_contrast( complete_image, session->view->getContrast(), (*session->image)->max, (*session->image)->min );
+ *(session->logfile) << "Openslide test :: getting here 7" << endl;
+
+
+
// Convert to greyscale if requested
if( (*session->image)->getColourSpace() == sRGB && session->view->colourspace == GREYSCALE ){
@@ -281,6 +303,9 @@ void CVT::run( Session* session, const std::string& a ){
}
}
+ *(session->logfile) << "Openslide test :: getting here 8" << endl;
+
+
// Apply rotation - can apply this safely after gamma and contrast adjustment
if( session->view->getRotation() != 0.0 ){
View
@@ -26,7 +26,7 @@
*/
#define VERBOSITY 1
#define LOGFILE "/tmp/iipsrv.log"
-#define MAX_IMAGE_CACHE_SIZE 10.0
+#define MAX_IMAGE_CACHE_SIZE 0.0
#define FILENAME_PATTERN "_pyr_"
#define JPEG_QUALITY 75
#define MAX_CVT 5000
View
@@ -31,6 +31,8 @@
#define MAXIMAGECACHE 500 // Max number of items in image cache
+#include "OpenSlideImage.h"
+
using namespace std;
@@ -122,6 +124,7 @@ void FIF::run( Session* session, const string& src ){
// Check whether cache is empty
if( session->imageCache->empty() ){
+ // if( true ){
if( session->loglevel >= 1 ) *(session->logfile) << "FIF :: Image cache initialisation" << endl;
test = IIPImage( argument );
test.setFileNamePattern( filename_pattern );
@@ -164,6 +167,15 @@ void FIF::run( Session* session, const string& src ){
if( session->loglevel >= 2 ) *(session->logfile) << "FIF :: TIFF image requested" << endl;
*session->image = new TPTImage( test );
}
+#pragma mark Adding in basic openslide functionality
+ else if (imtype=="svs") {
+
+ if( session->loglevel >= 2 ) *(session->logfile) << "FIF :: OpenSlide image requested" << endl;
+
+ *session->image = new OpenSlideImage( test );
+
+ }
+
#ifdef HAVE_KAKADU
else if( imtype=="jpx" || imtype=="jp2" || imtype=="j2k" ){
if( session->loglevel >= 2 ) *(session->logfile) << "FIF :: JPEG2000 image requested" << endl;
View
@@ -75,7 +75,7 @@ static void unsetenv(char *env_name) {
#endif
-//#define DEBUG 1
+// #define DEBUG 1
using namespace std;
View
@@ -4,8 +4,9 @@ noinst_PROGRAMS = iipsrv.fcgi
INCLUDES = @INCLUDES@ @LIBFCGI_INCLUDES@ @JPEG_INCLUDES@ @TIFF_INCLUDES@
-LIBS = @LIBS@ @LIBFCGI_LIBS@ @DL_LIBS@ @JPEG_LIBS@ @TIFF_LIBS@ -lm
-AM_LDFLAGS = @LIBFCGI_LDFLAGS@
+LIBS = @LIBS@ @LIBFCGI_LIBS@ @DL_LIBS@ @JPEG_LIBS@ @TIFF_LIBS@ -lm -lopenslide
+AM_LDFLAGS = @LIBFCGI_LDFLAGS@ -L/usr/local/lib/openslide
+AM_CPPFLAGS = -I/usr/local/include/openslide
iipsrv_fcgi_LDADD = Main.o
@@ -28,6 +29,8 @@ iipsrv_fcgi_SOURCES = \
IIPImage.cc \
TPTImage.h \
TPTImage.cc \
+ OpenSlideImage.h \
+ OpenSlideImage.cc \
JPEGCompressor.h \
JPEGCompressor.cc \
RawTile.h \
Oops, something went wrong.

0 comments on commit eca4004

Please sign in to comment.