Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MHD writter Format not readable by SimpleITK or 3D slicer #18

Closed
waltsims opened this issue Jan 13, 2018 · 2 comments
Closed

MHD writter Format not readable by SimpleITK or 3D slicer #18

waltsims opened this issue Jan 13, 2018 · 2 comments
Labels

Comments

@waltsims
Copy link
Member

waltsims commented Jan 13, 2018

Background information

written Beamformed (3D) mhd files are not readable by either Simple ITK or 3D Slicer.

File

ObjectType = Image
NDims = 3
DimSize = 256 2000 26        
ElementNumberOfChannels = 1
ElementType = MET_UCHAR
ElementSpacing = 0.02001000500250125005 0.02001000500250125005 1
AnatomicalOrientation = RAI
BinaryData = True
BinaryDataByteOrderMSB = False
CenterOfRotation = 0 0 0
CompressedData = False
TransformMatrix = 1 0 0 0 1 0 0 0 1
UltrasoundImageOrientation = MFA
UltrasoundImageType = BRIGHTNESS
ElementByteOrderMSB = False
Seq_Frame0000_ImageStatus = OK
Seq_Frame0000_Timestamp = 1515760436.051510096
Seq_Frame0001_ImageStatus = OK
Seq_Frame0001_Timestamp = 1515760436.626828194
Seq_Frame0002_ImageStatus = OK
Seq_Frame0002_Timestamp = 1515760437.204338074
Seq_Frame0003_ImageStatus = OK
Seq_Frame0003_Timestamp = 1515760437.782961369
Seq_Frame0004_ImageStatus = OK
Seq_Frame0004_Timestamp = 1515760438.362620831
Seq_Frame0005_ImageStatus = OK
Seq_Frame0005_Timestamp = 1515760438.941310644
Seq_Frame0006_ImageStatus = OK
Seq_Frame0006_Timestamp = 1515760439.531028748
Seq_Frame0007_ImageStatus = OK
Seq_Frame0007_Timestamp = 1515760440.108578205
Seq_Frame0008_ImageStatus = OK
Seq_Frame0008_Timestamp = 1515760440.688335657
Seq_Frame0009_ImageStatus = OK
Seq_Frame0009_Timestamp = 1515760441.269950628
Seq_Frame0010_ImageStatus = OK
Seq_Frame0010_Timestamp = 1515760441.848456621
Seq_Frame0011_ImageStatus = OK
Seq_Frame0011_Timestamp = 1515760442.428308725
Seq_Frame0012_ImageStatus = OK
Seq_Frame0012_Timestamp = 1515760443.006823063
Seq_Frame0013_ImageStatus = OK
Seq_Frame0013_Timestamp = 1515760443.585642338
Seq_Frame0014_ImageStatus = OK
Seq_Frame0014_Timestamp = 1515760444.164233446
Seq_Frame0015_ImageStatus = OK
Seq_Frame0015_Timestamp = 1515760444.742943048
Seq_Frame0016_ImageStatus = OK
Seq_Frame0016_Timestamp = 1515760445.322571278
Seq_Frame0017_ImageStatus = OK
Seq_Frame0017_Timestamp = 1515760445.902441978
Seq_Frame0018_ImageStatus = OK
Seq_Frame0018_Timestamp = 1515760446.479923725
Seq_Frame0019_ImageStatus = OK
Seq_Frame0019_Timestamp = 1515760447.072831154
Seq_Frame0020_ImageStatus = OK
Seq_Frame0020_Timestamp = 1515760447.673601389
Seq_Frame0021_ImageStatus = OK
Seq_Frame0021_Timestamp = 1515760448.252296448
Seq_Frame0022_ImageStatus = OK
Seq_Frame0022_Timestamp = 1515760448.842797518
Seq_Frame0023_ImageStatus = OK
Seq_Frame0023_Timestamp = 1515760449.629186869
Seq_Frame0024_ImageStatus = OK
Seq_Frame0024_Timestamp = 1515760450.214698553
Seq_Frame0025_ImageStatus = OK
Seq_Frame0027_Timestamp = 1515760450.801201105

3D Slicer error log:

File cannot be read: /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd for reading.
Reason: Undefined error: 0


Algorithm vtkITKArchetypeImageSeriesScalarReader(0x130eae5d0) returned failure for request: vtkInformation (0x60400386d580)
  Debug: Off
  Modified Time: 3516961
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_INFORMATION
  FORWARD_DIRECTION: 0
  ALGORITHM_AFTER_FORWARD: 1




ReadData: This is not a nrrd file


ReadData: Cannot read file as a volume of type DiffusionTensorVolume[fullName = /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd]
	Number of files listed in the node = 0.
	File reader says it was able to read 1 files.
	File reader used the archetype file name of /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd [reader 0th file name = /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd]
FileFormatError



ReadData: This is not a nrrd file


ReadData: Failed to instantiate a file reader


ReadData: Cannot read file as a volume of type Volume[fullName = /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd]
	Number of files listed in the node = 0.
	File reader says it was able to read 1 files.
	File reader used the archetype file name of /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd [reader 0th file name = /Volumes/data/MICCAI2018_ENHANCEMENT/scan_converted_ground_truth/With_Protocoll/Guillaume_Zahnd_33_M/Right/Transverse/Thyroid/rawData_19_beamformed.mhd]
FileFormatError

Solution:

After a comparison of past .mhd files It would seem the "ElementDataFile" tag is not being written to the end of the MHD. I have manually added the line and the file format can be loaded.

Missing line from example

ElementDataFile = rawData_6_beamformed.raw
@waltsims
Copy link
Member Author

waltsims commented Jan 15, 2018

MhdSequenceWritter.cpp Line 180 is this still being called? I will do some further searching.

@waltsims
Copy link
Member Author

ImageOutputDevice.cpp Line99 ->close() is called but not ->closeFiles() which so the last line is not written if I read the code correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants