Author Archives: bloggyadmin

Updating embedded data in OLE Object fields

Do you need to update a batch of OLE Object fields, and you don’t want to have to update them individually using your application?  Access OLE Import can help you with such tasks.

We had a user that needed to update a few thousand rows in an Access table, specifically an OLE Object field that stores a zip archive.  He already had all the zip files ready, but did not want to have to update each record individually.

So in SQL Image Viewer, the existing records show up as zip archives embedded in OLE Object packages:

The user already has the new zip files he wants to update the records with.  Using Access OLE Import, he just needs to prepare an upload definition file providing the key field value (ID in this case) and the OLE Object column to update the contents for (the quotations field).

In Access OLE Import, we enter the table to update together with this data file.

And that’s it.  Access OLE Import will update the OLE Object fields with the new zip files accordingly.

Note that you can also update any of the other text or numeric fields in your tables using Access OLE Import.  For e.g. if the user had wanted to update the address field, he only needed to enter the new values in the data file e.g.

Learn more about Access OLE Import here, or download a 14-day trial now.  Access OLE Import can help you update batches of records easily, instead of having to update each record individually via your application.

See here on how you can update linked file locations using Access OLE Import.

Updating linked file locations in OLE Object fields

Have you ever needed to update the linked file locations in an OLE Object-type field in your database?  Access OLE Import can do all that for you and more.

Let’s say you have a table with an OLE Object column that contains links to a file.  In SQL Image Viewer, you may see the following:

So all the images are currently linked to files located in the F:\Customer files\ folder.  What if the files are no longer there, for e.g. when you share your database with other users?  Your users will not be able to access the images because they may not have that folder available to store the images.

Access OLE Import can help you update the details in the OLE Object field.  To do that, you just need to provide the key field value of the records to update, and their corresponding file location, in an Excel file.  So for e.g. let’s say all our images are now stored in the G:\Employee photos\ folder.  Our Excel spreadsheet will simply contain the following:

The ID column refers to the ID field in our table.  The keynumber definition tells Access OLE Import that this is an integer key value.

The photo column refers to the photo field in our table, and filecontent tells Access OLE Import we want to work with the contents of the files listed in this column.

We then tell Access OLE Import that we want to create links to the files.

And that’s all there is to it.  Access OLE Import will update the relevant records, and the links to the images are updated accordingly.

If you prefer to embed the image in the table, then select the embedded option instead.

Now Access OLE Import will embed the images directly in the table.

Learn more about Access OLE Import here, or download a 14-day trial now.  Access OLE Import can help you update batches of records easily, instead of having to update each record individually via your application.

See here for a more detailed example on how to update embedded OLE Object data.

Working with measurement labels in your DICOM images

In Easy DICOM Viewer, you can create multiple measurements in your DICOM image.  By default, only the label for the selected measurement is displayed, to make it obvious which measurement the label is referring to.

You can also choose to display all the measurement labels by selecting the Show all option on the Labels options.

However, in this example, our labels overlap each other.

To reposition a label, first select the Move, edit, delete item from the measurements context menu.

Then select the measurement area you want to reposition the label for.  Press CONTROL and click on the new label position.   Here, we have repositioned our 2 labels so that they no longer overlap when displayed simultaneously.

The measurements panel

All the measurements are also displayed on the measurements panel together with the measurement details.

You can also perform various actions like hiding all the measurements on the images, applying the various label options, or deleting one or more measurements.  You can also export details of your measurements to a Microsoft Word file.  Just click on the Export image and measurements to Word button and enter the file name.

The exported Word file is automatically opened by default.

Learn more about Easy DICOM Viewer, or download a 14-day trial now and experience for yourself how easy it is to create, edit, and share measurements in your DICOM images.

Converting your DICOM images

Easy DICOM Viewer lets you convert your DICOM images to other image formats easily, and will include any measurements and annotations that you have created.

To export an image, click on the Export image… item on the context menu.

Enter the file name for the exported image.  The default image format is JPEG.  To change the image format, click on the Save as type drop-down list and select your format.

Easy DICOM Viewer supports most of the common image formats.  If you want to export to a format that’s currently not available, drop us a line at support@yohz.com.

If your image contained any measurements or annotations, they will also be visible in the exported image.

Learn more about Easy DICOM Viewer, or download a 14-day trial now.

Color schemes in Easy DICOM Viewer

You can use Easy DICOM Viewer in 3 color schemes – light, dark, and gray, depending on your preferences.

To change the color scheme, select Application > Color scheme from the main menu.

Then select the color scheme you want to use.

In some cases, you may need to restart Easy DICOM Viewer to apply the new color scheme.  Learn more about Easy DICOM Viewer, or download a 14-day trial now.

Measuring regions of a similar color in DICOM images

Easy DICOM Viewer  lets you measure regions of interest in your images using various options.  One such option is to measure the length and area of a region of similar color.

To use that option, first select the Similar colors item from the measurement sub-menu.

A new window is displayed where you first click on the point you want to measure.  You can zoom in and out of the image using the mouse wheel.

Let’s say we want to select the whitish region here.

We first click anywhere in that region.  A polygon area is automatically created for us.

This initial selection contains only the area which has identical values to the point we clicked on.  To expand the selection to similar values, we adjust the tolerance slider on the left.

You can also adjust how smooth the shape is by adjusting the number of points used to form the selection.

Once we have finalized our selection, press the ESCAPE key.  We then return to our viewing screen with our selection, and the measurements for area, length, minimum, maximum, mean and standard deviation of the HU values in the selected area are displayed, together with the length of the longest axis and the longest line perpendicular to the longest axis.

