Open raw binay image using *.nhdr header

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Open raw binay image using *.nhdr header

haeggsti@mskcc.org

Hello,

 

I’ve just installed 3DSlicer and am just starting to use it. I have a binary uint16 data file (image.raw) that I created in Matlab using the fopen/fwrite commands. I found some information that to open these type of files you need a *.nhdr-header file. I’ve created a basic one as below (image.nhdr).

 

In 3DSlicer v.4.6 I cannot find the option “FileàAdd volume”, so I reverted back and installed v.4.0 where this option is available. Anyway, I choosing to open volume, and then select my image.nhdr file. Clicking the “Open” button closes the file selection window, but my viewer is still empty (an empty pink box as when you start 3DSlicer). No error messages. I also tried via “FileàAdd data” (both in version 4.0 and 4.6), but with the same result. I am able to read and view image.raw in e.g. Amide viewer.

 

Can anyone point me in the right direction to open raw binary data files? Thanks!

/Ida

 

image.nhdr:

-----------------------------

NRRD0001

dimension: 2

type: uint16

sizes: 320 320

spacings: 1 1

encoding: RAW

endian: little

data file: image.raw

-----------------------------

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Open raw binay image using *.nhdr header

Steve Pieper-2
Hi Ida - 

There can be subtle things wrong with a nhdr that are hard to debug.  It might be easiest to start with one of the slicer sample data sets and save it in .nhdr and then edit the data file path to point to your data instead.

You should be able to open .nhdr as volumes with the Add Data button in the current slicer (or drag and drop the .nhdr on the slicer app).

For more background on nhdr/nrrd format see:


Best,
Steve

On Wed, Jan 4, 2017 at 1:39 PM, [hidden email] <[hidden email]> wrote:

Hello,

 

I’ve just installed 3DSlicer and am just starting to use it. I have a binary uint16 data file (image.raw) that I created in Matlab using the fopen/fwrite commands. I found some information that to open these type of files you need a *.nhdr-header file. I’ve created a basic one as below (image.nhdr).

 

In 3DSlicer v.4.6 I cannot find the option “FileàAdd volume”, so I reverted back and installed v.4.0 where this option is available. Anyway, I choosing to open volume, and then select my image.nhdr file. Clicking the “Open” button closes the file selection window, but my viewer is still empty (an empty pink box as when you start 3DSlicer). No error messages. I also tried via “FileàAdd data” (both in version 4.0 and 4.6), but with the same result. I am able to read and view image.raw in e.g. Amide viewer.

 

Can anyone point me in the right direction to open raw binary data files? Thanks!

/Ida

 

image.nhdr:

-----------------------------

NRRD0001

dimension: 2

type: uint16

sizes: 320 320

spacings: 1 1

encoding: RAW

endian: little

data file: image.raw

-----------------------------

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Open raw binay image using *.nhdr header

inorton
In reply to this post by haeggsti@mskcc.org
NRRD i/o libraries are freely available for Matlab, as well as Python and many other languages. Probably the most up-to-date/tested one for the Slicer ecosystem is: 


There are several others on the FileExchange. Using an existing NRRD library is probably faster/safer than writing a new implementation from the spec (less fun though).

On Wed, Jan 4, 2017 at 1:39 PM, [hidden email] <[hidden email]> wrote:

Hello,

 

I’ve just installed 3DSlicer and am just starting to use it. I have a binary uint16 data file (image.raw) that I created in Matlab using the fopen/fwrite commands. I found some information that to open these type of files you need a *.nhdr-header file. I’ve created a basic one as below (image.nhdr).

 

In 3DSlicer v.4.6 I cannot find the option “FileàAdd volume”, so I reverted back and installed v.4.0 where this option is available. Anyway, I choosing to open volume, and then select my image.nhdr file. Clicking the “Open” button closes the file selection window, but my viewer is still empty (an empty pink box as when you start 3DSlicer). No error messages. I also tried via “FileàAdd data” (both in version 4.0 and 4.6), but with the same result. I am able to read and view image.raw in e.g. Amide viewer.

 

Can anyone point me in the right direction to open raw binary data files? Thanks!

/Ida

 

image.nhdr:

-----------------------------

NRRD0001

dimension: 2

type: uint16

sizes: 320 320

spacings: 1 1

encoding: RAW

endian: little

data file: image.raw

-----------------------------

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Open raw binay image using *.nhdr header

haeggsti@mskcc.org
In reply to this post by haeggsti@mskcc.org

Dear Isaiah,

 

Thank you. I followed your suggestion and created an *.nrrd file from my images (using the Matlab codes in your link), instead of a separate header and data file. I was able to successfully open the image! A small note however is that it didn’t work with 2D images, so I had to do a 3D.

 

Thank you, and all the best.

/Ida

 

From: Isaiah Norton [mailto:[hidden email]]
Sent: den 4 januari 2017 14:35
To: Haeggstroem, Ida/Sloan Kettering Institute
Cc: SPL Slicer Users
Subject: Re: [slicer-users] Open raw binay image using *.nhdr header

 

NRRD i/o libraries are freely available for Matlab, as well as Python and many other languages. Probably the most up-to-date/tested one for the Slicer ecosystem is: 

 

 

There are several others on the FileExchange. Using an existing NRRD library is probably faster/safer than writing a new implementation from the spec (less fun though).

 

On Wed, Jan 4, 2017 at 1:39 PM, [hidden email] <[hidden email]> wrote:

Hello,

 

I’ve just installed 3DSlicer and am just starting to use it. I have a binary uint16 data file (image.raw) that I created in Matlab using the fopen/fwrite commands. I found some information that to open these type of files you need a *.nhdr-header file. I’ve created a basic one as below (image.nhdr).

 

In 3DSlicer v.4.6 I cannot find the option “FileàAdd volume”, so I reverted back and installed v.4.0 where this option is available. Anyway, I choosing to open volume, and then select my image.nhdr file. Clicking the “Open” button closes the file selection window, but my viewer is still empty (an empty pink box as when you start 3DSlicer). No error messages. I also tried via “FileàAdd data” (both in version 4.0 and 4.6), but with the same result. I am able to read and view image.raw in e.g. Amide viewer.

 

Can anyone point me in the right direction to open raw binary data files? Thanks!

/Ida

 

image.nhdr:

-----------------------------

NRRD0001

dimension: 2

type: uint16

sizes: 320 320

spacings: 1 1

encoding: RAW

endian: little

data file: image.raw

-----------------------------

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Open raw binay image using *.nhdr header

Andras Lasso-2

You may be also interested in Slicer’s MatlabBridge extension, which allows you to run your Matlab functions directly from Slicer. You can load all your input data into Slicer, visualize, preprocess them, etc., define input parameters for your Matlab function and run it by a few clicks, and immediately see the results in Slicer.

 

See more details here:

https://www.slicer.org/wiki/Documentation/Nightly/Extensions/MatlabBridge

 

Andras

 

 

From: slicer-users [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: January 5, 2017 8:53
To: [hidden email]
Cc: SPL Slicer Users <[hidden email]>
Subject: Re: [slicer-users] Open raw binay image using *.nhdr header

 

Dear Isaiah,

 

Thank you. I followed your suggestion and created an *.nrrd file from my images (using the Matlab codes in your link), instead of a separate header and data file. I was able to successfully open the image! A small note however is that it didn’t work with 2D images, so I had to do a 3D.

 

Thank you, and all the best.

/Ida

 

From: Isaiah Norton [[hidden email]]
Sent: den 4 januari 2017 14:35
To: Haeggstroem, Ida/Sloan Kettering Institute
Cc: SPL Slicer Users
Subject: Re: [slicer-users] Open raw binay image using *.nhdr header

 

NRRD i/o libraries are freely available for Matlab, as well as Python and many other languages. Probably the most up-to-date/tested one for the Slicer ecosystem is: 

 

 

There are several others on the FileExchange. Using an existing NRRD library is probably faster/safer than writing a new implementation from the spec (less fun though).

 

On Wed, Jan 4, 2017 at 1:39 PM, [hidden email] <[hidden email]> wrote:

Hello,

 

I’ve just installed 3DSlicer and am just starting to use it. I have a binary uint16 data file (image.raw) that I created in Matlab using the fopen/fwrite commands. I found some information that to open these type of files you need a *.nhdr-header file. I’ve created a basic one as below (image.nhdr).

 

In 3DSlicer v.4.6 I cannot find the option “FileàAdd volume”, so I reverted back and installed v.4.0 where this option is available. Anyway, I choosing to open volume, and then select my image.nhdr file. Clicking the “Open” button closes the file selection window, but my viewer is still empty (an empty pink box as when you start 3DSlicer). No error messages. I also tried via “FileàAdd data” (both in version 4.0 and 4.6), but with the same result. I am able to read and view image.raw in e.g. Amide viewer.

 

Can anyone point me in the right direction to open raw binary data files? Thanks!

/Ida

 

image.nhdr:

-----------------------------

NRRD0001

dimension: 2

type: uint16

sizes: 320 320

spacings: 1 1

encoding: RAW

endian: little

data file: image.raw

-----------------------------

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