Commit 94bdefbb authored by Caillat Michel's avatar Caillat Michel
Browse files

Work in progress

parent b129cc6f
......@@ -108,6 +108,17 @@ class DataBlock:
def getRenderingCapabilities(cls):
return DataBlock.__renderingCapabilities
@classmethod
def getDefaultITTName(cls):
return DataBlock.__default_transformation_name
@classmethod
def getDefaultLUTName(cls):
return DataBlock.__default_palette_name
@classmethod
def getDefaultVMName
@classmethod
def convert_size(cls, sizeInBytes):
if sizeInBytes == 0:
......@@ -743,7 +754,8 @@ class DataBlock:
self.__logger.debug("getAverage: exiting")
return {"status": True, "message": "", "result": result.tolist()}
def getOneSliceAsPNG (self, sliceIndex, transformation_name, palette_name, video_mode_name):
def getOneSliceAsPNG (self, sliceIndex, transformation_name=DataBlock.__default_transformation_name, palette_name=DataBlock.__default_palette_name, \
video_mode_name=DataBlock.__default_video_mode_name):
self.__logger.debug("getOneSliceAsPNG: entering.")
self.__logger.debug("Video mode name = %s" % video_mode_name)
self.__logger.debug("sliceIndex = %r" % (sliceIndex))
......
......@@ -280,7 +280,7 @@ class DataManagerImpl :
self.__logger.debug("getAverage : exiting")
return result
def getOneSliceAsPNG (self, sliceIndex, relFITSFilePath, transformation_name=__default_transformation_name, palette_name=__default_palette_name, video_mode_name=__default_video_mode_name):
def getOneSliceAsPNG (self, sliceIndex, relFITSFilePath, transformation_name=None, palette_name=None, video_mode_name=None):
self.__logger.debug("getOneSliceAsPNG : entering.")
self.__logger.debug("sliceIndex = %r, relFITSFilePath = %r" % (sliceIndex, relFITSFilePath))
result = self.__checkPresence(relFITSFilePath)
......
......@@ -430,10 +430,11 @@ def getOneSliceAsPNG():
body = byteify(json.loads(request_body))
relFITSFilePath = rebuildFilename(body['relFITSFilePath'])
sliceIndex = getIntValue(body['sliceIndex'])
ittName = body['ittName']
lutName = body['lutName']
vmName = body['vmName']
sessionID = getIntValue(body['sessionID'])
ittName = 'ittName' in body ? body['ittName'] : None
lutName = 'lutName' in body ? body['lutName'] : None
vmName = 'vmName' in body ? body['vmName'] : None
sessionID = 'sessionID' in body ? body['sessionID'] : 0
ret = dm.getOneSliceAsPNG(sliceIndex, relFITSFilePath, ittName,lutName, vmName)
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment