How read the 3D image ?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vasantha Lakshmi
el 4 de Mzo. de 2017
Comentada: Vasantha Lakshmi
el 4 de Mzo. de 2017
I read the .mha file using mha_read_header(filename),but it is showing error.
Invalid field name: 'dim[0]'.
Error in mha_read_header (line 78) info.(type)=data;
Error in three (line 1) info = mha_read_header('a.mha'); What can I do to solve this problem.
0 comentarios
Respuesta aceptada
Guillaume
el 4 de Mzo. de 2017
I'm assuming you're using this function (always a good idea to mention where your code comes from). I don't know anything about it but after a quick glance it would appear that your file contains a field in the header that the reader doesn't know about. When reading unknown field, it simply creates a field with the same name in the output structure.
Unfortunately, in your case, that unknown field is not a valid field name for matlab structures. The quick fix would be to modify that line 78 to:
info(matlab.lang.makeValidName(type)) = data;
While that would fix the immediate error, there's no guarantee that the code will yet be able to read your file since, as said, the code knows nothing about that dim[0] field which may well be critical.
3 comentarios
Guillaume
el 4 de Mzo. de 2017
Well, clearly that reader cannot read your file. You will have to find a different reader or save your file in a way supported by that reader. Failing that, you will have to write your own reader.
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Data en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!