diff --git a/CHANGES.md b/CHANGES.md index 7e6103f..fc43f2c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ This is a document summarizing the changes that are associated with (major) updates and releases. Priority is given to changes that are relevant to the user, and those that introduce new features or break compatibility with prior versions. +## Version 2.0.1 + +- This fix addresses two minor issues where output was omitted for the SNR computation and the fornix evaluation whenever hires inputs were used. + ## Version 2.0.0 - Name changes for the toolbox, repository, package, and scripts: the toolbox has been renamed to "fsqc tools", the python package name "qatoolspython" has been changed to "fsqc", and the "qatools.py" script has been renamed to "run_fsqc". The github repository is now located at "https://github.com/Deep-MI/fsqc", but requests to the old "https://github.com/Deep-MI/qatools-python" repository will be redirected. @@ -12,6 +16,6 @@ This is a document summarizing the changes that are associated with (major) upda - Addition of skullstrip, surfaces, hippocampus and hypothalamus modules. - Improved logging, error handling, and testing frameworks. - Enhanced containerization support (docker, singularity, dockerhub). -- Updated requirements, easier installation of the packaage and its dependencies, availability of the package on [pypi.org](https://pypi.org). +- Updated requirements, easier installation of the package and its dependencies, availability of the package on [pypi.org](https://pypi.org). - FreeSurfer is no longer required as a dependency (except for the optional 'shape analysis' module, which relies on the brainprint package). - We do not preserve compatibility with earlier versions. diff --git a/README.md b/README.md index 7a3b92c..c4eca28 100644 --- a/README.md +++ b/README.md @@ -479,11 +479,6 @@ ___ logfiles, and may fail or return erroneous results if the logfile is appended by multiple restarts of recon-all runs. Ideally, the logfile should therefore consist of just a single, successful recon-all run. -- High-resolution data: Prior to update v1.4, the screenshots and fornix module - did not work well with high-resolution data that was processed using the - -cm flag in recon-all. With update v1.4 this has been fixed for the - screenhots module, but the fornix module is still experimental for - high-resolution data. ___ diff --git a/VERSION b/VERSION index 227cea2..38f77a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1 diff --git a/fsqc/checkSNR.py b/fsqc/checkSNR.py index 78acb76..6def1eb 100644 --- a/fsqc/checkSNR.py +++ b/fsqc/checkSNR.py @@ -95,7 +95,7 @@ def checkSNR( # Process white matter image # Create 3D binary data where the white matter locations are encoded with 1, all the others with zero - b_wm_data = np.zeros((256, 256, 256)) + b_wm_data = np.zeros(norm.shape) # The following keys represent the white matter labels in the aparc+aseg image wm_labels = [2, 41, 7, 46, 251, 252, 253, 254, 255, 77, 78, 79] @@ -120,7 +120,7 @@ def checkSNR( # Process gray matter image # Create 3D binary data where the gray matter locations are encoded with 1, all the others with zero - b_gm_data = np.zeros((256, 256, 256)) + b_gm_data = np.zeros(norm.shape) # The following keys represent the gray matter labels in the aseg image gm_labels = [3, 42] diff --git a/fsqc/evaluateFornixSegmentation.py b/fsqc/evaluateFornixSegmentation.py index 34adb4e..6e3b5db 100644 --- a/fsqc/evaluateFornixSegmentation.py +++ b/fsqc/evaluateFornixSegmentation.py @@ -21,7 +21,7 @@ def evaluateFornixSegmentation( This script evaluates potential missegmentation of the fornix, which may erroneously be attached to the 'corpus collosum' label. - It will appply the cc_up.lta transform to the norm.mgz and the aseg files, + It will apply the cc_up.lta transform to the norm.mgz and the aseg files, and create a binary corpus callosum mask and surface. Resulting files are saved to subject-specific directories within the 'fornix' subdirectory of the output directory. @@ -59,6 +59,7 @@ def evaluateFornixSegmentation( import os import warnings + import nibabel as nb import numpy as np from fsqc.createScreenshots import createScreenshots @@ -142,14 +143,16 @@ def evaluateFornixSegmentation( # create screenshot if CREATE_SCREENSHOT is True: - # Note: SURF = [os.path.join(OUTPUT_DIR,"cc.surf")] is no longer possible - # unless using FreeSurfer's mri_binarize function (or creating the fornix - # surface otherwise) + hdr = nb.load(os.path.join(OUTPUT_DIR, "asegCCup.mgz")) + x_coord = np.matmul( + hdr.header.get_vox2ras_tkr(), np.array((128, 128, 128, 1))[:, np.newaxis] + )[0] + createScreenshots( SUBJECT=SUBJECT, SUBJECTS_DIR=SUBJECTS_DIR, INTERACTIVE=False, - VIEWS=[("x", -2), ("x", 0), ("x", 2)], + VIEWS=[("x", x_coord - 1), ("x", x_coord), ("x", x_coord + 1)], LAYOUT=(1, 3), BASE=[os.path.join(OUTPUT_DIR, "normCCup.mgz")], OVERLAY=[os.path.join(OUTPUT_DIR, "cc.mgz")],