DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Can DataFinder Index Photos?

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(3,850 Views)

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.

 

LayoutParameters.PNG

0 Kudos
Message 2 of 7
(3,828 Views)

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

0 Kudos
Message 3 of 7
(3,772 Views)
Solution
Accepted by topic author Chris_P_SD

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

0 Kudos
Message 4 of 7
(3,751 Views)

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

0 Kudos
Message 5 of 7
(3,748 Views)

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

0 Kudos
Message 6 of 7
(3,743 Views)

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

0 Kudos
Message 7 of 7
(3,725 Views)