File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,10 @@ def _read():
144144 streamlines = ArraySequence (tck_reader )
145145 tractogram = Tractogram (streamlines )
146146
147+ # By definition.
147148 tractogram .affine_to_rasmm = np .eye (4 )
149+ hdr [Field .VOXEL_TO_RASMM ] = np .eye (4 )
150+
148151 return cls (tractogram , header = hdr )
149152
150153 def save (self , fileobj ):
@@ -230,8 +233,11 @@ def _write_header(fileobj, header):
230233 from the beginning of the TCK header).
231234 """
232235 # Fields to exclude
233- exclude = [Field .MAGIC_NUMBER , Field .NB_STREAMLINES , Field .ENDIANNESS ,
234- "count" , "datatype" , "file" ]
236+ exclude = [Field .MAGIC_NUMBER , # Handled separately.
237+ Field .NB_STREAMLINES , # Handled separately.
238+ Field .ENDIANNESS , # Handled separately.
239+ Field .VOXEL_TO_RASMM , # Streamlines are always in RAS+ mm.
240+ "count" , "datatype" , "file" ] # Fields being replaced.
235241
236242 lines = []
237243 lines .append (header [Field .MAGIC_NUMBER ])
You can’t perform that action at this time.
0 commit comments