From 9af7c19df2ee9a0c7240fd13e7d34fc3491e8a68 Mon Sep 17 00:00:00 2001 From: Vivek Gopalakrishnan Date: Wed, 10 Jul 2024 08:46:54 -0400 Subject: [PATCH] Initialize calibration matrix with (#304) --- diffdrr/drr.py | 3 +-- notebooks/api/00_drr.ipynb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/diffdrr/drr.py b/diffdrr/drr.py index 1b9c6abd8..b348c18ee 100644 --- a/diffdrr/drr.py +++ b/diffdrr/drr.py @@ -65,7 +65,6 @@ def __init__( # Initialize the volume and world geometry self.subject = subject - self.volume = subject.volume.data.squeeze() self.register_buffer( "_affine", torch.as_tensor(subject.volume.affine, dtype=torch.float32).unsqueeze(0), @@ -197,7 +196,7 @@ def set_intrinsics( n_subsample=self.detector.n_subsample, reverse_x_axis=self.detector.reverse_x_axis, reorient=self.subject.reorient, - ).to(self.volume) + ).to(self.density) # %% ../notebooks/api/00_drr.ipynb 12 @patch diff --git a/notebooks/api/00_drr.ipynb b/notebooks/api/00_drr.ipynb index 4a0c5ab7c..32ded8b4e 100644 --- a/notebooks/api/00_drr.ipynb +++ b/notebooks/api/00_drr.ipynb @@ -160,7 +160,6 @@ "\n", " # Initialize the volume and world geometry\n", " self.subject = subject\n", - " self.volume = subject.volume.data.squeeze()\n", " self.register_buffer(\n", " \"_affine\",\n", " torch.as_tensor(subject.volume.affine, dtype=torch.float32).unsqueeze(0),\n", @@ -324,7 +323,7 @@ " n_subsample=self.detector.n_subsample,\n", " reverse_x_axis=self.detector.reverse_x_axis,\n", " reorient=self.subject.reorient,\n", - " ).to(self.volume)" + " ).to(self.density)" ] }, {