Author Archives: bloggyadmin

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.

Download a 14-day trial now of Easy DICOM Viewer and experience for yourself how easy it is to create, edit, and share measurements in your DICOM images.

Easy DICOM Viewer is a collaborative effort between LISIT, Co., Ltd. and Yohz Software.  To learn more about Easy DICOM Viewer or download a trial, please use this link.  If you are in Japan, please use this link instead.

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.

Download a 14-day trial now of Easy DICOM Viewer and convert your DICOM images in a few simple steps.

Easy DICOM Viewer is a collaborative effort between LISIT, Co., Ltd. and Yohz Software.  To learn more about Easy DICOM Viewer or download a trial, please use this link.  If you are in Japan, please use this link instead.

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.

Easy DICOM Viewer is a collaborative effort between LISIT, Co., Ltd. and Yohz Software.  To learn more about Easy DICOM Viewer or download a trial, please use this link.  If you are in Japan, please use this link instead.

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.

Download a 14-day trial now of Easy DICOM Viewer and experience for yourself how easy it is to measure regions of similar colors in your DICOM images.

Easy DICOM Viewer is a collaborative effort between LISIT, Co., Ltd. and Yohz Software.  To learn more about Easy DICOM Viewer or download a trial, please use this link.  If you are in Japan, please use this link instead.

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:

Download a 14-day trial now of Easy DICOM Viewer and experience for yourself how easy it is to apply the standard color profiles to your DICOM images.

Easy DICOM Viewer is a collaborative effort between LISIT, Co., Ltd. and Yohz Software.  To learn more about Easy DICOM Viewer or download a trial, please use this link.  If you are in Japan, please use this link instead.

 

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.

Download a 14-day trial now of Easy DICOM Viewer and experience for yourself how easy it is to add annotations to your DICOM images.

Easy DICOM Viewer is a collaborative effort between LISIT, Co., Ltd. and Yohz Software.  To learn more about Easy DICOM Viewer or download a trial, please use this link.  If you are in Japan, please use this link instead.

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).

Extracting and viewing PDF files in a SimpleIndex database

SimpleIndex is an application that stores PDF files in SQL Server databases.  The PDFs are stored in the General table, in the Image column.  That column is of the SQL Server image type, generally used to store binary data (or blobs).

We recently had a user that could not export the PDF files from his SimpleIndex database.    The user was very helpful to send us the original PDF file, and the PDF file content as stored in his database for comparison.  Turns out that SimpleIndex first converts the binary data in your PDF files to a unicode text string, then stores this unicode text.

This is certainly a strange way to go about storing a file in a column that has a data type that’s perfectly suited to storing binary files.  In addition to making it difficult to extract the PDF file, it doubles the storage requirements.  Whatever the reason, SQL Image Viewer could not identify and display the PDF files.

So the first thing we did was to convert the exported ‘mangled’ PDF files back to their original state.  We added this feature to our UTF8Tool application.

Now the user could export the content from his database, then use this tool to convert those files into proper PDF files.

However, the user wanted to be able to query and view the PDF files from within SQL Image Viewer.  We ended up with the easiest option – we created a second column to store the proper PDF content, then create an application to convert the mangled PDF files from the first column and store them in this new column.

It’s a very basic unpolished conversion application, and you can download and use this application freely.

IMPORTANT NOTE:  This application updates a column in your database, so please make a backup of your database first, in case things don’t turn out exactly the way you want it.

Currently, this application supports only SQL Server databases.  If you need a version that supports another database engine, or if you require some modifications, drop us a line at support@yohz.com.

Now that the user could display the PDF directly in SQL Image Viewer, we had another issue.  By default, SQL Image Viewer only displays the first page of each PDF file that it detects e.g.

This made it difficult to review each PDF file in details.  Fortunately, SQL Image Viewer (professional edition) supports custom layouts.  With custom layouts, you can choose to display a specific number of pages from your PDF files, and also the size of the pages e.g.

Now the user could easily preview more of his PDF files prior to exporting them.

In summary:

  • if you need to convert binary data from unicode files to ansi files, give our free UTF8Tool a try
  • if you want to convert a column containing binary data in unicode text format to ansi text format and store the converted data in a separate column, give this free application a try (but please back up your database first)
  • if you want to preview multiple pages of a PDF file, use the custom layouts feature in SQL Image Viewer (professional edition)
  • if you have data that SQL Image Viewer/Access OLE Export/SQL Blob Export does not recognize, send us an email at support@yohz.com