Skip to content

Commit 858192b

Browse files
committed
Made common paths output more meaningful, and greatly improved performance, various small bug fixes
1 parent b9f3b24 commit 858192b

26 files changed

Lines changed: 259 additions & 338 deletions

BioImageOperation script.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Bio Image Operation script operations (v1.7.17 / 2024-03-22)
1+
# Bio Image Operation script operations (v1.7.19 / 2024-09-21)
22

33

44
**Set** (Path, Width, Height, Fps, PixelSize, WindowSize)
@@ -39,6 +39,18 @@ Create a new image
3939
- Blue: Blue color component (numeric value between 0 and 1)
4040

4141

42+
**VideoInfo** (**Path**, API, Start, Length, Interval, Total)
43+
44+
Open video file(s) and show info (ffmpeg formats supported)
45+
46+
- Path: File path ("path")
47+
- API: OpenCV API code (See OpenCV API codes) (numeric value)
48+
- Start: Start (time reference as (hours:)minutes:seconds, or frame number)
49+
- Length: Length (time reference as (hours:)minutes:seconds, or frame number)
50+
- Interval: Interval in number of frames (numeric value)
51+
- Total: Total number of frames at regular interval (numeric value)
52+
53+
4254
**OpenImage** (**Path**, Start, Length, Interval, Total)
4355

4456
Open image file(s) for processing, accepts file name pattern
@@ -430,14 +442,15 @@ Draw tracked clusters
430442
- DrawMode: Draw mode(s) (combine using | character) (None, Point, Circle, Ellipse, Box, Angle, Label, LabelArea, LabelLength, LabelAngle, Track, Tracks, Fill, ClusterDefault, TracksDefault)
431443

432444

433-
**DrawPaths** (Label, Tracker, PathDrawMode, Power, Palette)
445+
**DrawPaths** (Label, Tracker, PathDrawMode, Power, Offset, Palette)
434446

435447
Draw common paths
436448

437449
- Label: Label id (string)
438450
- Tracker: Tracker id (string)
439-
- PathDrawMode: Path draw mode (Age, Usage, Usage2, Usage3, Links, LinksMove)
451+
- PathDrawMode: Path draw mode (Count, Time, Paths, Direction)
440452
- Power: Exponential power of value range (1E-[power] ... 1) (numeric value)
453+
- Offset: Exponential offset of value range (numeric value)
441454
- Palette: Palette (GrayScale, Heat, Rainbow)
442455

443456

BioImageOperation/Argument.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ enum class ArgumentLabel
8282
Weight,
8383
Factor,
8484
Power,
85+
Offset,
8586
Palette,
8687
Tracker,
8788
MinArea,
@@ -140,6 +141,7 @@ const vector<string> ArgumentLabels =
140141
"Weight",
141142
"Factor",
142143
"Power",
144+
"Offset",
143145
"Palette",
144146
"Tracker",
145147
"MinArea",

BioImageOperation/BioImageOperation.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 1,7,17
55-
PRODUCTVERSION 1,7,17
54+
FILEVERSION 1,7,19
55+
PRODUCTVERSION 1,7,19
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "Joost de Folter"
7171
VALUE "FileDescription", "https://github.com/folterj/BioImageOperation"
72-
VALUE "FileVersion", "1.7.17"
72+
VALUE "FileVersion", "1.7.19"
7373
VALUE "InternalName", "BioImageOperation"
74-
VALUE "LegalCopyright", "2024-03-22"
74+
VALUE "LegalCopyright", "2024-09-21"
7575
VALUE "OriginalFilename", "BioImageOperation"
7676
VALUE "ProductName", "BioImageOperation"
77-
VALUE "ProductVersion", "1.7.17"
77+
VALUE "ProductVersion", "1.7.19"
7878
END
7979
END
8080
BLOCK "VarFileInfo"

BioImageOperation/BioImageOperation.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ xcopy /y C:\openh264\*.dll $(OutDir)</Command>
152152
<ClCompile Include="OutputStream.cpp" />
153153
<ClCompile Include="ParamRange.cpp" />
154154
<ClCompile Include="PathLink.cpp" />
155-
<ClCompile Include="PathNode.cpp" />
156155
<ClCompile Include="ScriptOperation.cpp" />
157156
<ClCompile Include="ScriptOperations.cpp" />
158157
<ClCompile Include="ScriptProcessing.cpp" />
@@ -221,7 +220,6 @@ xcopy /y C:\openh264\*.dll $(OutDir)</Command>
221220
<ClInclude Include="OutputStream.h" />
222221
<ClInclude Include="ParamRange.h" />
223222
<ClInclude Include="PathLink.h" />
224-
<ClInclude Include="PathNode.h" />
225223
<ClInclude Include="resource.h" />
226224
</ItemGroup>
227225
<ItemGroup>

