Fanning Software Consulting

Reading MrSID Files

Facebook Twitter RSS Google+

QUESTION: I'm trying to open a MrSID file in IDL. There shouldn't be anything complicated about it. There are a couple of ways of doing this, but neither seems to work.

I am trying to open the MrSID file that comes with IDL in the demo data directory. First, I try something simple like this.

    IDL> sidFile = Filepath(SUBDIR=['demo','data'], 'test_gs.sid')
    IDL> ok = Query_MrSID(sidFile, fileInfo)

But, I get this error.

   % Variable is undefined: QUERY_MRSID

If I try to use the IDLffMrSID object, I have similar problems.

   IDL> fileObj = Obj_New('IDLffMrSID', sidFile)
        OBJ_NEW: Dynamically loadable module is unavailable on this platform: MRSID.

I have tried this on a Mac (OS 10.6.8) and on a PC (Windows 7) and on a LINUX machine, using IDL 7.1, 8.0, and 8.2.1. Exactly the same errors. Do you have any idea what might be going on?

ANSWER: The MrSID functionality appears to be available only on machines running the 32-bit version of IDL. It is not available on the 64-bit versions of IDL. (The same is true for reading DXF files in IDL, too.)

Jim P, from the IDL newsgroup, though, has provided a way to work around this limitation (at least on Windows machines) via the IDL_IDLBridge. The code to read the MrSID file will look like this. Something similar may be possible on other machines.

   IDL> b = idl_idlbridge(ops=32)
   IDL> b->execute, 'o = obj_new("idlffmrsid", filepath(subdir=["examples", "data"], "test_gs.sid"))'
   IDL> b->execute, 'data = o->getimagedata(level=3)'
   IDL> d=b->getvar('data')
   IDL> help, d
   D               BYTE      = Array[1, 64, 64]

Version of IDL used to prepare this article: IDL 8.2.1.

Written: 19 October 2012