From b118bb2eeaac852648b5a66034744d2a00f31329 Mon Sep 17 00:00:00 2001
From: Kevin <34067195+KevinNamink@users.noreply.github.com>
Date: Tue, 26 Sep 2023 09:59:06 +0200
Subject: [PATCH 01/11] Update credits.php regarding contributors from SVI.
---
credits.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/credits.php b/credits.php
index 9559631d1..607b07fbd 100644
--- a/credits.php
+++ b/credits.php
@@ -82,7 +82,7 @@
ETH Zurich;
- Daniel Sevilla,
+ Kevin Namink,
Scientific Volume Imaging;
@@ -126,6 +126,11 @@
Former developers
+ -
+ Daniel Sevilla,
+
+ Scientific Volume Imaging;
+
-
Asheesh Gulati,
From a394dbdc66907e23a397835039981d1ec9d6620b Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Tue, 24 Oct 2023 12:53:53 +0200
Subject: [PATCH 02/11] Fixed the end time shown in the Log tab of the Details
results.
---
inc/QueueManager.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/inc/QueueManager.php b/inc/QueueManager.php
index 26f0dabf7..a5ff10925 100644
--- a/inc/QueueManager.php
+++ b/inc/QueueManager.php
@@ -808,9 +808,9 @@ public function updateJobAndServerStatus()
// Remove all the transferred files from the processing server.
$this->cleanUpRemoteServer($job);
- // Reset server and remove job from the job queue
+ // Reset server and remove job from the job queue.
$this->stopTime = $queue->stopJob($job);
- $this->assembleJobLogFile($job, $startTime, $logFile, $errorFile);
+ $this->assembleJobLogFile($job, $startTime, $this->stopTime, $logFile, $errorFile);
// Write email
if ($send_mail) {
@@ -838,7 +838,7 @@ public function updateJobAndServerStatus()
* @param string $errorFile Full path to the errorlog file.
* @return string Job log to be displayed.
*/
- public function assembleJobLogFile($job, $startTime, $logFile, $errorFile)
+ public function assembleJobLogFile($job, $startTime, $endTime, $logFile, $errorFile)
{
$result = false;
$desc = $job->description();
@@ -855,7 +855,7 @@ public function assembleJobLogFile($job, $startTime, $logFile, $errorFile)
// Message
$text = '';
$text .= "Job id: $id (pid $pid on $server), started " .
- "at $startTime and finished at " . date("Y-m-d H:i:s") . "\n\n";
+ "at $startTime and finished at $endTime \n\n";
if (file_exists($errorFile)) {
$text .= "- HUYGENS ERROR REPORT (stderr) --------------\n\n" . file_get_contents($errorFile);
From 1d1e6177c6e526e5293ed31806a9205bdd54be08 Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Tue, 24 Oct 2023 15:28:28 +0200
Subject: [PATCH 03/11] Improve handling of long file names.
---
inc/DatabaseConnection.php | 3 +++
inc/job/JobDescription.php | 7 +++++++
2 files changed, 10 insertions(+)
diff --git a/inc/DatabaseConnection.php b/inc/DatabaseConnection.php
index 26a8f57aa..67c71d47c 100644
--- a/inc/DatabaseConnection.php
+++ b/inc/DatabaseConnection.php
@@ -1293,6 +1293,9 @@ public function addFileToJob($id, $owner, $file, $autoseries)
$sqlAutoSeries = "T";
}
$slashesFile = addslashes($file);
+ if (strlen($slashesFile) > 191) {
+ Log::error("File name too long!");
+ }
$query = "insert into job_files values ('$id', '$username', '$slashesFile', '$sqlAutoSeries')";
$result = $result && $this->execute($query);
return $result;
diff --git a/inc/job/JobDescription.php b/inc/job/JobDescription.php
index a2320f14e..dab95f944 100644
--- a/inc/job/JobDescription.php
+++ b/inc/job/JobDescription.php
@@ -547,6 +547,13 @@ public function destinationImageName()
$tmp = explode($taskSetting->name(), $this->sourceImageShortName());
$outputFile = end($tmp);
$outputFile = str_replace(" ", "_", $outputFile);
+ // Max final file name length is 128 characters, truncate if
+ // necessary. Reserve enough space for all possible extra suffixes.
+ $pathInfo = pathinfo($outputFile);
+ if (strlen($pathInfo['basename']) > 76) {
+ $outputFile = $pathInfo['dirname'] . "/";
+ $outputFile .= substr($pathInfo['basename'], 0, 70) . "_trunc";
+ }
$result = $outputFile . "_" . $this->id() . "_hrm";
# Add a non-numeric string at the end: if the task name ends with a
# number, that will be removed when saving using some file formats that
From 2558d0b7a9ec5c48423548b4b40508cf1c27585b Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Fri, 8 Dec 2023 15:54:39 +0100
Subject: [PATCH 04/11] Fix destination image name by replacing : characters to
_ characters, otherwise this causes the job to be reported as failing no
matter what.
---
inc/job/JobDescription.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inc/job/JobDescription.php b/inc/job/JobDescription.php
index dab95f944..db606b8f7 100644
--- a/inc/job/JobDescription.php
+++ b/inc/job/JobDescription.php
@@ -546,7 +546,7 @@ public function destinationImageName()
// (see http://stackoverflow.com/questions/4636166/ for more details)
$tmp = explode($taskSetting->name(), $this->sourceImageShortName());
$outputFile = end($tmp);
- $outputFile = str_replace(" ", "_", $outputFile);
+ $outputFile = str_replace(array(" ",":"), "_", $outputFile);
// Max final file name length is 128 characters, truncate if
// necessary. Reserve enough space for all possible extra suffixes.
$pathInfo = pathinfo($outputFile);
From 4db62bbbd9e6fbd00587642c0ee82ecf3ac898d6 Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Fri, 12 Jan 2024 11:58:14 +0100
Subject: [PATCH 05/11] Fixed difference in start and end time in statistics,
now always using database time.
---
inc/DatabaseConnection.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/inc/DatabaseConnection.php b/inc/DatabaseConnection.php
index 67c71d47c..71c462e0c 100644
--- a/inc/DatabaseConnection.php
+++ b/inc/DatabaseConnection.php
@@ -1452,7 +1452,6 @@ public function updateStatistics(Job $job, $startTime)
$taskSetting = $desc->taskSetting();
$analysisSetting = $desc->analysisSetting();
- $stopTime = date("Y-m-d H:i:s");
$id = $desc->id();
/** @var UserV2 $user */
$user = $desc->owner();
@@ -1470,8 +1469,9 @@ public function updateStatistics(Job $job, $startTime)
$parameter = $analysisSetting->parameter('ColocAnalysis');
$colocAnalysis = $parameter->value();
+ // Note: both startTime and endTime are now set in database time.
$query = "insert into statistics values ('$id', '$owner', '$group', " .
- "'$startTime', '$stopTime', '$inFormat', '$outFormat', " .
+ "'$startTime', NOW(), '$inFormat', '$outFormat', " .
"'$PSF', '$microscope', '$colocAnalysis')";
$this->execute($query);
From 40365d181dca6a0b4ca1383d990b733ca600a832 Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Wed, 17 Jan 2024 13:45:17 +0100
Subject: [PATCH 06/11] Fixes for 14 parameter chromatic aberration in GUI and
fixe for iteration and quality threshold in GUI.
---
inc/HuygensTemplate.php | 8 +++++++-
inc/param/ChromaticAberration.php | 19 +++++++++++++++++--
post_processing.php | 12 ++++++++----
scripts/common.js | 14 ++++++++++++--
4 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/inc/HuygensTemplate.php b/inc/HuygensTemplate.php
index 1e254bb77..52b2f58b6 100644
--- a/inc/HuygensTemplate.php
+++ b/inc/HuygensTemplate.php
@@ -1189,9 +1189,15 @@ private function getImgTaskDescrChromatic()
case 'lambdaEx':
case 'lambdaSted':
case 'mType':
- case 'estMethod':
$taskDescr .= $chromValue;
break;
+ case 'estMethod':
+ if ($chromaticParam->componentCnt() > 5) {
+ $taskDescr .= '6';
+ } else {
+ $taskDescr .= $chromValue;
+ }
+ break;
case 'channel':
$taskDescr .= $chan;
break;
diff --git a/inc/param/ChromaticAberration.php b/inc/param/ChromaticAberration.php
index d36dc88dd..2b4d93a37 100644
--- a/inc/param/ChromaticAberration.php
+++ b/inc/param/ChromaticAberration.php
@@ -98,7 +98,7 @@ public function componentCnt()
*/
public function shownComponentCnt()
{
- return $this->componentCnt();
+ return 5;
}
/**
@@ -127,7 +127,7 @@ public function isVariableChannel()
public function displayString($chanCnt = 0)
{
// Don't show anything when the channel is irrelevant.
- if ($this->channel > $chanCnt) {
+ if ($this->channel >= $chanCnt) {
return "";
}
return rtrim($this->value->displayString(), ", \n\r\t\v\x00"). "\n";
@@ -168,6 +168,21 @@ public function setValue($values)
$valuesArray = array("0","0","0","0","1",null,null,null,
null,null,null,null,null,null);
}
+
+ // If only 5 values are present, fill the rest with nulls.
+ if (sizeof($valuesArray) == 5) {
+ array_push($valuesArray,
+ null,null,null,null,null,null,null,null,null);
+ $this->componentCnt = 5;
+ } else {
+ $this->componentCnt = 14;
+ foreach ($valuesArray as $val) {
+ if ($val == null || $val == "") {
+ $this->componentCnt = 5;
+ break;
+ }
+ }
+ }
//error_log(implode('_', $valuesArray));
$this->value->setValue($valuesArray);
diff --git a/post_processing.php b/post_processing.php
index af2e9e05c..c6fde5aca 100644
--- a/post_processing.php
+++ b/post_processing.php
@@ -170,7 +170,12 @@ class="selection"
-
+
-
|
name="ChromaticAberrationDiscardOtherCh"
title="Discard this channel's other components to edit the remaining"
value="Discard other"
- value()[13] == null) { echo 'hidden=true'; }?>
+ componentCnt() == 5) { echo 'hidden=true'; }?>
onclick="editChromaticChannelWith14Params()"/>
(ratio)';
+
// Round the values to 5 decimals. This both makes it easier to edit and
// ensures the new values are saved properly.
var tableTag = "ChromaticAberrationTable";
@@ -328,7 +331,12 @@ function editChromaticChannelWith14Params(channel) {
for (var component = 0; component < componentCnt; component++) {
var id = channelTag + "Ch" + channel + "_" + component;
inputElement = document.getElementById(id);
- var rounded = Math.round(inputElement.value * 100000) / 100000;
+ if (component == 4) {
+ var rounded = Math.round(Math.pow(10, inputElement.value / 10)
+ * 100000) / 100000;
+ } else {
+ var rounded = Math.round(inputElement.value * 100000) / 100000;
+ }
inputElement.value = rounded;
}
@@ -351,7 +359,9 @@ function updateDeconEntryProperties( ) {
"SignalNoiseRatioGMLE",
"SignalNoiseRatioSKIP",
"Acuity",
- "BackgroundOffsetPercent"];
+ "BackgroundOffsetPercent",
+ "q",
+ "it"];
var skipAllChannels = true;
From 56dbfbda5eee52a0505b1f3dc76d90e181fd4932 Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Fri, 19 Jan 2024 10:08:22 +0100
Subject: [PATCH 07/11] Fix for some issues with subimage previews. Maybe a
more complete fix should come later.
---
scripts/hucore.tcl | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/scripts/hucore.tcl b/scripts/hucore.tcl
index 682053571..f954f018d 100644
--- a/scripts/hucore.tcl
+++ b/scripts/hucore.tcl
@@ -194,6 +194,42 @@ proc hrmImgOpen { dir file args } {
set matched [regexp $exp $path match path subimage]
if { $matched } {
+
+ # Check if the subimage matches. The agressive sanitization in the
+ # HRM will replace ":" with "_" in the subimage name.
+ if {[string first "_" $subimage] > -1} {
+
+ set cmd "img preOpen \"$path\""
+ if { [ catch {
+ set res [eval $cmd]
+ } res ] } {
+ reportError "$res"
+ reportError "command: $cmd"
+ return -1
+ }
+ set subImages {}
+ set extension [file extension $path]
+ if { [string equal -nocase $extension ".czi"]
+ || [string equal -nocase $extension ".nd"]} {
+ set subImages [lindex $res 1]
+ } elseif { [string equal -nocase $extension ".lif"]
+ || [string equal -nocase $extension ".lof"]
+ || [string equal -nocase $extension ".msr"]
+ || [string equal -nocase $extension ".obf"] } {
+ set resDict [dict create {*}[lindex $res 1]]
+ set subImages [dict keys $resDict]
+ }
+ if {$subimage ni $subImages} {
+ foreach sub $subImages {
+ set replacedSubImage [regsub -all {\:} $sub {_}]
+ if {$subimage eq $replacedSubImage} {
+ set subimage $sub
+ break
+ }
+ }
+ }
+ }
+
# puts "Opening image: '$path' -subImage $subimage"
set cmd "img open \"$path\" -subImage \"$subimage\" $args"
if { [ catch {
From 4ab85efcb991e196331acc935b42c0515f154a51 Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Fri, 19 Jan 2024 10:24:30 +0100
Subject: [PATCH 08/11] Added MSR and OBF files.
---
ajax/json-rpc-server.php | 7 ++
inc/FileBrowser.php | 6 +-
inc/Fileserver.php | 4 +
inc/HuygensTemplate.php | 2 +-
inc/QueueManager.php | 2 +-
inc/System.php | 2 +-
inc/job/JobDescription.php | 2 +-
scripts/common.js | 4 +-
scripts/hucore.tcl | 9 ++-
setup/dbupdate.php | 150 +++++++++++++++++++++++++++++++++++++
10 files changed, 177 insertions(+), 11 deletions(-)
diff --git a/ajax/json-rpc-server.php b/ajax/json-rpc-server.php
index 5576986a5..0b17f7282 100644
--- a/ajax/json-rpc-server.php
+++ b/ajax/json-rpc-server.php
@@ -909,6 +909,11 @@ function jsonGetFileFormats()
$translations = array();
foreach ($formats as $key => $format) {
$translations[$key] = $fileFormat->translatedValueFor($format);
+
+ // Ensure "all" is on top. Temporarily set to zeroes.
+ if ($format == "all") {
+ $translations[$key] = "000";
+ }
}
// This sort function maintains the key/value associations.
@@ -918,7 +923,9 @@ function jsonGetFileFormats()
foreach ($translations as $key => $translation) {
$format = $formats[$key];
+ // Restore "all" text and append please choose text.
if ($format == "all") {
+ $translation = $fileFormat->translatedValueFor($format);
$translation .= " Please choose a file format ...";
}
diff --git a/inc/FileBrowser.php b/inc/FileBrowser.php
index 020eca959..498cee331 100644
--- a/inc/FileBrowser.php
+++ b/inc/FileBrowser.php
@@ -535,7 +535,7 @@ class="selection"
"DestinationFolder" : "sourceFolder()); ?>",
"ImageExtensions" : ['dv', 'ims', 'lif', 'lof', 'lsm', 'vsi', 'oif', 'pic', 'r3d', 'stk',
'zvi', 'czi', 'nd2', 'nd', 'tf2', 'tf8', 'btf', 'h5', 'tif', 'tiff', 'ome.tif',
- 'ome.tiff', 'ome', 'ics', 'ids']
+ 'ome.tiff', 'ome', 'msr', 'obf', 'ics', 'ids']
}
},
chunking: {
@@ -554,10 +554,10 @@ class="selection"
stopOnFirstInvalidFile: false,
sizeLimit: totalAllowedSizeOfSingleFile,
acceptFiles: ".dv,.ims,.lif,.lof,.lsm,.vsi,.oif,.pic,.3rd,.stk,.zvi,.czi,.nd2,.nd,.tf2,.tf8,.btf,.h5," +
- ".tif,.tiff,.ome.tif,.ome.tiff,.ics,.ids,.zip,.tgz,.tar,.tar.gz",
+ ".tif,.tiff,.ome.tif,.ome.tiff,.msr,.obf,.ics,.ids,.zip,.tgz,.tar,.tar.gz",
allowedExtensions: ['dv', 'ims', 'lif', 'lof', 'lsm', 'vsi', 'oif', 'pic', 'r3d', 'stk',
'zvi', 'czi', 'nd2', 'nd', 'tf2', 'tf8', 'btf', 'h5', 'tif', 'tiff', 'ome.tif',
- 'ome.tiff', 'ome', 'ics', 'ids', 'zip', 'tgz', 'tar', 'tar.gz'],
+ 'ome.tiff', 'ome', 'msr', 'obf', 'ics', 'ids', 'zip', 'tgz', 'tar', 'tar.gz'],
},
resume: {
enabled: true
diff --git a/inc/Fileserver.php b/inc/Fileserver.php
index 1409a7800..bf4b337de 100644
--- a/inc/Fileserver.php
+++ b/inc/Fileserver.php
@@ -238,6 +238,8 @@ public function fileToConfidenceLevelFormat($file)
case 'czi':
case 'nd2':
case 'nd':
+ case 'msr':
+ case 'obf':
case 'hdf5':
case 'ics':
$fileFormat = $fileExtension;
@@ -314,6 +316,8 @@ public function checkAgainstFormat($file, $selectedFormat)
case 'tf2':
case 'tf8':
case 'btf':
+ case 'msr':
+ case 'obf':
$fileFormat = $fileExtension;
break;
case 'h5':
diff --git a/inc/HuygensTemplate.php b/inc/HuygensTemplate.php
index 52b2f58b6..1b125b803 100644
--- a/inc/HuygensTemplate.php
+++ b/inc/HuygensTemplate.php
@@ -3315,7 +3315,7 @@ private function setSrcImage()
/*If a (string) comes after the file name, the string is interpreted
as a subimage. Currently this is for LIF, LOF and CZI files only. */
- if (preg_match("/^(.*\.(lif|czi|lof|nd))\s\((.*)\)/i",
+ if (preg_match("/^(.*\.(lif|czi|lof|nd|msr|obf))\s\((.*)\)/i",
$this->srcImage, $match)) {
$this->srcImage = $match[1];
$this->subImage = $match[3]; // @todo Is this correct?
diff --git a/inc/QueueManager.php b/inc/QueueManager.php
index a5ff10925..c96a33371 100644
--- a/inc/QueueManager.php
+++ b/inc/QueueManager.php
@@ -260,7 +260,7 @@ public function copyImagesToServer(Job $job, $server_hostname)
foreach ($files as $file) {
$counter++;
$match = array();
- if (preg_match("/^(.*\.(lif|lof|czi|nd))\s\((.*)\)/i", $file, $match)) {
+ if (preg_match("/^(.*\.(lif|lof|czi|nd|obf|msr))\s\((.*)\)/i", $file, $match)) {
$filteredFiles[$counter] = $match[1];
} else {
$filteredFiles[$counter] = $file;
diff --git a/inc/System.php b/inc/System.php
index 829a034c4..c065901c0 100644
--- a/inc/System.php
+++ b/inc/System.php
@@ -49,7 +49,7 @@ class System
* set by the developers!
* @var int
*/
- private const DB_LAST_REVISION = 20;
+ private const DB_LAST_REVISION = 21;
/**
* Minimum HuCore (major) version number to be compatible with HRM.
diff --git a/inc/job/JobDescription.php b/inc/job/JobDescription.php
index db606b8f7..9ec8be54d 100644
--- a/inc/job/JobDescription.php
+++ b/inc/job/JobDescription.php
@@ -506,7 +506,7 @@ public function sourceImageShortName()
//$parameterSetting = $this->parameterSetting;
//$parameter = $parameterSetting->parameter('ImageFileFormat');
//$fileFormat = $parameter->value();
- if (preg_match("/^(.*)\.(lif|lof|czi|nd)\s\((.*)\)/i", $inputFile[0], $match)) {
+ if (preg_match("/^(.*)\.(lif|lof|czi|nd|msr|obf)\s\((.*)\)/i", $inputFile[0], $match)) {
$inputFile = $match[1] . '_' . $match[2] . '_' . $match[3];
} else {
$inputFile = substr(end($inputFile), 0, strrpos(end($inputFile), "."));
diff --git a/scripts/common.js b/scripts/common.js
index a4e82cd09..0bd9046d9 100644
--- a/scripts/common.js
+++ b/scripts/common.js
@@ -576,7 +576,7 @@ function checkAgainstFormat(file, selectedFormat) {
// Pattern ome.tiff = (\.([^\..]+))*
// Pattern file extension: = \.([A-Za-z0-9]+)
- // Pattern lif, czi subimages: = (\s\(.*\))*
+ // Pattern lif, czi, obf subimages: = (\s\(.*\))*
var nameDivisions;
nameDivisions = file.match(/(\.([^\..]+))*\.([A-Za-z0-9]+)(\s\(.*\))*$/);
@@ -616,6 +616,8 @@ function checkAgainstFormat(file, selectedFormat) {
case 'tf2':
case 'tf8':
case 'btf':
+ case 'msr':
+ case 'obf':
fileFormat = fileExtension;
break;
case 'h5':
diff --git a/scripts/hucore.tcl b/scripts/hucore.tcl
index f954f018d..68c598827 100644
--- a/scripts/hucore.tcl
+++ b/scripts/hucore.tcl
@@ -83,9 +83,9 @@ proc reportImageDimensions { } {
# Auxiliary procedure isMultiImgFile.
# Return 1 if the image is of a type that supports sub-images. Currently, only
-# LIF, LOF and CZI.
+# LIF, LOF, CZI, MSR and OBF.
proc isMultiImgFile { filename } {
- set multiImgExtensions { ".lif" ".lof" ".czi" ".nd"}
+ set multiImgExtensions { ".lif" ".lof" ".czi" ".nd" ".msr" ".obf"}
set ext [file extension $filename]
set isMulti 0
@@ -164,7 +164,10 @@ proc reportSubImages {} {
} elseif { [string equal -nocase $extension ".nd"] } {
set subImages [lindex $contents 1]
} elseif { [string equal -nocase $extension ".lif"]
- || [string equal -nocase $extension ".lof"]} {
+ || [string equal -nocase $extension ".lof"]
+ || [string equal -nocase $extension ".msr"]
+ || [string equal -nocase $extension ".obf"]
+ } {
set resDict [dict create {*}[lindex $contents 1]]
set subImages [dict keys $resDict]
diff --git a/setup/dbupdate.php b/setup/dbupdate.php
index 73e7c1361..43dc8c150 100644
--- a/setup/dbupdate.php
+++ b/setup/dbupdate.php
@@ -6843,6 +6843,156 @@ function in_array_multi($needle,$haystack) {
write_to_log($msg);
}
+
+
+// -----------------------------------------------------------------------------
+// Update to revision 21
+// Description:
+// * Add Aberrior MSR and OBF file support.
+// -----------------------------------------------------------------------------
+$n = 21;
+if ($current_revision < $n) {
+
+
+ // Add Aberrior MSR file to possible_values
+ $tabname = 'possible_values';
+ $record = array();
+ $record["parameter"] = 'ImageFileFormat';
+ $record["value"] = 'msr';
+ $record["translation"] = 'Abberior MSR (*.msr)';
+ $record["isDefault"] = 'f';
+ // Skip it if the row is already there.
+ $query = "SELECT * FROM " . $tabname . " WHERE parameter='" .
+ $record['parameter'] . "' AND value='" . $record['value'] . "' " .
+ " AND translation='" . $record["translation"] . "' AND isDefault='" .
+ $record["isDefault"] . "'";
+ if ($db->Execute($query)->RecordCount() == 0) {
+ if (!$db->AutoExecute($tabname, $record, 'INSERT')) {
+ $msg = "Could not add entry for Abberior MSR in table 'possible_values'.";
+ write_message($msg);
+ write_to_error($msg);
+ return false;
+ }
+ }
+
+ // Add Aberrior MSR file to file_extension
+ $tabname = "file_extension";
+ $record = array();
+ $record["file_format"] = "msr";
+ $record["extension"] = "msr";
+ // Skip it if the row is already there.
+ $query = "SELECT * FROM " . $tabname .
+ " WHERE file_format='" . $record['file_format'] .
+ "' AND extension='" . $record['extension'] . "'";
+ if ($db->Execute($query)->RecordCount() == 0) {
+ $insertSQL = $db->GetInsertSQL($tabname, $record);
+ if (!$db->Execute($insertSQL)) {
+ $msg = "Could not add entry for Abberior MSR in table 'file_extension'.";
+ write_message($msg);
+ write_to_error($msg);
+ return;
+ }
+ }
+
+ // Add Aberrior MSR file to file_format
+ $tabname = "file_format";
+ $record = array();
+ $record["name"] = "msr";
+ $record["isFixedGeometry"] = "f";
+ $record["isSingleChannel"] = "f";
+ $record["isVariableChannel"] = "t";
+ $record["ismultifile"] = 't';
+ $record["hucoreName"] = "msr";
+ // Skip it if the row is already there.
+ $query = "SELECT * FROM " . $tabname .
+ " WHERE name='" . $record['name'] . "'";
+ if ($db->Execute($query)->RecordCount() == 0) {
+ $insertSQL = $db->GetInsertSQL($tabname, $record);
+ if (!$db->Execute($insertSQL)) {
+ $msg = "An error occurred while updating " .
+ "the database to revision " . $n . ".";
+ write_message($msg);
+ write_to_error($msg);
+ return;
+ }
+ }
+
+ // Add Aberrior OBF file to possible_values
+ $tabname = 'possible_values';
+ $record = array();
+ $record["parameter"] = 'ImageFileFormat';
+ $record["value"] = 'obf';
+ $record["translation"] = 'Abberior MSR (*.obf)';
+ $record["isDefault"] = 'f';
+ // Skip it if the row is already there.
+ $query = "SELECT * FROM " . $tabname . " WHERE parameter='" .
+ $record['parameter'] . "' AND value='" . $record['value'] . "' " .
+ " AND translation='" . $record["translation"] . "' AND isDefault='" .
+ $record["isDefault"] . "'";
+ if ($db->Execute($query)->RecordCount() == 0) {
+ if (!$db->AutoExecute($tabname, $record, 'INSERT')) {
+ $msg = "Could not add entry for Abberior OBF in table 'possible_values'.";
+ write_message($msg);
+ write_to_error($msg);
+ return false;
+ }
+ }
+
+ // Add Aberrior OBF file to file_extension
+ $tabname = "file_extension";
+ $record = array();
+ $record["file_format"] = "obf";
+ $record["extension"] = "obf";
+ // Skip it if the row is already there.
+ $query = "SELECT * FROM " . $tabname .
+ " WHERE file_format='" . $record['file_format'] .
+ "' AND extension='" . $record['extension'] . "'";
+ if ($db->Execute($query)->RecordCount() == 0) {
+ $insertSQL = $db->GetInsertSQL($tabname, $record);
+ if (!$db->Execute($insertSQL)) {
+ $msg = "Could not add entry for Abberior OBF in table 'file_extension'.";
+ write_message($msg);
+ write_to_error($msg);
+ return;
+ }
+ }
+
+ // Add Aberrior OBF file to file_format
+ $tabname = "file_format";
+ $record = array();
+ $record["name"] = "obf";
+ $record["isFixedGeometry"] = "f";
+ $record["isSingleChannel"] = "f";
+ $record["isVariableChannel"] = "t";
+ $record["ismultifile"] = 't';
+ $record["hucoreName"] = "obf";
+ // Skip it if the row is already there.
+ $query = "SELECT * FROM " . $tabname .
+ " WHERE name='" . $record['name'] . "'";
+ if ($db->Execute($query)->RecordCount() == 0) {
+ $insertSQL = $db->GetInsertSQL($tabname, $record);
+ if (!$db->Execute($insertSQL)) {
+ $msg = "An error occurred while updating " .
+ "the database to revision " . $n . ".";
+ write_message($msg);
+ write_to_error($msg);
+ return;
+ }
+ }
+
+
+ // Update revision
+ if (!update_dbrevision($n))
+ return;
+
+ $current_revision = $n;
+ $msg = "Database successfully updated to revision " . $current_revision . ".";
+ write_message($msg);
+ write_to_log($msg);
+}
+
+
+
fclose($fh);
return;
From 820034ac13d28596e5140b2fbe25ab2b3011cd9a Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Fri, 26 Jan 2024 14:34:48 +0100
Subject: [PATCH 09/11] Fix for issue GitHub issue 20. Container files in
subfolders didn't have the used subimage in the result file name.
---
inc/job/JobDescription.php | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/inc/job/JobDescription.php b/inc/job/JobDescription.php
index 9ec8be54d..542eb3acf 100644
--- a/inc/job/JobDescription.php
+++ b/inc/job/JobDescription.php
@@ -499,19 +499,14 @@ public function sourceImageShortName()
{
$files = $this->files();
$inputFile = end($files);
+ // Handle subfolders.
$inputFile = explode("/", $inputFile);
- // remove file extension
- //$inputFile = explode(".", end($inputFile));
- //$inputFile = $inputFile[0];
- //$parameterSetting = $this->parameterSetting;
- //$parameter = $parameterSetting->parameter('ImageFileFormat');
- //$fileFormat = $parameter->value();
- if (preg_match("/^(.*)\.(lif|lof|czi|nd|msr|obf)\s\((.*)\)/i", $inputFile[0], $match)) {
+ // Match for container files.
+ if (preg_match("/^(.*)\.(lif|lof|czi|nd|msr|obf)\s\((.*)\)/i", end($inputFile), $match)) {
$inputFile = $match[1] . '_' . $match[2] . '_' . $match[3];
} else {
$inputFile = substr(end($inputFile), 0, strrpos(end($inputFile), "."));
}
-
return $inputFile;
}
From 5cb1520a19d2fd9d75193650bc1257f33c2a1873 Mon Sep 17 00:00:00 2001
From: Kevin Namink
Date: Wed, 21 Feb 2024 14:55:19 +0100
Subject: [PATCH 10/11] Partly fix the behavior when not selecting a Coloc map,
other side is fixed in Huygens Core. This keeps the previously possible
possibly unintended feature of not saving a coloc map when none is selected.
---
inc/HuygensTemplate.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/inc/HuygensTemplate.php b/inc/HuygensTemplate.php
index 1b125b803..eb22f837e 100644
--- a/inc/HuygensTemplate.php
+++ b/inc/HuygensTemplate.php
@@ -2397,7 +2397,11 @@ private function getTaskDescrColoc($chanR, $chanG, $runCnt)
$taskDescr .= $this->string2tcllist($coefficients);
break;
case 'map':
- $taskDescr .= $this->getColocMap();
+ if ($this->getColocMap() == "") {
+ $taskDescr .= "none";
+ } else {
+ $taskDescr .= $this->getColocMap();
+ }
break;
case 'destDir':
$destDir = $this->getDestDir() . "/hrm_previews";
From 965920bc671cd0072747d3732ee3313ac75891c9 Mon Sep 17 00:00:00 2001
From: Aaron Ponti
Date: Thu, 4 Apr 2024 11:16:24 +0200
Subject: [PATCH 11/11] Increase HRM version to 3.10.0.
---
inc/System.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inc/System.php b/inc/System.php
index c065901c0..4995c6c2e 100644
--- a/inc/System.php
+++ b/inc/System.php
@@ -35,7 +35,7 @@ class System
* Current HRM minor version. This value has to be set by the developers!
* @var int
*/
- private const HRM_VERSION_MINOR = 9;
+ private const HRM_VERSION_MINOR = 10;
/**
* Current HRM maintenance (patch) version. This value has to be set by the