BioImageOperation/BioImageOperation.vcxproj.filters

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@
7979
<ClCompile Include="PathLink.cpp">
8080
<Filter>Source Files</Filter>
8181
</ClCompile>
82-
<ClCompile Include="PathNode.cpp">
83-
<Filter>Source Files</Filter>
84-
</ClCompile>
8582
<ClCompile Include="ScriptOperation.cpp">
8683
<Filter>Source Files</Filter>
8784
</ClCompile>
@@ -219,9 +216,6 @@
219216
<ClInclude Include="PathLink.h">
220217
<Filter>Header Files</Filter>
221218
</ClInclude>
222-
<ClInclude Include="PathNode.h">
223-
<Filter>Header Files</Filter>
224-
</ClInclude>
225219
<ClInclude Include="ScriptOperation.h">
226220
<Filter>Header Files</Filter>
227221
</ClInclude>

BioImageOperation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.10)
55

66
string (TIMESTAMP NOW "%Y-%m-%d")
77

8-
project (BioImageOperation VERSION "1.7.17" DESCRIPTION ${NOW} HOMEPAGE_URL "https://github.com/folterj/BioImageOperation")
8+
project (BioImageOperation VERSION "1.7.19" DESCRIPTION ${NOW} HOMEPAGE_URL "https://github.com/folterj/BioImageOperation")
99

1010
configure_file (
1111
"${PROJECT_SOURCE_DIR}/config.h.in"

BioImageOperation/ColorScale.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
Vec<uchar, 3> ColorScale::grayTable[scaleLength];
1515
Vec<uchar, 3> ColorScale::heatTable[scaleLength];
16+
Vec<uchar, 3> ColorScale::blueWhiteRedTable[scaleLength];
1617
Vec<uchar, 3> ColorScale::rainbowTable[scaleLength];
1718
Vec<uchar, 3> ColorScale::labelTable[labelLength];
1819

@@ -30,9 +31,8 @@ void ColorScale::init() {
3031

3132
gray = (uchar)((1 - scale) * 0xFF);
3233
grayTable[i] = Vec<uchar, 3>(gray, gray, gray);
33-
3434
heatTable[i] = Util::floatToByteColor(Util::getHeatScale(scale));
35-
35+
blueWhiteRedTable[i] = Util::floatToByteColor(Util::getBlueWhiteRedScale(scale));
3636
rainbowTable[i] = Util::floatToByteColor(Util::getRainbowScale(scale));
3737
}
3838

@@ -72,6 +72,11 @@ Vec<uchar, 3> ColorScale::getHeatScale(double scale) {
7272
return heatTable[i];
7373
}
7474

75+
Vec<uchar, 3> ColorScale::getBlueWhiteRedScale(double scale) {
76+
int i = min(max((int)(scale * scaleLength), 0), scaleLength - 1);
77+
return blueWhiteRedTable[i];
78+
}
79+
7580
Vec<uchar, 3> ColorScale::getRainbowScale(double scale) {
7681
int i = min(max((int)(scale * scaleLength), 0), scaleLength - 1);
7782
return rainbowTable[i];

BioImageOperation/ColorScale.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ class ColorScale
2626

2727
static Vec<uchar, 3> grayTable[];
2828
static Vec<uchar, 3> heatTable[];
29+
static Vec<uchar, 3> blueWhiteRedTable[];
2930
static Vec<uchar, 3> rainbowTable[];
3031
static Vec<uchar, 3> labelTable[];
3132

3233
static void init();
3334
static Vec<uchar, 3> getGrayScale(double scale);
3435
static Vec<uchar, 3> getHeatScale(double scale);
36+
static Vec<uchar, 3> getBlueWhiteRedScale(double scale);
3537
static Vec<uchar, 3> getRainbowScale(double scale);
3638
static Vec<uchar, 3> getLabelColor(int label);
3739
};

BioImageOperation/Constants.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,22 +310,18 @@ const vector<string> AccumModes =
310310

311311
enum class PathDrawMode
312312
{
313-
Age,
314-
Usage,
315-
Usage2,
316-
Usage3,
317-
Links,
318-
LinksMove
313+
Count,
314+
Time,
315+
Paths,
316+
Direction
319317
};
320318

321319
const vector<string> PathDrawModes =
322320
{
323-
"Age",
324-
"Usage",
325-
"Usage2",
326-
"Usage3",
327-
"Links",
328-
"LinksMove"
321+
"Count",
322+
"Time",
323+
"Paths",
324+
"Direction"
329325
};
330326

331327
enum class DrawPosition

BioImageOperation/FrameSource.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ void FrameSource::calcFrameParams(string start, string length, double fps, int i
5454
this->interval = 1;
5555
}
5656
}
57+
58+
int FrameSource::getInterval() {
59+
return this->interval;
60+
}

0 commit comments

Comments
 (0)