You can still adjust the selection area by dragging or deleting any of the existing points.  You can also add additional points to the shape.

What if we only want to select part of the area with similar colors?  Let’s say we only wanted to measure the right side of the above region.  We can either adjust the shape after selecting the entire area, or we could use the Similar colors (selection) option.

The steps to select the region is identical to the Similar colors option, but you first define the region of the image you want to select from.  You do this by clicking and dragging the mouse to form a selection rectangle on the image, then release the mouse.

When you then enter the selection window, only the selected area is displayed.

Now we just need to click inside the area, adjust the tolerance values, and we’re done.  The selected area will be constrained accordingly in the final measurement.

Learn more about Easy DICOM Viewer now, or download a 14-day trial to experience for yourself how easy it is to measure regions of similar colors in your DICOM images.

Viewing your DICOM images using the standard color palettes

In Easy DICOM Viewer, you can view your DICOM images using the standard color palettes easily – hot iron, hot metal blue, PET, PET 20 , and rainbow.

The fastest way to do that is by using the keyboard shortcut W.  When you first press W, you will enter the windowing mode.

When you are already in the windowing mode, pressing the W key again will cycle through the various color palettes.  In this way, you can easily apply the various color palettes fast.

You can also change the color profile using the sub-items of the windowing menu:

or from the context menu when in the windowing mode:

Learn more about Easy DICOM Viewer now, or download a 14-day trial to experience for yourself how easy it is to apply the standard color profiles to your DICOM images.

Annotating your DICOM images

You can now add annotations to your images in Easy DICOM Viewer.  First, enter the annotations mode by clicking on the Add and edit annotations button on the toolbar, or use the keyboard shortcut (the T key).

In the DICOM image, right click to bring up the context menu, and select the Add text or Add line items.

Adding a text annotation

Click and drag anywhere in the image to create a text annotation.  You should see a rectangle with the words (annotation) displayed.

When you release the mouse, a bounding rectangle is displayed.

You can resize the annotation rectangle by clicking and dragging on any of the 6 yellow points.  You can also move the annotation by clicking and dragging inside the rectangle.  To change the text, double click inside the rectangle and write your text.

You can change the text color, size, and background color by changing the annotation settings on the toolbar.

Adding a line annotation

Click and drag anywhere on the image to create a line annotation.

You can click and drag on either point to change the start and end point of the line.   Adjust the line settings on the toolbar to change the line color and width.

Hiding annotations

If you don’t want to display the annotations temporarily, deselect the Display annotations item from the annotation mode button.

Deleting annotations

To delete an annotation, ensure that you’re in the annotation mode, then click on the annotation so that the bounding rectangle appears,  Press the DELETE key on the keyboard to remove the annotation.

Using the annotations

Annotations are automatically saved and displayed when you reopen the image.  You can copy the annotated images to the clipboard, or export the annotated images (PNG, JPG, BMP, GIF, etc) by selecting the appropriate action from the context menu.

 

High DPI support

We recently added high DPI support to some of our applications so that they render better when user displays are scaled to 125% or more.  We may have missed 1 or 2 items, so if you encounter any GUI elements that are oversized or undersized, we would appreciate it very much if you could let us know at support@yohz.com.

The applications we’ve added high DPI support for are:

The day SQL Image Viewer outsmarted me

Never thought this would happen, but I was stumped by my own application for a good 24 hours before realizing what was happening.  I’m getting too old for this ****

A user wrote in asking why SQL Image Viewer could identify XML content in his SQL Server table, but he could not use his database’s XML functions to query the XML data.

No problem, or so I thought.  Using a subset of the database he sent, I could see the first few bytes of the XML content and also query the size in SSMS:

Ok, so that’s about 119 Kb of data.  In SQL Image Viewer, the following is returned:

So far so good, SQL Image Viewer identified the XML content.  Now what happens when I try to use the XML function in SSMS:

SQL Server raised an error: XML parsing: line 1, character 2, illegal xml character

Ok, so what’s wrong with character 2?  Back in SQL Image Viewer, I opened the hex viewer, and the XML header looked fine:

Ok then, I decided to export the XML file to disk, and could open it in my browser.  Then it stuck me that the file was over 2 MB in size, but the blob size was only 119 Kb.

What was going on here?  In the hex viewer I scrolled to the end of the XML content, and it too was indicating the content was about 2.6 MB in size.

Why was SSMS and SQL Image Viewer reporting the blob size as 119 Kb, but when viewed in the hex viewer or exported, the content was closer to 2.6 MB in size?

This being a SQL Server database, my first thought was that row or column compression was in place.  However, the compression/decompression would have been done transparently and wouldn’t be showing up this way.  I checked anyway, and sure enough, no row/column compression was active.

Feeling rather lost, I explained the situation to the user hoping they might shed some light on what was going on.  Later, in the shower, while clearing my head (literally and figuratively), it stuck me: zlib streams.

Basically, if the blob content is a zlib compressed stream, SQL Image Viewer automatically decompresses the stream, identifies the content type, and lets you work with the decompressed data.  That was exactly what was happening here – the zlib compressed stream of 119 Kb was being uncompressed to 2.6 MB, identified as an XML file, and subsequent viewing and exporting allowed me to work with the uncompressed data.  I had totally forgotten about this feature!

This also explained why the XML functions could not work directly on the blob content – it was a zlib stream and not a XML text file.

Next time, I should compare the first few bytes as displayed in SSMS against the  values displayed in SQL Image Viewer.  It would then have been immediately clear that we were working with a compressed stream.

And that is how my own application fooled me (or my memory is just getting poorer).