Skip to content

Commit

Permalink
Calculate size of stack array via utility.full_size_MB
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSullivan7 committed Jan 27, 2025
1 parent 361e804 commit 5174a20
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# SPDX - License - Identifier: GPL-3.0-or-later
from __future__ import annotations

import os
from typing import TYPE_CHECKING

from mantidimaging.core.utility.size_calculator import full_size_MB
from mantidimaging.gui.mvp_base import BasePresenter

if TYPE_CHECKING:
Expand Down Expand Up @@ -37,6 +37,4 @@ def set_stack_data(self):
self.view.stack_size_MB = self.get_stack_size_MB()

def get_stack_size_MB(self):
return sum(
os.path.getsize(self.view.directory + f)
for f in os.listdir(self.view.directory) if os.path.isfile(self.view.directory + f)) / 1024 / 1024
return full_size_MB(self.view.stack.data.shape, self.view.stack.data.dtype)

0 comments on commit 5174a20

Please sign in to comment.