Closed egarza closed 5 years ago
As a follow-up, I made an object as the mean of all my subject (rh_average.obj
), and that one worked. So it's a problem with the file. Got it from here: [http://www.bic.mni.mcgill.ca/ServicesSoftware/CIVET-2-1-0-Statistical-Analyses-Surfstat]
Hmm, I think I've seen something like this before, just had to do with a missing newline. Although if you're using CIVET 2.1 you should not use the CIVET 2.0 surfaces, they are not the same, this bit me a while back.
EDIT: The parser is a pretty weak hack. It doesn't actually respect the full BIC-OBJ spec. It's something that would be worth fixing, but not a high priority at the moment especially if this problem can be fixed by adding/removing a newline at the end of the obj file.
Its really sad that there's essentially no third-party OBJ reader.....
Does VTK not handle everything properly?
Okay, yes, VTK does read it, I just can't grok the VTK datastructures at all
Thanks for the help. 1) Where can I find the 2.1 surface ICBM templates? 2) Which line should be corrected with what info?
Thanks
I got the 2.1 surfaces from Claude LePage, I think if you send him an email he'll send you them.
If it's the problem I'm thinking of it's the last line of the file, there's either an extra, or a missing newline.
Will do, thanks.
Hi Chris,
Got an answer from Claude, here are some of the comments:
-This sounds like a bug in the read_obj parser. -The model surfaces for CIVET-2.0.0 and CIVET-2.1.0 are the same. They are based on the marching-cubes surfaces. Note that the CIVET-1.1.12 model surface (and all prior versions) is different from CIVET-2.X.Y. The vertex projections and distribution is different in CIVET-1.X (ASP deformable ellipsoid model) and CIVET-2.X (marching-cubes). -Is your parser expecting to read a space in the first column?
CIVET-1.1.12 model surface:
P 0.3 0.3 0.4 10 1 40962 -2.86076 25.1982 16.6128 -13.9641 -58.3774 20.3814 -40.2469 9.32828 8.83384 -44.9451 -47.1145 17.8576
CIVET-2.0.0 model surface:
P 0.3 0.3 0.4 10 1 40962 -4.03771 40.0262 15.9554 -18.836 -56.0411 16.8517 -47.0494 2.62527 8.28734 -45.8479 -44.4945 17.6259
The reader should be free format.
Ahh my mistake, I misremembered, it's not the surfaces but the AAL atlas that's changed.
I just checked the 2.0 vs 2.1 object files that I have. It is exactly as I claimed, the 2.0 has an extra newline at the end of the file. Just delete it and you will be fine.
Ok, I deleted the last line and now I don't get the error. I only get the "names" error:
icbm_obj_left <- read_obj("CIVET_2.0_icbm_avg_mid_sym_mc_left2.obj", use_civet_triangles = FALSE)
Error in names(object) <- nm :
'names' attribute [5] must be the same length as the vector [4]```
Interestingly, this last error is only on the LEFT, not the right object. The other one was uploaded succesfully.
Hi Eduardo, I'm very sorry I gave you some bad advice, the problem was the left object was missing a newline after the vertex block, not the right having an extra. I've fixed the parser so this won't be a problem any longer. Sorry for the inconvenience.
Hi,
Not to worry, I appreciate the help and glad it got figured out. So, should I update the read_obj or what do I do next?
Thanks
Eduardo
I'm trying to read an OBJ file to use in
obj_to_graph
andvertexFindPeaks
. However it gives me a strange error:The obj file works in Display and opens with nano.
Thanks