◆ AddImage()
| static void BioLib.Images.AddImage |
( |
BioImage | im | ) |
|
|
static |
It adds an image to the list of images
- Parameters
-
| BioImage | A class that contains the image data and other information. |
87 {
89 return;
91 {
92 if (im.
Filename.Contains(item.Filename))
93 return;
94 }
95 im.Filename = im.
Filename.Split(
' ')[0];
97 }
string Filename
Definition Bio.cs:2014
static List< BioImage > images
Definition Bio.cs:69
◆ GetExtensions()
| static string BioLib.Images.GetExtensions |
( |
string | file | ) |
|
|
static |
Return extensions of a file including multiple extensions like .ome.tif.
- Parameters
-
- Returns
135 {
136 string[] ex = file.Split(".");
137 if (ex.Length == 1)
138 return "." + ex[0];
139 else
140 if (ex.Length > 2)
141 return "." + ex[ex.Length - 2] + "." + ex[ex.Length - 1];
142 else
143 return "." + ex.Last();
144 }
◆ GetImage()
| static BioImage BioLib.Images.GetImage |
( |
string | ids | ) |
|
|
static |
- Parameters
-
| ids | The id of the image you want to get. |
74 {
75 ids = ids.Replace("\\", "/");
76 for (
int i = 0; i <
images.Count; i++)
77 {
78 if (
images[i].ID.Contains(System.IO.Path.GetFileName(ids)) ||
images[i].Filename == System.IO.Path.GetFileName(ids))
80 }
81 return null;
82 }
◆ GetImageCountByName()
| static int BioLib.Images.GetImageCountByName |
( |
string | s | ) |
|
|
static |
It takes a string as an argument, and returns the number of times that string appears in the list of images
- Parameters
-
- Returns
- The number of images that contain the name of the image.
105 {
106 int i = 0;
108 if (s.Contains("-"))
109 {
110 string ss =
RemoveExtensions(s.Substring(s.LastIndexOf(
"-"), s.Length - s.LastIndexOf(
"-")));
111 s = ss;
112 }
113 for (
int im = 0; im <
images.Count; im++)
114 {
115 if (
images[im].ID.Contains(s))
116 i++;
117 }
118 return i;
119 }
static string RemoveExtensions(string file)
Removes extensions from filename including multiple extensions like .ome.tif.
Definition Bio.cs:125
◆ GetImageName()
| static string BioLib.Images.GetImageName |
( |
string | s | ) |
|
|
static |
Get a unique image name from a string.
- Parameters
-
- Returns
152 {
153
155 if (i == 0)
156 return Path.GetFileName(s);
159 if (name.EndsWith("-" + i))
160 name = name.Substring(name.LastIndexOf('-'), name.Length - name.LastIndexOf('-'));
161 return name + "-" + (i + 1) + ext;
162 }
System.IO.Path Path
Definition Bio.cs:57
static int GetImageCountByName(string s)
Definition Bio.cs:104
static string GetExtensions(string file)
Return extensions of a file including multiple extensions like .ome.tif.
Definition Bio.cs:134
◆ RemoveExtensions()
| static string BioLib.Images.RemoveExtensions |
( |
string | file | ) |
|
|
static |
Removes extensions from filename including multiple extensions like .ome.tif.
- Parameters
-
- Returns
126 {
127 return System.IO.Path.GetFileNameWithoutExtension(System.IO.Path.GetFileNameWithoutExtension(file));
128 }
◆ RemoveImage() [1/2]
| static void BioLib.Images.RemoveImage |
( |
BioImage | im | ) |
|
|
static |
This function removes an image from the table
- Parameters
-
| BioImage | This is the image that you want to remove. |
167 {
169 }
static void RemoveImage(BioImage im)
Definition Bio.cs:166
◆ RemoveImage() [2/2]
| static void BioLib.Images.RemoveImage |
( |
string | id | ) |
|
|
static |
It removes an image from the table
- Parameters
-
| id | The id of the image to remove. |
- Returns
- The image is being returned.
176 {
178 if (im == null)
179 return;
181 im.Dispose();
182 }
static BioImage GetImage(string ids)
Definition Bio.cs:73
◆ UpdateImage()
| static void BioLib.Images.UpdateImage |
( |
BioImage | im | ) |
|
|
static |
It updates an image from the table
- Parameters
-
| id | The id of the image to update. |
| im | The BioImage to update with. |
- Returns
- The image is being returned.
189 {
190 for (
int i = 0; i <
images.Count; i++)
191 {
193 {
195 return;
196 }
197 }
198 }
string ID
Definition Bio.cs:2544
◆ images
The documentation for this class was generated from the following file: