Skip to content

Commit

Permalink
BUG: Fix config generation
Browse files Browse the repository at this point in the history
  • Loading branch information
NicerNewerCar committed Mar 11, 2024
1 parent 8292878 commit 8c6f860
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion AutoscoperM/AutoscoperM.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,17 @@ def onGenerateConfig(self):
int(self.ui.flipZ.isChecked()),
]

if self.logic.is_4d:
voxel_spacing = self.logic.getItemInSequence(volumeNode, 0).GetSpacing()
else:
voxel_spacing = volumeNode.GetSpacing()
# generate the config file
configFilePath = IO.generateConfigFile(
mainOutputDir,
[tiffSubDir, vrgSubDir, calibrationSubDir],
trialName,
volumeFlip=volumeFlip,
voxelSize=volumeNode.GetSpacing(),
voxelSize=voxel_spacing,
renderResolution=[int(width / 2), int(height / 2)],
optimizationOffsets=optimizationOffsets,
)
Expand Down
9 changes: 9 additions & 0 deletions AutoscoperM/AutoscoperMLib/IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,17 @@ def writeVolume(volumeNode: slicer.vtkMRMLVolumeNode, filename: str):
:param volumeNode: Volume node
:param filename: Output file name
"""
# tfm = vtk.vtkMatrix4x4()
# tfm.Identity()
# tfm.SetElement(0, 0, -1)
# tfm.SetElement(1, 1, -1)
# transformNode = slicer.vtkMRMLLinearTransformNode()
# transformNode.SetMatrixTransformToParent(tfm)
# slicer.mrmlScene.AddNode(transformNode)
slicer.util.exportNode(volumeNode, filename, {"useCompression": False}, world=True)

# slicer.mrmlScene.RemoveNode(transformNode)


def castVolumeForTIFF(volumeNode: slicer.vtkMRMLVolumeNode):
"""
Expand Down

0 comments on commit 8c6f860

Please sign in to comment.