Skip to content

Commit

Permalink
directory tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jun 18, 2024
1 parent ec7a95e commit 6c37028
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: ['**']
tags: ['**']
paths-ignore: ['LICENSE*', 'LICENCE*', 'README.md']
paths-ignore: ['LICENSE*', 'LICENCE*', 'README.md', 'SIRF_data_preparation/*']
jobs:
check:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ tmp*/
errr.txt
info.txt
warn.txt
__pycache__
__pycache__/
*.s
*.hs

Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
'''
Some functions for plotting used in the examples
'''

## CCP SyneRBI Synergistic Image Reconstruction Framework (SIRF)
## Copyright 2020-2021 University College London
##
## This is software developed for the Collaborative Computational
## Project in Synergistic Reconstruction for Biomedical Imaging (formerly CCP PETMR)
## (http://www.ccpsynerbi.ac.uk/).
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

'''Some functions for plotting used in the examples'''
# Licence: Apache-2.0
# Copyright 2020-2021 University College London
import sirf.STIR as PET
import numpy as np
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -50,4 +32,3 @@ def plot_sinogram_profile(prompts, randoms=None, scatter=None, sumaxis=(0,1), se
plt.plot(np.sum(scatter.as_array() + randoms_as_array, axis=sumaxis)[select,:], label='randoms+scatter')
ax.legend()
plt.show()

Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
'''Library of Siemens data preparation utilities.'''

# Author: Ashley Gillman, Kris Thielemans, Evgueni Ovtchinnikov
# Authors: Ashley Gillman, Kris Thielemans, Evgueni Ovtchinnikov
# Licence: Apache-2.0
# Copyright (C) 2021 Commonwealth Scientific and Industrial Research Organisation
# Copyright (C) 2024 University College London
# Copyright (C) 2024 STFC, UK Research and Innovation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import importlib
pet = importlib.import_module('sirf.STIR')
import logging

logger = logging.getLogger("PETRIC")
DATA_PATH = '/home/sirfuser/devel/SyneRBI-Challenge/data'


def the_data_path(*data_type):
Expand All @@ -30,13 +20,7 @@ def the_data_path(*data_type):
data_type: either 'PET', 'MR' or 'Synergistic', or use multiple arguments for
subdirectories like the_data_path('PET', 'mMR', 'NEMA_IQ').
'''
try:
from .data_path import data_path
except ImportError:
raise RuntimeError(
"Path to data not found.")

return os.path.join(data_path, *data_type)
return os.path.join(DATA_PATH, *data_type)


def fix_siemens_norm_EOL(in_filename, out_filename):
Expand Down Expand Up @@ -132,7 +116,7 @@ def prepare_challenge_Siemens_data(data_path, challenge_data_path, intermediate_
logger.info('data shape: %s' % repr(prompts.shape))
logger.info('prompts norm: %f' % prompts.norm())
logger.info('randoms norm: %f' % randoms.norm())

logger.info(f'writing prompts to {f_prompts} and randoms to {f_randoms}')
prompts.write(f_prompts)
randoms.write(f_randoms)
Expand Down Expand Up @@ -176,8 +160,7 @@ def prepare_challenge_Siemens_data(data_path, challenge_data_path, intermediate_
asm_mf.normalise(background)
logger.info('norm of the additive term: %f' % background.norm())
logger.info(f'writing additive term to {f_additive}')

background.write(f_additive)

return

1 change: 0 additions & 1 deletion lib/data_utilities/data_path.py

This file was deleted.

0 comments on commit 6c37028

Please sign in to comment.