BioLib  4.1.1
A GUI-less version of Bio .NET library for editing & annotating various microscopy image formats.
Loading...
Searching...
No Matches
BioLib.QuPath.Project Class Reference

Static Public Member Functions

static Project FromImages (List< BioImage[]> bms, string QuPathProjectFile)
 
static void SaveProject (string file, List< BioImage[]> bms)
 

Properties

string Version [get, set]
 
long CreateTimestamp [get, set]
 
long ModifyTimestamp [get, set]
 
string Uri [get, set]
 
int LastID [get, set]
 
List< ImageImages [get, set]
 

Member Function Documentation

◆ FromImages()

static Project BioLib.QuPath.Project.FromImages ( List< BioImage[]> bms,
string QuPathProjectFile )
static
293 {
294 QuPath.Project proj = new QuPath.Project();
295 proj.Version = "0.6.0";
296 proj.Uri = "file:/" + QuPathProjectFile.Replace("\\","/");
297 DateTime dateTime = DateTime.Now;
298 long timestampMillis = new DateTimeOffset(dateTime).ToUnixTimeMilliseconds();
299 proj.CreateTimestamp = timestampMillis;
300 proj.ModifyTimestamp = timestampMillis;
301 proj.Images = new List<Image>();
302 int id = 0;
303 foreach (var item in bms)
304 {
305 foreach (var b in item)
306 {
307 List<Image> im = Image.FromBioImages(item.ToList(), id);
308 proj.Images.AddRange(im);
309 id++;
310 }
311 }
312 proj.LastID = id;
313 return proj;
314 }

◆ SaveProject()

static void BioLib.QuPath.Project.SaveProject ( string file,
List< BioImage[]> bms )
static
316 {
317 Project pr = Project.FromImages(bms, file);
318 Formatting form = new Formatting();
319 var settings = new JsonSerializerSettings
320 {
321 ContractResolver = new CamelCasePropertyNamesContractResolver(), // Enable camelCase
322 Formatting = Formatting.Indented // Optional: pretty print
323 };
324 string json = JsonConvert.SerializeObject(pr, settings);
325 File.WriteAllText(file, json);
326 Recorder.Record(BioLib.Recorder.GetCurrentMethodInfo(), false, file, bms.Count);
327 }
Definition Recorder.cs:12
Definition Bio.cs:65

Property Documentation

◆ CreateTimestamp

long BioLib.QuPath.Project.CreateTimestamp
getset
287{ get; set; }

◆ Images

List<Image> BioLib.QuPath.Project.Images
getset
291{ get; set; }

◆ LastID

int BioLib.QuPath.Project.LastID
getset
290{ get; set; }

◆ ModifyTimestamp

long BioLib.QuPath.Project.ModifyTimestamp
getset
288{ get; set; }

◆ Uri

string BioLib.QuPath.Project.Uri
getset
289{ get; set; }

◆ Version

string BioLib.QuPath.Project.Version
getset
286{ get; set; }

The documentation for this class was generated from the following file: