Support

uScope MXII Fixing Dual Objective uScopeMXII Metadata
uScope MXII

Information in this article applies to:

  • uScopeMXII (Model MX2D)
  • uScope Navigator V4.2.1 and Later

Article ID: MXB1148 — Created: 12 Feb 2018 — Reviewed: 11 Mar 2018

Question

I have a dual objective uScopeMXII and have noticed some problems with the Deep Zoom images scanned with the higher power objective. In particular, the information displayed indicates that the image was scanned using the lower powered objective. Additionally, the magnification power indicator and selectors are wrong for the scan.

What is required to correct the information display and magnification controls?

Answer

This problem is caused by the way in which the objective power metadata is maintained in internal Flash memory of the uScopeMXII. One objective (usually the lower power) is the primary objective while higher powered objective(s) are secondary objectives. Only the primary objective metadata are stored in the uScope Flash memory.

When secondary objectives are used, the metadata copied to the scan information files represents the primary objective. As a result, the listed objective, pixel mapping, and objective magnification display and controls are configured for the primary objective. To correct this problem, you must make a small change to the metadata of the DZInfo.XML file that is generated for each Deep Zoom image.

Fortunately, this is easily done using the following script that you can assign to various parts of your workflow within uScope Navigator.

DZInfo-Fixup.wsf

'==================================================================================================
'==================================================================================================
Option Explicit

<job>
<script language="VBScript">

'==================================================================================================
'==================================================================================================
Function XMLUpdateObjPower (sXMLPath, sObjPower)

Const sSettingFileName = "DZInfo.xml"

sObjPower = Replace(Trim(LCase(sObjPower)), "x", "")

Select Case (sObjPower)
  Case "4"   sObjPower = sObjPower & "x"
  Case "10"  sObjPower = sObjPower & "x"
  Case "20"  sObjPower = sObjPower & "x"
  Case "40"  sObjPower = sObjPower & "x"
  Case "60"  sObjPower = sObjPower & "x"
  Case "100" sObjPower = sObjPower & "x"
  Case Else
    XMLUpdateObjPower = false
    Exit Function
End Select

If Right(sXMLPath,1) = "\" Then sXMLPath = Left(sXMLPath, Len(sXMLPath)-1)


On Error Resume Next

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = "False"
xmlDoc.Load(sXMLPath & "\" & sSettingFileName)

Set xObjPower = xmlDoc.selectsinglenode ("//ScanInfo/ObjectivePower")
xObjPower.text = sObjPower
xmlDoc.Save(sXMLPath & "\" & sSettingFileName)

Set xObjPower = Nothing
Set xmlDoc = Nothing


If Err.Number <> 0 Then
  XMLUpdateObjPower = false
Else
  XMLUpdateObjPower = true
End If

End Function

'==================================================================================================
'==================================================================================================
Function main ()

Set colNamedArguments = WScript.Arguments.Named

strDZFolder = colNamedArguments.Item("Folder")
strObjPower = colNamedArguments.Item("ObjPower")
If XMLUpdateObjPower (strDZFolder,strObjPower) = False Then Wscript.Echo "Update Failed!"

End Function

'==================================================================================================
'==================================================================================================
main()

</script>
</job>

'==================================================================================================
'==================================================================================================

Copy the above script and paste it into a file on your PC. For illustration purposes, we place all scripts in the C:\Scripts folder.

Invoke this script as follows:

DZInfo-Fixup.wsf "/Folder:%DZPath%" "/ObjPower:40x"

from within the uScope Navigator application for each Deep Zoom Image created for the secondary objective (40x in this example). Quotes are used to encapsulate arguments that may include spaces (like path names).

  • /Folder:%DZPath%
    Specifies the folder where the DZInfo.XML file to modify is located. %DZPath% is a macro that is replaced by uScope Navigator with the folder of the selected Deep Zoom Image.
  • /ObjPower:40x
    Specifies the new objective power to save in the Meta Data. This objective power should match the power of the objective used for scanning.

Following are several different methods to run this script.

Adding Button Scripts to the Job Manager (preferred)

Set Deep Zoom OptionsYou can add buttons to the Job Manager that run scripts you specify. The job manager buttons that appear on the Job Manager dialog when you select a Scan Set or Deep Zoom Image.

The Job Manager Button scripts are added via the Program Options — Job Manager Buttons tab.

To create a job manager button for deep zoom images...

  1. Select the Job Manager Buttons tab from the Program Options dialog. Here, you can define buttons that appear when a Scan Set or Deep Zoom Image is selected.
  2. Set Deep Zoom OptionsUnder When a Deep Zoom is Selected, select Command and enter C:\Windows\System32\wscript.exe.
  3. For Legend, enter 40x Scan. This is the text that appears on the button.
  4. For Parameters, enter "C:\Scripts\DZInfo-Fixup.wsf" "/Folder:%DZPath%" "/ObjPower:40x".
  5. For Tool Tip, enter some descriptive text that appears when hovering the mouse over the button.

After adding the Job Manager button, selecting a Deep Zoom Image from the Job Manager displays the button in the bottom menu as shown.

You must click this button to update the metadata for every Deep Zoom Image that was scanned with the secondary (40x in this example) objective.

Adding a Script to the Deep Zoom Options

You can add a script that is run every time a Deep Zoom image is created. The downside of this technique is that you must remember to disable this script when you switch back to the primary objective.

To create a deep zoom script that runs after a Deep Zoom image is created...

  1. Set Deep Zoom OptionsSelect the Deep Zoom Options tab from the Program Options dialog. Here, you can specify commands or scripts that run automatically before and after creating a Deep Zoom Image.
  2. Under Post Deep Zoom Action, select Command and enter C:\Windows\System32\wscript.exe.
  3. For Parameters, enter "C:\Scripts\DZInfo-Fixup.wsf" "/Folder:%DZPath%" "/ObjPower:40x".

Now, whenever you create a Deep Zoom Image, the script is automatically run and the appropriate metadata is added to the DZInfo.XML file.

Note
You must remember to disable (remove) this script when scanning slides with the primary objective.

Add Button Scripts to the Deep Zoom Viewer

Set Deep Zoom OptionsYou can add buttons to the Deep Zoom Image Viewer that run scripts you specify. Up to three buttons can be added via the Program Options — Deep Zoom Buttons tab

To create a deep zoom viewer button...

  1. Select the Deep Zoom Buttons tab from the Program Options dialog. Here, you can create three user-defined buttons that appear in the deep zoom image viewer.
  2. For Command, enter C:\Windows\System32\wscript.exe.
  3. For Legend, enter 40x Scan. This is the text that appears on the button.
  4. Set Deep Zoom OptionsFor Parameters, enter "C:\Scripts\DZInfo-Fixup.wsf" "/Folder:%DZPath%" "/ObjPower:40x".
  5. For Tool Tip, enter some descriptive text that appears when hovering the mouse over the button.

When you open a Deep Zoom Image, the button appears in the viewer as shown. You must click this button to update the metadata for Deep Zoom Images that were scanned with the secondary (40x in this example) objective. The downside to this technique is that you must exit and reload the Deep Zoom Image Viewer for changes to take effect.

Rate This Article
Contact Microscopes International or speak with your local distributor.
Copyright © 2024 Microscopes International, LLC. All rights reserved.