File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,8 +139,17 @@ int vtkIGTLToMRMLImage::UnpackIGTLMessage(igtl::MessageBase::Pointer message)
139139 {
140140 this ->InImageMessage ->GetMetaDataElement (MEMLNodeNameKey, this ->mrmlNodeTagName );
141141 }
142- else if (this ->InImageMessage -> GetHeaderVersion ( )==IGTL_HEADER_VERSION_1 )
142+ if (!( this ->mrmlNodeTagName . compare ( " " )==0 ) )
143143 {
144+ // The user specified mrmlnode is not supported by the converter.
145+ if (!this ->CheckIfMRMLSupported (this ->mrmlNodeTagName .c_str ()))
146+ {
147+ return 0 ;
148+ }
149+ }
150+ else
151+ {
152+ // The message is version1 or version 2 without meta information.
144153 int numberOfComponents=this ->InImageMessage ->GetNumComponents ();
145154 if (numberOfComponents == 1 )
146155 {
Original file line number Diff line number Diff line change @@ -83,7 +83,16 @@ int vtkIGTLToMRMLPoints::UnpackIGTLMessage(igtl::MessageBase::Pointer message)
8383 {
8484 this ->InPointMsg ->GetMetaDataElement (MEMLNodeNameKey, this ->mrmlNodeTagName );
8585 }
86- else if (this ->InPointMsg ->GetHeaderVersion ()==IGTL_HEADER_VERSION_1)
86+ if (!(this ->mrmlNodeTagName .compare (" " )==0 ))
87+ {
88+ // The user specified mrmlnode is not supported by the converter.
89+ if (!this ->CheckIfMRMLSupported (this ->mrmlNodeTagName .c_str ()))
90+ {
91+ return 0 ;
92+ }
93+ }
94+ else
95+ // The message is version1 or version 2 without meta information.
8796 {
8897 this ->mrmlNodeTagName = " MarkupsFiducial" ;
8998 }
Original file line number Diff line number Diff line change @@ -154,8 +154,17 @@ int vtkIGTLToMRMLPolyData::UnpackIGTLMessage(igtl::MessageBase::Pointer message)
154154 {
155155 this ->InPolyDataMessage ->GetMetaDataElement (MEMLNodeNameKey, this ->mrmlNodeTagName );
156156 }
157- else if (this ->InPolyDataMessage -> GetHeaderVersion ( )==IGTL_HEADER_VERSION_1 )
157+ if (!( this ->mrmlNodeTagName . compare ( " " )==0 ) )
158158 {
159+ // The user specified mrmlnode is not supported by the converter.
160+ if (!this ->CheckIfMRMLSupported (this ->mrmlNodeTagName .c_str ()))
161+ {
162+ return 0 ;
163+ }
164+ }
165+ else
166+ {
167+ // The message is version1 or version 2 without meta information.
159168 this ->mrmlNodeTagName = " Model" ;
160169 }
161170 return 1 ;
You can’t perform that action at this time.
0 commit comments