diff --git a/app.py b/app.py index d42ffa3..d34c902 100644 --- a/app.py +++ b/app.py @@ -195,10 +195,16 @@ def normalize_slice(image: np.ndarray, p_low: float = 1.0, p_high: float = 99.0) return np.clip((image - low) / (high - low), 0.0, 1.0) -def orient_for_display(image: np.ndarray) -> np.ndarray: - """统一显示方向,让三视图在网页中更接近医学浏览器观感。""" +def orient_for_display(image: np.ndarray, plane: str) -> np.ndarray: + """按平面统一显示方向。 - return np.rot90(image) + 数组轴约定为 (X, Y, Z),其中 Z 轴在当前患者1 DICOM 中从头侧到足侧 + 递增。冠状面和矢状面应让 Z 轴作为屏幕竖直方向,避免头脚倒置。 + """ + + if image.ndim == 3 and image.shape[-1] in (3, 4): + return np.swapaxes(image, 0, 1) + return image.T def get_slice(volume_xyz: np.ndarray, plane: str, index: int) -> np.ndarray: @@ -267,18 +273,18 @@ def format_mm(value: float) -> str: return f"{value:.2f}" -def render_image(image: np.ndarray, caption: str, cmap: str = "gray") -> None: +def render_image(image: np.ndarray, caption: str, cmap: str = "gray", plane: str = "Axial") -> None: fig, ax = plt.subplots(figsize=(4.8, 4.8), dpi=120) - ax.imshow(orient_for_display(image), cmap=cmap, interpolation="nearest") + ax.imshow(orient_for_display(image, plane), cmap=cmap, interpolation="nearest") ax.set_title(caption, fontsize=10) ax.axis("off") st.pyplot(fig, width="stretch") plt.close(fig) -def render_rgb(image: np.ndarray, caption: str) -> None: +def render_rgb(image: np.ndarray, caption: str, plane: str = "Axial") -> None: fig, ax = plt.subplots(figsize=(4.8, 4.8), dpi=120) - ax.imshow(orient_for_display(image), interpolation="nearest") + ax.imshow(orient_for_display(image, plane), interpolation="nearest") ax.set_title(caption, fontsize=10) ax.axis("off") st.pyplot(fig, width="stretch") @@ -290,14 +296,15 @@ def render_heatmap_overlay( mag_slice: np.ndarray, alpha: float, caption: str, + plane: str, vmin: float, vmax: float, show_base: bool, ) -> None: fig, ax = plt.subplots(figsize=(4.8, 4.8), dpi=120) if show_base: - ax.imshow(orient_for_display(normalize_slice(base_slice)), cmap="gray", interpolation="nearest") - heat = orient_for_display(mag_slice) + ax.imshow(orient_for_display(normalize_slice(base_slice), plane), cmap="gray", interpolation="nearest") + heat = orient_for_display(mag_slice, plane) im = ax.imshow( heat, cmap="turbo", @@ -321,7 +328,7 @@ def render_three_views(volume_xyz: np.ndarray, title: str) -> None: axis = plane_axis(plane) with col: index = st.slider(f"{cn_name}", 0, volume_xyz.shape[axis] - 1, volume_xyz.shape[axis] // 2, key=f"{title}-{plane}") - render_image(get_slice(volume_xyz, plane, index), f"{cn_name} #{index}") + render_image(get_slice(volume_xyz, plane, index), f"{cn_name} #{index}", plane=plane) def render_three_way_views(fixed_xyz: np.ndarray, moving_xyz: np.ndarray, warped_xyz: np.ndarray | None) -> None: @@ -351,7 +358,7 @@ def render_three_way_views(fixed_xyz: np.ndarray, moving_xyz: np.ndarray, warped if volume is None: st.info("待生成") else: - render_image(get_slice(volume, plane, index), f"{label} #{index}") + render_image(get_slice(volume, plane, index), f"{label} #{index}", plane=plane) def render_overlay_views(fixed_xyz: np.ndarray, warped_xyz: np.ndarray) -> None: @@ -369,9 +376,9 @@ def render_overlay_views(fixed_xyz: np.ndarray, warped_xyz: np.ndarray) -> None: fixed_slice = get_slice(fixed_xyz, plane, index) warped_slice = get_slice(warped_xyz, plane, index) if mode == "棋盘格": - render_image(checkerboard(fixed_slice, warped_slice, tile=tile), f"{cn_name} 棋盘格 #{index}") + render_image(checkerboard(fixed_slice, warped_slice, tile=tile), f"{cn_name} 棋盘格 #{index}", plane=plane) else: - render_rgb(alpha_overlay(fixed_slice, warped_slice, alpha=alpha), f"{cn_name} 融合 #{index}") + render_rgb(alpha_overlay(fixed_slice, warped_slice, alpha=alpha), f"{cn_name} 融合 #{index}", plane=plane) def render_ddf_views(fixed_xyz: np.ndarray, ddf_xyz: np.ndarray) -> None: @@ -410,6 +417,7 @@ def render_ddf_views(fixed_xyz: np.ndarray, ddf_xyz: np.ndarray) -> None: get_slice(fixed_xyz, plane, index), get_slice(mag, plane, index), alpha=alpha, + plane=plane, vmin=vmin, vmax=vmax, show_base=show_base, diff --git a/data_loader.py b/data_loader.py index 0b94ad2..8c56290 100644 --- a/data_loader.py +++ b/data_loader.py @@ -205,8 +205,8 @@ def _make_affine( col_cos = np.asarray(orientation[3:], dtype=np.float64) normal = np.cross(row_cos, col_cos) - affine[:3, 0] = row_cos * col_spacing - affine[:3, 1] = col_cos * row_spacing + affine[:3, 0] = col_cos * col_spacing + affine[:3, 1] = row_cos * row_spacing if len(sorted_headers) > 1 and hasattr(sorted_headers[-1][1], "ImagePositionPatient"): last_origin = np.asarray(sorted_headers[-1][1].ImagePositionPatient, dtype=np.float64) @@ -351,4 +351,3 @@ def main(argv: Iterable[str] | None = None) -> None: if __name__ == "__main__": main() - diff --git a/outputs/checkpoints/vxm_head_ct_patient1.history.json b/outputs/checkpoints/vxm_head_ct_patient1.history.json index 98019d3..ae860aa 100644 --- a/outputs/checkpoints/vxm_head_ct_patient1.history.json +++ b/outputs/checkpoints/vxm_head_ct_patient1.history.json @@ -1,482 +1,482 @@ [ { "epoch": 1.0, - "loss": 0.04345163702964783, - "image_loss": 0.04345163702964783, - "smooth_loss": 5.719839749410149e-13 + "loss": 0.04345167055726051, + "image_loss": 0.04345167055726051, + "smooth_loss": 7.973467264048295e-13 }, { "epoch": 2.0, - "loss": 0.043440207839012146, - "image_loss": 0.043440207839012146, - "smooth_loss": 1.4629444322622476e-09 + "loss": 0.04343467578291893, + "image_loss": 0.04343467578291893, + "smooth_loss": 2.538202981128279e-09 }, { "epoch": 3.0, - "loss": 0.04342950880527496, - "image_loss": 0.04342950880527496, - "smooth_loss": 5.5231410556189076e-09 + "loss": 0.04341816157102585, + "image_loss": 0.04341816157102585, + "smooth_loss": 9.840271708583259e-09 }, { "epoch": 4.0, - "loss": 0.04341849684715271, - "image_loss": 0.04341849684715271, - "smooth_loss": 1.247603442777745e-08 + "loss": 0.043401315808296204, + "image_loss": 0.043401315808296204, + "smooth_loss": 2.223881523377713e-08 }, { "epoch": 5.0, - "loss": 0.043407391756772995, - "image_loss": 0.043407391756772995, - "smooth_loss": 2.2369590624293778e-08 + "loss": 0.043384306132793427, + "image_loss": 0.043384306132793427, + "smooth_loss": 3.976056106580472e-08 }, { "epoch": 6.0, - "loss": 0.04339618235826492, - "image_loss": 0.04339618235826492, - "smooth_loss": 3.538238146916228e-08 + "loss": 0.04336709901690483, + "image_loss": 0.04336709901690483, + "smooth_loss": 6.27582252832326e-08 }, { "epoch": 7.0, - "loss": 0.04338495060801506, - "image_loss": 0.04338495060801506, - "smooth_loss": 5.16029103891924e-08 + "loss": 0.04334980994462967, + "image_loss": 0.04334980994462967, + "smooth_loss": 9.102060971599713e-08 }, { "epoch": 8.0, - "loss": 0.0433737076818943, - "image_loss": 0.0433737076818943, - "smooth_loss": 7.094314469213714e-08 + "loss": 0.043332427740097046, + "image_loss": 0.043332427740097046, + "smooth_loss": 1.2480792577207467e-07 }, { "epoch": 9.0, - "loss": 0.04336243495345116, - "image_loss": 0.04336243495345116, - "smooth_loss": 9.347723306518674e-08 + "loss": 0.043314896523952484, + "image_loss": 0.043314896523952484, + "smooth_loss": 1.640803759528353e-07 }, { "epoch": 10.0, - "loss": 0.04335121437907219, - "image_loss": 0.04335121437907219, - "smooth_loss": 1.1908265662441408e-07 + "loss": 0.04329724982380867, + "image_loss": 0.04329724609851837, + "smooth_loss": 2.095679008107254e-07 }, { "epoch": 11.0, - "loss": 0.043339941650629044, - "image_loss": 0.043339941650629044, - "smooth_loss": 1.482868015045824e-07 + "loss": 0.043279509991407394, + "image_loss": 0.043279506266117096, + "smooth_loss": 2.603907205411815e-07 }, { "epoch": 12.0, - "loss": 0.043328724801540375, - "image_loss": 0.043328724801540375, - "smooth_loss": 1.804429388130302e-07 + "loss": 0.043261729180812836, + "image_loss": 0.04326172545552254, + "smooth_loss": 3.173354627961089e-07 }, { "epoch": 13.0, - "loss": 0.04331750050187111, - "image_loss": 0.04331749677658081, - "smooth_loss": 2.166258354918682e-07 + "loss": 0.04324381425976753, + "image_loss": 0.043243810534477234, + "smooth_loss": 3.795951784013596e-07 }, { "epoch": 14.0, - "loss": 0.043306246399879456, - "image_loss": 0.04330624267458916, - "smooth_loss": 2.5594988528609974e-07 + "loss": 0.043225787580013275, + "image_loss": 0.04322578385472298, + "smooth_loss": 4.4845353386335773e-07 }, { "epoch": 15.0, - "loss": 0.04329502210021019, - "image_loss": 0.04329501837491989, - "smooth_loss": 2.9920690280960116e-07 + "loss": 0.04320768266916275, + "image_loss": 0.04320767894387245, + "smooth_loss": 5.237804430180404e-07 }, { "epoch": 16.0, - "loss": 0.043283771723508835, - "image_loss": 0.043283767998218536, - "smooth_loss": 3.4602453524712473e-07 + "loss": 0.043189436197280884, + "image_loss": 0.04318942874670029, + "smooth_loss": 6.067613185223308e-07 }, { "epoch": 17.0, - "loss": 0.043272584676742554, - "image_loss": 0.043272580951452255, - "smooth_loss": 3.9618711866751255e-07 + "loss": 0.04317121580243111, + "image_loss": 0.04317120835185051, + "smooth_loss": 6.953084721317282e-07 }, { "epoch": 18.0, - "loss": 0.043261270970106125, - "image_loss": 0.043261267244815826, - "smooth_loss": 4.4989539560447156e-07 + "loss": 0.04315273091197014, + "image_loss": 0.04315272346138954, + "smooth_loss": 7.918374649307225e-07 }, { "epoch": 19.0, - "loss": 0.04325007647275925, - "image_loss": 0.04325007274746895, - "smooth_loss": 5.079763809590077e-07 + "loss": 0.04313427209854126, + "image_loss": 0.04313426464796066, + "smooth_loss": 8.949302241489931e-07 }, { "epoch": 20.0, - "loss": 0.04323875159025192, - "image_loss": 0.043238744139671326, - "smooth_loss": 5.703672059098608e-07 + "loss": 0.043115634471178055, + "image_loss": 0.04311562329530716, + "smooth_loss": 1.007904529615189e-06 }, { "epoch": 21.0, - "loss": 0.04322751984000206, - "image_loss": 0.04322751238942146, - "smooth_loss": 6.375527732416231e-07 + "loss": 0.04309699311852455, + "image_loss": 0.043096981942653656, + "smooth_loss": 1.1237173112021992e-06 }, { "epoch": 22.0, - "loss": 0.04321633651852608, - "image_loss": 0.04321632906794548, - "smooth_loss": 7.064697911118856e-07 + "loss": 0.04307829961180687, + "image_loss": 0.043078288435935974, + "smooth_loss": 1.2487153071560897e-06 }, { "epoch": 23.0, - "loss": 0.043204840272665024, - "image_loss": 0.04320483282208443, - "smooth_loss": 7.851771215428016e-07 + "loss": 0.04305942729115486, + "image_loss": 0.04305941238999367, + "smooth_loss": 1.3817742683386314e-06 }, { "epoch": 24.0, - "loss": 0.0431935153901577, - "image_loss": 0.0431935079395771, - "smooth_loss": 8.643701221444644e-07 + "loss": 0.04304048791527748, + "image_loss": 0.04304047301411629, + "smooth_loss": 1.523869514130638e-06 }, { "epoch": 25.0, - "loss": 0.043182097375392914, - "image_loss": 0.04318208619952202, - "smooth_loss": 9.485592045166413e-07 + "loss": 0.043021369725465775, + "image_loss": 0.04302135482430458, + "smooth_loss": 1.673569840932032e-06 }, { "epoch": 26.0, - "loss": 0.043170712888240814, - "image_loss": 0.04317070171236992, - "smooth_loss": 1.0357232440583175e-06 + "loss": 0.0430021807551384, + "image_loss": 0.043002162128686905, + "smooth_loss": 1.8318612546863733e-06 }, { "epoch": 27.0, - "loss": 0.043159086257219315, - "image_loss": 0.04315907508134842, - "smooth_loss": 1.1295738886474282e-06 + "loss": 0.042982880026102066, + "image_loss": 0.042982861399650574, + "smooth_loss": 1.999623236770276e-06 }, { "epoch": 28.0, - "loss": 0.043147530406713486, - "image_loss": 0.04314751923084259, - "smooth_loss": 1.2269233593542594e-06 + "loss": 0.04296348989009857, + "image_loss": 0.04296346753835678, + "smooth_loss": 2.1766943518741755e-06 }, { "epoch": 29.0, - "loss": 0.04313572868704796, - "image_loss": 0.043135713785886765, - "smooth_loss": 1.3320702691999031e-06 + "loss": 0.0429437980055809, + "image_loss": 0.04294377565383911, + "smooth_loss": 2.364331521675922e-06 }, { "epoch": 30.0, - "loss": 0.04312397539615631, - "image_loss": 0.04312396049499512, - "smooth_loss": 1.4407385151571361e-06 + "loss": 0.042924124747514725, + "image_loss": 0.042924098670482635, + "smooth_loss": 2.5605511382309487e-06 }, { "epoch": 31.0, - "loss": 0.04311199113726616, - "image_loss": 0.043111976236104965, - "smooth_loss": 1.5546060012638918e-06 + "loss": 0.04290420934557915, + "image_loss": 0.04290418326854706, + "smooth_loss": 2.7652192784444196e-06 }, { "epoch": 32.0, - "loss": 0.04309987276792526, - "image_loss": 0.04309985786676407, - "smooth_loss": 1.6753501768107526e-06 + "loss": 0.04288414120674133, + "image_loss": 0.042884111404418945, + "smooth_loss": 2.9825951060047373e-06 }, { "epoch": 33.0, - "loss": 0.04308755695819855, - "image_loss": 0.043087538331747055, - "smooth_loss": 1.8031345234703622e-06 + "loss": 0.04286372289061546, + "image_loss": 0.04286368936300278, + "smooth_loss": 3.2103657758852933e-06 }, { "epoch": 34.0, - "loss": 0.04307503253221512, - "image_loss": 0.043075013905763626, - "smooth_loss": 1.9371573216631077e-06 + "loss": 0.04284300282597542, + "image_loss": 0.04284296929836273, + "smooth_loss": 3.4543097626738017e-06 }, { "epoch": 35.0, - "loss": 0.0430622436106205, - "image_loss": 0.04306222125887871, - "smooth_loss": 2.0795719137822744e-06 + "loss": 0.04282204434275627, + "image_loss": 0.04282200708985329, + "smooth_loss": 3.7117115425644442e-06 }, { "epoch": 36.0, - "loss": 0.04304904118180275, - "image_loss": 0.04304901883006096, - "smooth_loss": 2.2306476239464246e-06 + "loss": 0.042800623923540115, + "image_loss": 0.04280058294534683, + "smooth_loss": 3.984146587754367e-06 }, { "epoch": 37.0, - "loss": 0.04303569346666336, - "image_loss": 0.04303567111492157, - "smooth_loss": 2.3862683065090096e-06 + "loss": 0.042778871953487396, + "image_loss": 0.04277883097529411, + "smooth_loss": 4.26772930950392e-06 }, { "epoch": 38.0, - "loss": 0.043021950870752335, - "image_loss": 0.043021924793720245, - "smooth_loss": 2.5546942197252065e-06 + "loss": 0.042756516486406326, + "image_loss": 0.042756471782922745, + "smooth_loss": 4.5747947297059e-06 }, { "epoch": 39.0, - "loss": 0.04300765320658684, - "image_loss": 0.04300762712955475, - "smooth_loss": 2.7329397198627703e-06 + "loss": 0.04273395985364914, + "image_loss": 0.04273391142487526, + "smooth_loss": 4.8872716433834285e-06 }, { "epoch": 40.0, - "loss": 0.04299306869506836, - "image_loss": 0.04299303889274597, - "smooth_loss": 2.9173079383326694e-06 + "loss": 0.042710497975349426, + "image_loss": 0.04271044582128525, + "smooth_loss": 5.230245278653456e-06 }, { "epoch": 41.0, - "loss": 0.04297754168510437, - "image_loss": 0.04297751188278198, - "smooth_loss": 3.1240251701092348e-06 + "loss": 0.042686574161052704, + "image_loss": 0.04268651828169823, + "smooth_loss": 5.590812179434579e-06 }, { "epoch": 42.0, - "loss": 0.042961329221725464, - "image_loss": 0.04296129569411278, - "smooth_loss": 3.3366113711963408e-06 + "loss": 0.04266198351979256, + "image_loss": 0.04266192391514778, + "smooth_loss": 5.9741264522017445e-06 }, { "epoch": 43.0, - "loss": 0.04294413700699806, - "image_loss": 0.04294409975409508, - "smooth_loss": 3.5652053611556767e-06 + "loss": 0.042636603116989136, + "image_loss": 0.04263653978705406, + "smooth_loss": 6.383262643794296e-06 }, { "epoch": 44.0, - "loss": 0.04292583465576172, - "image_loss": 0.042925797402858734, - "smooth_loss": 3.8064451928221388e-06 + "loss": 0.04261031001806259, + "image_loss": 0.04261024296283722, + "smooth_loss": 6.8266344896983355e-06 }, { "epoch": 45.0, - "loss": 0.04290642961859703, - "image_loss": 0.04290638864040375, - "smooth_loss": 4.066736892127665e-06 + "loss": 0.04258330538868904, + "image_loss": 0.04258323088288307, + "smooth_loss": 7.2975317380041815e-06 }, { "epoch": 46.0, - "loss": 0.04288554936647415, - "image_loss": 0.04288550466299057, - "smooth_loss": 4.346161858848063e-06 + "loss": 0.04255487769842148, + "image_loss": 0.04255479946732521, + "smooth_loss": 7.807850124663673e-06 }, { "epoch": 47.0, - "loss": 0.04286346957087517, - "image_loss": 0.042863424867391586, - "smooth_loss": 4.647703008231474e-06 + "loss": 0.04252566769719124, + "image_loss": 0.04252558574080467, + "smooth_loss": 8.353195880772546e-06 }, { "epoch": 48.0, - "loss": 0.042839810252189636, - "image_loss": 0.042839761823415756, - "smooth_loss": 4.978734978067223e-06 + "loss": 0.04249507933855057, + "image_loss": 0.042494989931583405, + "smooth_loss": 8.943944521888625e-06 }, { "epoch": 49.0, - "loss": 0.04281448572874069, - "image_loss": 0.042814433574676514, - "smooth_loss": 5.339582457963843e-06 + "loss": 0.0424627885222435, + "image_loss": 0.04246269166469574, + "smooth_loss": 9.588722605258226e-06 }, { "epoch": 50.0, - "loss": 0.04278765991330147, - "image_loss": 0.04278760403394699, - "smooth_loss": 5.742196663049981e-06 + "loss": 0.04242905229330063, + "image_loss": 0.04242894798517227, + "smooth_loss": 1.0287140867148992e-05 }, { "epoch": 51.0, - "loss": 0.04275878146290779, - "image_loss": 0.04275871813297272, - "smooth_loss": 6.183304776641307e-06 + "loss": 0.04239347577095032, + "image_loss": 0.042393364012241364, + "smooth_loss": 1.1050098692066967e-05 }, { "epoch": 52.0, - "loss": 0.04272802174091339, - "image_loss": 0.04272795468568802, - "smooth_loss": 6.67552012600936e-06 + "loss": 0.04235628619790077, + "image_loss": 0.04235616698861122, + "smooth_loss": 1.1882912076544017e-05 }, { "epoch": 53.0, - "loss": 0.042694948613643646, - "image_loss": 0.042694877833127975, - "smooth_loss": 7.233465112221893e-06 + "loss": 0.04231661930680275, + "image_loss": 0.0423164926469326, + "smooth_loss": 1.280832202610327e-05 }, { "epoch": 54.0, - "loss": 0.04265972599387169, - "image_loss": 0.04265964776277542, - "smooth_loss": 7.846486369089689e-06 + "loss": 0.04227461293339729, + "image_loss": 0.04227447509765625, + "smooth_loss": 1.3828514056513086e-05 }, { "epoch": 55.0, - "loss": 0.04262172058224678, - "image_loss": 0.042621634900569916, - "smooth_loss": 8.557326509617269e-06 + "loss": 0.04222995415329933, + "image_loss": 0.04222980514168739, + "smooth_loss": 1.4973198631196283e-05 }, { "epoch": 56.0, - "loss": 0.04258149117231369, - "image_loss": 0.04258139804005623, - "smooth_loss": 9.357276212540455e-06 + "loss": 0.04218239709734917, + "image_loss": 0.042182233184576035, + "smooth_loss": 1.6268028048216365e-05 }, { "epoch": 57.0, - "loss": 0.042538225650787354, - "image_loss": 0.042538121342659, - "smooth_loss": 1.0288686098647304e-05 + "loss": 0.04213171452283859, + "image_loss": 0.042131535708904266, + "smooth_loss": 1.769593291101046e-05 }, { "epoch": 58.0, - "loss": 0.042492616921663284, - "image_loss": 0.04249250143766403, - "smooth_loss": 1.136589708039537e-05 + "loss": 0.04207799583673477, + "image_loss": 0.04207780212163925, + "smooth_loss": 1.931707447511144e-05 }, { "epoch": 59.0, - "loss": 0.042444635182619095, - "image_loss": 0.04244450852274895, - "smooth_loss": 1.261604847968556e-05 + "loss": 0.04202032461762428, + "image_loss": 0.04202011227607727, + "smooth_loss": 2.1214036678429693e-05 }, { "epoch": 60.0, - "loss": 0.042394258081912994, - "image_loss": 0.04239411652088165, - "smooth_loss": 1.4080704204388894e-05 + "loss": 0.04196003079414368, + "image_loss": 0.041959796100854874, + "smooth_loss": 2.3397296899929643e-05 }, { "epoch": 61.0, - "loss": 0.04234214872121811, - "image_loss": 0.042341988533735275, - "smooth_loss": 1.583471203048248e-05 + "loss": 0.041896041482686996, + "image_loss": 0.041895780712366104, + "smooth_loss": 2.594158831925597e-05 }, { "epoch": 62.0, - "loss": 0.042289428412914276, - "image_loss": 0.04228924959897995, - "smooth_loss": 1.7939397366717458e-05 + "loss": 0.04183032363653183, + "image_loss": 0.04183003306388855, + "smooth_loss": 2.8978509362787008e-05 }, { "epoch": 63.0, - "loss": 0.04223756119608879, - "image_loss": 0.042237356305122375, - "smooth_loss": 2.041880725300871e-05 + "loss": 0.041763920336961746, + "image_loss": 0.04176359623670578, + "smooth_loss": 3.259596269344911e-05 }, { "epoch": 64.0, - "loss": 0.04218873754143715, - "image_loss": 0.042188502848148346, - "smooth_loss": 2.3403612431138754e-05 + "loss": 0.04170043766498566, + "image_loss": 0.04170006886124611, + "smooth_loss": 3.688539072754793e-05 }, { "epoch": 65.0, - "loss": 0.04214523360133171, - "image_loss": 0.04214496165513992, - "smooth_loss": 2.7044574380852282e-05 + "loss": 0.04164355620741844, + "image_loss": 0.041643135249614716, + "smooth_loss": 4.208265454508364e-05 }, { "epoch": 66.0, - "loss": 0.042111899703741074, - "image_loss": 0.042111586779356, - "smooth_loss": 3.138223473797552e-05 + "loss": 0.04160033538937569, + "image_loss": 0.04159985110163689, + "smooth_loss": 4.8408655857201666e-05 }, { "epoch": 67.0, - "loss": 0.04209335148334503, - "image_loss": 0.04209298640489578, - "smooth_loss": 3.650638245744631e-05 + "loss": 0.04158158600330353, + "image_loss": 0.04158102720975876, + "smooth_loss": 5.584879545494914e-05 }, { "epoch": 68.0, - "loss": 0.042094651609659195, - "image_loss": 0.04209422692656517, - "smooth_loss": 4.229835394653492e-05 + "loss": 0.04159628227353096, + "image_loss": 0.041595637798309326, + "smooth_loss": 6.430283247027546e-05 }, { "epoch": 69.0, - "loss": 0.0421144962310791, - "image_loss": 0.0421140156686306, - "smooth_loss": 4.809771417058073e-05 + "loss": 0.04163505509495735, + "image_loss": 0.04163433611392975, + "smooth_loss": 7.178048690548167e-05 }, { "epoch": 70.0, - "loss": 0.04213815554976463, - "image_loss": 0.04213763028383255, - "smooth_loss": 5.256465738057159e-05 + "loss": 0.041663914918899536, + "image_loss": 0.04166315123438835, + "smooth_loss": 7.636315422132611e-05 }, { "epoch": 71.0, - "loss": 0.04214761406183243, - "image_loss": 0.042147066444158554, - "smooth_loss": 5.478101593325846e-05 + "loss": 0.04166248440742493, + "image_loss": 0.04166170954704285, + "smooth_loss": 7.742609886918217e-05 }, { "epoch": 72.0, - "loss": 0.04213856905698776, - "image_loss": 0.04213802143931389, - "smooth_loss": 5.4818134231027216e-05 + "loss": 0.04163891449570656, + "image_loss": 0.04163815453648567, + "smooth_loss": 7.598802767461166e-05 }, { "epoch": 73.0, - "loss": 0.04211747646331787, - "image_loss": 0.04211694374680519, - "smooth_loss": 5.3270672651706263e-05 + "loss": 0.04160759225487709, + "image_loss": 0.04160686209797859, + "smooth_loss": 7.30391766410321e-05 }, { "epoch": 74.0, - "loss": 0.042093425989151, - "image_loss": 0.04209291934967041, - "smooth_loss": 5.081955896457657e-05 + "loss": 0.0415797233581543, + "image_loss": 0.04157903045415878, + "smooth_loss": 6.94572736392729e-05 }, { "epoch": 75.0, - "loss": 0.04207289591431618, - "image_loss": 0.042072415351867676, - "smooth_loss": 4.802431067219004e-05 + "loss": 0.04156032204627991, + "image_loss": 0.04155966266989708, + "smooth_loss": 6.584868242498487e-05 }, { "epoch": 76.0, - "loss": 0.04205827787518501, - "image_loss": 0.0420578271150589, - "smooth_loss": 4.526200791588053e-05 + "loss": 0.04154948517680168, + "image_loss": 0.04154885932803154, + "smooth_loss": 6.265641422942281e-05 }, { "epoch": 77.0, - "loss": 0.042049601674079895, - "image_loss": 0.04204917326569557, - "smooth_loss": 4.2754021706059575e-05 + "loss": 0.041545070707798004, + "image_loss": 0.04154447093605995, + "smooth_loss": 5.989647615933791e-05 }, { "epoch": 78.0, - "loss": 0.042045459151268005, - "image_loss": 0.04204505309462547, - "smooth_loss": 4.061676736455411e-05 + "loss": 0.041544657200574875, + "image_loss": 0.04154407978057861, + "smooth_loss": 5.7687640946824104e-05 }, { "epoch": 79.0, - "loss": 0.04204433411359787, - "image_loss": 0.04204394668340683, - "smooth_loss": 3.89082488254644e-05 + "loss": 0.0415460467338562, + "image_loss": 0.04154548794031143, + "smooth_loss": 5.60021071578376e-05 }, { "epoch": 80.0, - "loss": 0.04204464331269264, - "image_loss": 0.0420442670583725, - "smooth_loss": 3.758826642297208e-05 + "loss": 0.041547566652297974, + "image_loss": 0.0415470190346241, + "smooth_loss": 5.483696440933272e-05 } ] \ No newline at end of file diff --git a/outputs/checkpoints/vxm_head_ct_patient1.pt b/outputs/checkpoints/vxm_head_ct_patient1.pt index e4e97d0..200fe25 100644 Binary files a/outputs/checkpoints/vxm_head_ct_patient1.pt and b/outputs/checkpoints/vxm_head_ct_patient1.pt differ diff --git a/outputs/preprocessed/patient1_neck_alignment.json b/outputs/preprocessed/patient1_neck_alignment.json index 6554c2d..22b0d24 100644 --- a/outputs/preprocessed/patient1_neck_alignment.json +++ b/outputs/preprocessed/patient1_neck_alignment.json @@ -34,18 +34,18 @@ 170.0 ], "fixed_neck_center_world_mm": [ - 13.233566284179688, - -33.013214111328125, + 30.733566284179688, + -50.513214111328125, -633.6527099609375 ], "moving_neck_center_world_mm": [ - 13.2132568359375, - 18.1754150390625, + 43.7132568359375, + -12.3245849609375, -656.634033203125 ], "moving_translation_mm": [ - 0.0203094482421875, - -51.188629150390625, + -12.979690551757812, + -38.188629150390625, 22.9813232421875 ], "body_threshold_hu": -500.0,