04-20-2017 12:56 PM
Hello,
I have a request to programmtically generate a report in DIAdem by returning a set of TDM files with a given file property, add a few graphs generated from that TDM data, and display a few pages of photos, where the title of each photo contains the same metadata (property) used in the Navigator query to return the TDM data. Has anyone done something like this? I'm not sure if there's a way to get DataFinder to index photos or if there is some other trick to link photos with TDM data... Does anyone have a post-processing script to do this?
Thanks,
Chris
Solved! Go to Solution.
04-20-2017 02:34 PM
Hi Chris,
you can write a simple DataPlugin which "index" your photos by just indexing the file itself (following the same pattern as the TDM file name) or attach "enrich" the photo's file name by some property information contained in the TDM files as well, eg:
TDM::file.description = "Testrig_1"
TDM file name = "Measurement_1.tdm"
->
photo file name = Measurement_1-Testrig_1.png
In the VBS DataPlugin you can now split the file name and set
photo::file.description = "Testrig_1"
However with DIAdem 2017 it is now possible to add these properties directly "inside" the photos when exporting those with DIAdem REPORT or attaching them using DIAdem's SCRIPT capabilities afterwards. With DataFinder 2017 it is then possible to extract these properties with a VBS DataPlugin or use the newly shipping "Documents" DataPlugin which does this by default.
05-01-2017 01:16 PM
Hi Stefan,
Thank you for the suggestions. I just got a moment to revisit your post and realized I'm not clear on how to make a DataPlugin for jpeg files. Seeing as we don't have DIAdem 2017 or DataFinder 2017 yet, I would like to try this approach... Is there an example or prototype available that I could work off of?
Thank you,
Chris
05-03-2017 11:17 AM
Hi Chris,
Here's a DataPlugin I've used forever to index document files in DIAdem versions prior to 2017. You can edit the source code to add any additional properties you can infer from the file name or folder structure or any ASCII/Exce/XML sidecar files, etc.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-03-2017 01:00 PM
Here's the example to split the properties from the filename:
'Extract properties from file name, assuming the following layout: Measurement_1-Testrig_1.png
Dim propertyArray : propertyArray = split(File.Info.FileName, "-", -1,vbTextCompare)
If Ubound(propertyArray) > 0 Then
Root.Properties.Add "Measurement", propertyArray(0)
Root.Properties.Add "TestRig", propertyArray(1)
End If
05-03-2017 07:57 PM
Brad/Stefan,
Thank you very much for the support. After importing Brad's DataPlugin into the DataFinder SE and adding the search areas for the photos, the indexing worked as intended. I was then able to run a basic script to programmatically add the photos to a report.
I guess the next step is to devise and enforce a naming standard for the jpg files so that when I parse them using Stefan's method, enough properties are conveyed to make the hundreds of files searchable. Any suggestions on how to do this are welcome...
Chris
05-04-2017 08:07 AM - edited 05-04-2017 08:08 AM
Hi Chris,
Naming standards are notoriously difficult to enforce. I don't know what your process is like to create these picture files and place them in the correct folder, but you might consider using a sidecar metadata file (simplest is ASCII) to hold the relevant metadata properties. The Media DataPlugin can be edited to look for the sidecar file and read its info and apply those properties to the picture file's footprint in the DataFinder.
Brad Turpin
DIAdem Product Support Engineer
National Instruments