string GetImageOfData



GetImageOfData returns an image of the data in publicdata, which is if type datatypecode, dataformatcode. The returned image format, width, height and dpi as in the parameters. In order to use this method it is necessary to install an “Audiogram Chart component” on the Noah Server. It is this component that will actually create the picture. The Audiogram Chart component does not yet come automatically with Noah System and it is necessary to install it. The WSI installer (https://himsanoah.atlassian.net/wiki/spaces/AD/pages/499253358/Mandatory+knowledge#The-WSI-components) now contains this functionality and can be used, but it is better to install the new Noah 4 Audiogram Module with an updated chart. 

Q: Does the image include speech audiometry data?

A: No, only pure tone data is supported.

Method signature:

string GetImageOfData(int datatypecode, int dataformatcode, string publicdata, int height, int width, int dpi, string imagetype, int regioncode, int languagecode, Property[] additionalProperties);

Parameters:

  • int datatypecode : The Noah data type code (Audiogram = 1)

  • int dataformatcode : The Noah data format code (XML=500)

  • string publicdata : The public data as a base64 encoded string

  • int height : The wanted height of the returned image

  • int width : The wanted width of the returned image

  • int dpi : The wanted dpi of the returned image

  • string imagetype : The wanted image format of the returned image “gif”, “jpg”, “jpeg”, “png”

  • int regioncode : The regional code used (symbols etc.) (Microsoft LCID’s)

  • int languagecode :The language code (texts) (Microsoft LCID’s)

  • Property[] additionalProperties : Additional properties is an array of Key, Value pair strings. The properties is specific to which “ImageCategory” is

The method returns the image byte[] as a base64 encoded string.

Specification of additionalProperties

Please note that all values must be in Culture invariant format (decimal separator dot), Name and Values are case sensitive.



Color is Microsoft Brushes.

Name

Type

Values

Default

ImageCategory

String

ToneChart, Legend

ToneChart     



Name

type

Values

Default

SetXAxisLocation

string

None, Bottom, Top

Bottom

AutoScaleSymbols

Boolean

true, false

true

AutoSizeOnWidthHeight

Boolean

true, false

true

BaseScaleSymbols

double



1.0

DrawOddyFrequencies

Boolean

true, false

true

GridLineBrush

Color



LightGray

GridLineThickness

double



2.0

MaxXValue

Integer (Hertz)



16000

MaxYValue

Integer (dB)



130

ScaleFactor

double



1.0

ShowEar

string

None, Left, Right,

BinAural

None (all)

ShowToneXYLabels

Boolean

true, false

true

ToneUnderlayTemplate

string

None, SeverityOfLoss, SpeechSpectrum,

AudibilityIndex

None

dBStep

Integer (dB)



10



Name

type

Values

Default

ShowEar

string

None, Left, Right, BinAural

None (all)

ShowLegendsForAudiogram

string

All, Speech, Tone

All

SymbolVertLineBrush

Color



LightGray

SymbolVertLineThickness

double



1.0

LegendFontSize

double



8.0

LegendIconSpacing

double



15.0



Sample Code in C#

int DataTypeCode =  1;

int DataFormatCode = 500;

// This XML is just a sample

string publicdatainxmlformat = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +

"<HIMSAAudiometricStandard Version=\"500\" xmlns=\"http://www.himsa.com/Measurement/Audiogram\">" +



// Here we have the audiogram elements

          "</HIMSAAudiometricStandard>" ;

bool bLegend = false;

List<Property> properties = new List<Property>();

if (bLegend) {

          properties.Add(new Property { Name = "ImageCategory", Value = "Legend" });

          properties.Add(new Property { Name = "LegendFontSize", Value = "4" });

} else {

          properties.Add(new Property { Name = "ImageCategory", Value = "ToneChart" });

}

string s = NoahWsiWebService.GetImageOfData(DataTypeCode, DataFormatCode,

Convert.ToBase64String(publicdatainxmlformat), 100, 120, 96, "jpg", 1033, 1033,

properties.ToArray());



byte[] imagebytes = string.IsNullOrEmpty(s) ? new byte[0] : Convert.FromBase64String(s);



// imagedata now contains a jpg image