<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="NiReports: https://www.nipreps.org/" />
<title>sub-S03_ses-SES02_task-auditory_run-04_bold :: MRIQC's BOLD fMRI report</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

<script>
var timestamp = Date.now()

function read_form() {
    var ds = "<unset>";
    var sub = "sub-S03_ses-SES02_task-auditory_run-04_bold.nii.gz";

    var artifacts = [];
    $('#qcartifacts-group input:checked').each(function() {
        artifacts.push($(this).attr('name'));
    });

    var rating = $('#qcslider').val();
    var payload = {
        'dataset': ds,
        'subject': sub,
        'rating': rating,
        'artifacts': artifacts,
        'time_sec': (Date.now() - timestamp) / 1000,
        'confidence': $('#qcextra-confidence').val(),
        'comments': $('#qcextra-comments').val()
    };

    var file = new Blob([JSON.stringify(payload)], {type: 'text/json'});
    $('#btn-download').attr('href', URL.createObjectURL(file));
    $('#btn-download').attr('download', payload['dataset'] + "_" + payload['subject'] + ".json");
    return payload
};

function toggle_rating() {
    if ($('#qcrating-menu').hasClass('d-none')) {
        $('#qcrating-menu').removeClass('d-none');
        $('#qcrating-toggler').prop('checked', true);
    } else {
        $('#qcrating-menu').addClass('d-none');
        $('#qcrating-toggler').prop('checked', false);
    }
};

$(window).on('load',function(){
    var authorization = $('#btn-post').val()
    if (authorization.includes("secret_token")) {
        $('#btn-post').addClass('d-none');
    };
    timestamp = Date.now();
});

</script>
<style type="text/css">
/* The slider itself */
.slider {
  -webkit-appearance: none;  /* Override default CSS styles */
  appearance: none;
  margin-bottom: 8px;
  margin-left: 10%;
  width: 80%;
  height: 5px; /* Specified height */
  background: #d3d3d3; /* Grey background */
  outline: none; /* Remove outline */
  opacity: 0.7; /* Set transparency (for mouse-over effects on hover) */
  -webkit-transition: .2s; /* 0.2 seconds transition on hover */
  transition: opacity .2s;
}

/* Mouse-over effects */
.slider:hover {
  opacity: 1; /* Fully shown on mouse-over */
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  border: 0;
  background: url('https://raw.githubusercontent.com/nipreps/nireports/main/assets/slider-handle.png');
  cursor: pointer;
  z-index: 2000 !important;
}

.slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border: 0;
  background: url('https://raw.githubusercontent.com/nipreps/nireports/main/assets/slider-handle.png');
  cursor: pointer;
  z-index: 2000 !important;
}

</style>
</head>
<body style="font-family: helvetica;">
<nav class="navbar fixed-top navbar-expand-lg bg-light">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <li class="nav-item"><a class="nav-link" href="#Basic echo-wise reports">Basic echo-wise reports</a></li>
        <li class="nav-item"><a class="nav-link" href="#Extended echo-wise reports">Extended echo-wise reports</a></li>
        <li class="nav-item"><a class="nav-link" href="#Extended reports shared across echos">Extended reports shared across echos</a></li>
        <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" id="navbarAbout" role="button" data-bs-toggle="dropdown" aria-expanded="false" href="#About">
            About
            </a>
            <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="#errors">Errors</a></li>
                <li><a class="dropdown-item" href="#meta-about-metadata">Reproducibility and provenance information</a></li>
            </ul>
        </li>
    </ul>
</div>
</div>
<div class="d-flex flex-row-reverse">
<div class="form-check form-switch align-self-center flex-fill me-4">
<input class="form-check-input" type="checkbox" id="qcrating-toggler"></input>
<label class="form-check-label" style="width: 100pt;" for="qcrating-toggler">Rating widget</label>
</div>
</div>
</nav>
<noscript>
    <h1 class="text-danger"> The navigation menu uses Javascript. Without it this report might not work as expected </h1>
</noscript>

    <div id="Basic echo-wise reports" class="mt-5">
    <h1 class="sub-report-title pt-5 ps-4">Basic echo-wise reports</h1>
        <div id="datatype-figures_desc-stdev_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">Standard deviation of signal through time</h3><p class="elem-caption">The voxel-wise standard deviation of the signal (variability along time).</p>                    <div class="reportlet">
<img class="svg-reportlet" src="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-stdev_bold.svg" style="width: 100%" />
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-stdev_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-stdev_bold.svg</a></small>

        </div>
        <div id="datatype-figures_desc-background_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">View of the background of the voxel-wise average of the BOLD timeseries</h3><p class="elem-caption">This panel shows a mosaic enhancing the background around the head. Artifacts usually unveil themselves in the air surrounding the head, where no signal sources are present.</p>                    <div class="reportlet">
<img class="svg-reportlet" src="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-background_bold.svg" style="width: 100%" />
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-background_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-background_bold.svg</a></small>

        </div>
        <div id="datatype-figures_desc-zoomed_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">Voxel-wise average of BOLD time-series, zoomed-in covering just the brain</h3><p class="elem-caption">This panel shows a mosaic of the brain. This mosaic is the most suitable to screen head-motion intensity inhomogeneities, global/local noise, signal leakage (for example, from the eyeballs and across the phase-encoding axis), etc.</p>                    <div class="reportlet">
<img class="svg-reportlet" src="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-zoomed_bold.svg" style="width: 100%" />
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-zoomed_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-zoomed_bold.svg</a></small>

        </div>
        <div id="datatype-figures_desc-carpet_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">Carpetplot and nuisance signals</h3><p class="elem-caption">The so-called &laquo;carpetplot&raquo; may assist in assessing head-motion derived artifacts and respiation effects.</p>                    <div class="reportlet">
<img class="svg-reportlet" src="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-carpet_bold.svg" style="width: 100%" />
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-carpet_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-carpet_bold.svg</a></small>

        </div>
    </div>
    <div id="Extended echo-wise reports" class="mt-5">
    <h1 class="sub-report-title pt-5 ps-4">Extended echo-wise reports</h1>
        <div id="datatype-figures_desc-mean_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">Voxel-wise average of BOLD time-series</h3><p class="elem-caption">The average signal calculated across the last axis (time).</p>                    <div class="reportlet">
<img class="svg-reportlet" src="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-mean_bold.svg" style="width: 100%" />
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-mean_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-mean_bold.svg</a></small>

        </div>
    </div>
    <div id="Extended reports shared across echos" class="mt-5">
    <h1 class="sub-report-title pt-5 ps-4">Extended reports shared across echos</h1>
        <div id="datatype-figures_desc-brainmask_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">Brain extraction performance</h3><p class="elem-caption">Brain mask as internally extracted by MRIQC. Defects on the brainmask could indicate problematic aspects of the image quality-wise.</p>                    <div class="reportlet">
<img class="svg-reportlet" src="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-brainmask_bold.svg" style="width: 100%" />
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-brainmask_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-brainmask_bold.svg</a></small>

        </div>
        <div id="datatype-figures_desc-norm_run-04_session-SES02_subject-S03_suffix-bold_task-auditory" class="ps-4 pe-4 mb-2">
<h3 class="run-title mt-3">Spatial normalization of the anatomical image</h3><p class="elem-caption">This panel shows a <em>quick-and-dirty</em> nonlinear registration into the <code>MNI152NLin2009cAsym</code> template accessed with <a href="https://templateflow.org/browse" target="_blank"><em>TemplateFlow</em></a>.</p>                    <div class="reportlet">
<object class="svg-reportlet" type="image/svg+xml" data="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-norm_bold.svg" style="">
Problem loading figure sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-norm_bold.svg. If the link below works, please try reloading the report in your browser.</object>
</div>
<small>Get figure file: <a href="./sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-norm_bold.svg" target="_blank">sub-S03/figures/sub-S03_ses-SES02_task-auditory_run-04_desc-norm_bold.svg</a></small>

        </div>
    </div>
    <div id="About" class="mt-5">
    <h1 class="sub-report-title pt-5 ps-4">About</h1>
        <div id="errors" class="ps-4 pe-4 mb-2">
<h2 class="sub-report-group mt-4">Errors</h2>                    <p class="alert alert-success" role="alert">No errors to report!</p>
        </div>
        <div id="meta-about-metadata" class="ps-4 pe-4 mb-2">
<h2 class="sub-report-group mt-4">Reproducibility and provenance information</h2><p class="elem-caption">Thanks for using <em>MRIQC</em>. The following information may assist in
reconstructing the provenance of the corresponding derivatives.
</p>                    <div class="accordion accordion-flush" id="about-metadata">


  <div class="accordion-item">
    <h2 class="accordion-header" id="about-metadata-0">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#about-metadata-0-collapse" aria-controls="about-metadata-0-collapse">
        Provenance Information
      </button>
    </h2>
    <div id="about-metadata-0-collapse" class="accordion-collapse collapse" aria-labelledby="about-metadata-0-heading" data-bs-parent="#about-metadata-0">
      <div class="accordion-body metadata-table">
      <table id="about-metadata-table-0" class="table table-sm table-striped">
<tr><td colspan=2>Execution environment</td><td>singularity</td></tr>
<tr><td colspan=2>Input filename</td><td><BIDS root>/sub-S03/ses-SES02/func/sub-S03_ses-SES02_task-auditory_run-04_bold.nii.gz</td></tr>
<tr><td>Versions</td><td>MRIQC</td><td>24.1.0.dev0+gd5b13cb5.d20240826</td></tr>
<tr><td>Versions</td><td>NiPype</td><td>1.8.6</td></tr>
<tr><td>Versions</td><td>TemplateFlow</td><td>24.2.0</td></tr>
<tr><td colspan=2>md5sum</td><td>fd79c3a735009fb353438f70f9202a23</td></tr>
</table>

      </div>
    </div>
  </div>


  <div class="accordion-item">
    <h2 class="accordion-header" id="about-metadata-1">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#about-metadata-1-collapse" aria-controls="about-metadata-1-collapse">
        Dataset Information
      </button>
    </h2>
    <div id="about-metadata-1-collapse" class="accordion-collapse collapse" aria-labelledby="about-metadata-1-heading" data-bs-parent="#about-metadata-1">
      <div class="accordion-body metadata-table">
      <table id="about-metadata-table-1" class="table table-sm table-striped">
<tr><td colspan=2>AcquisitionMatrixPE</td><td>188</td></tr>
<tr><td colspan=2>AcquisitionNumber</td><td>1</td></tr>
<tr><td colspan=2>AcquisitionTime</td><td>09:11:19.270000</td></tr>
<tr><td colspan=2>BandwidthPerPixelPhaseEncode</td><td>19.46</td></tr>
<tr><td colspan=2>BaseResolution</td><td>188</td></tr>
<tr><td colspan=2>ConversionSoftware</td><td>dcm2niix</td></tr>
<tr><td colspan=2>ConversionSoftwareVersion</td><td>v1.0.20180606 GCC4.8.5</td></tr>
<tr><td colspan=2>DelayTime</td><td>1.2</td></tr>
<tr><td colspan=2>DerivedVendorReportedEchoSpacing</td><td>0.000820013</td></tr>
<tr><td colspan=2>DeviceSerialNumber</td><td>18930</td></tr>
<tr><td colspan=2>DwellTime</td><td>1.9e-06</td></tr>
<tr><td colspan=2>EchoTime</td><td>0.02</td></tr>
<tr><td colspan=2>EffectiveEchoSpacing</td><td>0.000273338</td></tr>
<tr><td colspan=2>FlipAngle</td><td>80</td></tr>
<tr><td colspan=2>ImageComments</td><td>Unaliased_MB2_PE2</td></tr>
<tr><td colspan=2>ImageOrientationPatientDICOM</td><td>[0.986204, 0.163009, -0.0287939, -0.0693374, 0.248847, -0.966058]</td></tr>
<tr><td colspan=2>ImageType</td><td>['ORIGINAL', 'PRIMARY', 'M', 'MB', 'ND', 'MOSAIC']</td></tr>
<tr><td colspan=2>InPlanePhaseEncodingDirectionDICOM</td><td>COL</td></tr>
<tr><td colspan=2>InstitutionAddress</td><td>Oxfordlaan_55_Maastricht_22AAA2_Limburg_NL_6229_EV</td></tr>
<tr><td colspan=2>InstitutionName</td><td>Scannexus</td></tr>
<tr><td colspan=2>InstitutionalDepartmentName</td><td>MRI_7T</td></tr>
<tr><td colspan=2>MRAcquisitionType</td><td>2D</td></tr>
<tr><td colspan=2>MagneticFieldStrength</td><td>6.98</td></tr>
<tr><td colspan=2>Manufacturer</td><td>Siemens</td></tr>
<tr><td colspan=2>ManufacturersModelName</td><td>Investigational_Device_7T</td></tr>
<tr><td colspan=2>Modality</td><td>MR</td></tr>
<tr><td colspan=2>MultibandAccelerationFactor</td><td>2</td></tr>
<tr><td colspan=2>ParallelReductionFactorInPlane</td><td>3</td></tr>
<tr><td colspan=2>PartialFourier</td><td>0.75</td></tr>
<tr><td colspan=2>PatientPosition</td><td>HFS</td></tr>
<tr><td colspan=2>PercentPhaseFOV</td><td>100</td></tr>
<tr><td colspan=2>PhaseEncodingDirection</td><td>j</td></tr>
<tr><td colspan=2>PhaseEncodingSteps</td><td>141</td></tr>
<tr><td colspan=2>PhaseResolution</td><td>1</td></tr>
<tr><td colspan=2>PixelBandwidth</td><td>1400</td></tr>
<tr><td colspan=2>ProcedureStepDescription</td><td>FeDem_Faruk</td></tr>
<tr><td colspan=2>ProtocolName</td><td>cmrr_mbep2d_bold_AP_run4</td></tr>
<tr><td colspan=2>PulseSequenceDetails</td><td>%CustomerSeq%_cmrr_mbep2d_bold</td></tr>
<tr><td colspan=2>ReceiveCoilName</td><td>32Ch_Head_7T</td></tr>
<tr><td colspan=2>ReconMatrixPE</td><td>188</td></tr>
<tr><td colspan=2>RepetitionTime</td><td>2.6</td></tr>
<tr><td colspan=2>SAR</td><td>0.0455026</td></tr>
<tr><td colspan=2>ScanOptions</td><td>PFP_FS</td></tr>
<tr><td colspan=2>ScanningSequence</td><td>EP</td></tr>
<tr><td colspan=2>SequenceName</td><td>epfid2d1_188</td></tr>
<tr><td colspan=2>SequenceVariant</td><td>SK_SS</td></tr>
<tr><td colspan=2>SeriesDescription</td><td>cmrr_mbep2d_bold_AP_run4</td></tr>
<tr><td colspan=2>SeriesNumber</td><td>13</td></tr>
<tr><td colspan=2>ShimSetting</td><td>[33, -58, 487, 457, -151, 72, 370, 98]</td></tr>
<tr><td colspan=2>SliceThickness</td><td>1.1</td></tr>
<tr><td colspan=2>SliceTiming</td><td>[0, 0.7325, 0.0625, 0.795, 0.1225, 0.855, 0.1825, 0.9175, 0.245, 0.9775, 0.305, 1.04, 0.3675, 1.1, 0.4275, 1.16, 0.49, 1.2225, 0.55, 1.2825, 0.6125, 1.345, 0.6725, 0, 0.7325, 0.0625, 0.795, 0.1225, 0.855, 0.1825, 0.9175, 0.245, 0.9775, 0.305, 1.04, 0.3675, 1.1, 0.4275, 1.16, 0.49, 1.2225, 0.55, 1.2825, 0.6125, 1.345, 0.6725]</td></tr>
<tr><td colspan=2>SoftwareVersions</td><td>syngo_MR_B17</td></tr>
<tr><td colspan=2>SpacingBetweenSlices</td><td>1.1</td></tr>
<tr><td colspan=2>StationName</td><td>MRC18930</td></tr>
<tr><td colspan=2>TaskName</td><td>auditory</td></tr>
<tr><td colspan=2>TotalReadoutTime</td><td>0.0511141</td></tr>
<tr><td colspan=2>TxRefAmp</td><td>181</td></tr>
<tr><td>dcmmeta</td><td>affine</td><td>[[-1.0806282758712769, -0.07597606629133224, 0.1653413474559784, 105.7924575805664], [-0.1786157190799713, 0.2726731300354004, -1.0501993894577026, 38.38575744628906], [-0.031550802290439606, 1.0585525035858154, 0.2823885679244995, -104.43102264404297], [0.0, 0.0, 0.0, 1.0]]</td></tr>
<tr><td>dcmmeta</td><td>reorient_transform</td><td>[[0.0, -1.0, 0.0, 187.0], [1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]</td></tr>
<tr><td>dcmmeta</td><td>shape</td><td>[188, 188, 46, 150]</td></tr>
<tr><td>dcmmeta</td><td>slice_dim</td><td>2</td></tr>
<tr><td>dcmmeta</td><td>version</td><td>0.6</td></tr>
<tr><td colspan=2>time</td><td>{'samples': {'AcquisitionNumber': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150], 'AcquisitionTime': ['091119.270000', '091121.880000', '091124.490000', '091127.102500', '091129.712500', '091132.322500', '091134.932500', '091137.542500', '091140.155000', '091142.765000', '091145.375000', '091147.985000', '091150.595000', '091153.205000', '091155.817500', '091158.427500', '091201.037500', '091203.647500', '091206.257500', '091208.867500', '091211.480000', '091214.090000', '091216.700000', '091219.310000', '091221.920000', '091224.532500', '091227.142500', '091229.752500', '091232.362500', '091234.972500', '091237.582500', '091240.195000', '091242.805000', '091245.415000', '091248.025000', '091250.635000', '091253.245000', '091255.857500', '091258.467500', '091301.077500', '091303.687500', '091306.297500', '091308.910000', '091311.520000', '091314.130000', '091316.740000', '091319.350000', '091321.960000', '091324.572500', '091327.182500', '091329.792500', '091332.402500', '091335.012500', '091337.622500', '091340.235000', '091342.845000', '091345.455000', '091348.065000', '091350.675000', '091353.287500', '091355.897500', '091358.507500', '091401.117500', '091403.727500', '091406.337500', '091408.950000', '091411.560000', '091414.170000', '091416.780000', '091419.390000', '091422.000000', '091424.612500', '091427.222500', '091429.832500', '091432.442500', '091435.052500', '091437.665000', '091440.275000', '091442.885000', '091445.495000', '091448.105000', '091450.715000', '091453.327500', '091455.937500', '091458.547500', '091501.157500', '091503.767500', '091506.377500', '091508.990000', '091511.600000', '091514.210000', '091516.820000', '091519.430000', '091522.042500', '091524.652500', '091527.262500', '091529.872500', '091532.482500', '091535.092500', '091537.705000', '091540.315000', '091542.925000', '091545.535000', '091548.145000', '091550.755000', '091553.367500', '091555.977500', '091558.587500', '091601.197500', '091603.807500', '091606.420000', '091609.030000', '091611.640000', '091614.250000', '091616.860000', '091619.470000', '091622.082500', '091624.692500', '091627.302500', '091629.912500', '091632.522500', '091635.132500', '091637.745000', '091640.355000', '091642.965000', '091645.575000', '091648.185000', '091650.797500', '091653.407500', '091656.017500', '091658.627500', '091701.237500', '091703.847500', '091706.460000', '091709.070000', '091711.680000', '091714.290000', '091716.900000', '091719.510000', '091722.122500', '091724.732500', '091727.342500', '091729.952500', '091732.562500', '091735.175000', '091737.785000', '091740.395000', '091743.005000', '091745.615000', '091748.225000'], 'ContentTime': ['091128.125000', '091128.625000', '091129.125000', '091131.625000', '091134.125000', '091136.625000', '091139.625000', '091142.125000', '091144.625000', '091147.125000', '091149.625000', '091152.625000', '091155.125000', '091157.625000', '091200.125000', '091202.625000', '091205.625000', '091208.125000', '091210.625000', '091213.125000', '091215.625000', '091218.625000', '091221.125000', '091223.625000', '091226.125000', '091228.625000', '091231.625000', '091234.125000', '091236.625000', '091239.125000', '091241.625000', '091244.625000', '091247.125000', '091249.625000', '091252.125000', '091254.625000', '091257.625000', '091300.125000', '091302.625000', '091305.125000', '091307.625000', '091310.625000', '091313.125000', '091315.625000', '091318.125000', '091320.625000', '091323.625000', '091326.125000', '091328.625000', '091331.125000', '091333.625000', '091336.625000', '091339.125000', '091341.625000', '091344.125000', '091346.625000', '091349.625000', '091352.125000', '091354.625000', '091357.125000', '091359.625000', '091402.625000', '091405.125000', '091407.625000', '091410.125000', '091412.625000', '091415.625000', '091418.125000', '091420.625000', '091423.125000', '091425.625000', '091428.625000', '091431.125000', '091433.625000', '091436.125000', '091438.625000', '091441.625000', '091444.125000', '091446.625000', '091449.125000', '091451.625000', '091454.625000', '091457.125000', '091459.625000', '091502.125000', '091504.625000', '091507.625000', '091510.125000', '091512.625000', '091515.125000', '091517.625000', '091520.625000', '091523.125000', '091525.625000', '091528.125000', '091530.625000', '091533.625000', '091536.125000', '091538.625000', '091541.125000', '091543.625000', '091546.625000', '091549.125000', '091551.625000', '091554.125000', '091556.625000', '091559.625000', '091602.125000', '091604.625000', '091607.125000', '091609.625000', '091612.625000', '091615.125000', '091617.625000', '091620.125000', '091622.625000', '091625.625000', '091628.125000', '091630.625000', '091633.125000', '091635.625000', '091638.625000', '091641.125000', '091643.625000', '091646.125000', '091648.625000', '091651.625000', '091654.125000', '091656.625000', '091659.125000', '091701.625000', '091704.625000', '091707.125000', '091709.625000', '091712.125000', '091714.625000', '091717.625000', '091720.125000', '091722.625000', '091725.125000', '091727.625000', '091730.625000', '091733.125000', '091735.625000', '091738.125000', '091740.625000', '091743.625000', '091746.125000', '091748.625000', '091755.984000'], 'InstanceCreationTime': ['091128.125000', '091128.625000', '091129.125000', '091131.625000', '091134.125000', '091136.625000', '091139.625000', '091142.125000', '091144.625000', '091147.125000', '091149.625000', '091152.625000', '091155.125000', '091157.625000', '091200.125000', '091202.625000', '091205.625000', '091208.125000', '091210.625000', '091213.125000', '091215.625000', '091218.625000', '091221.125000', '091223.625000', '091226.125000', '091228.625000', '091231.625000', '091234.125000', '091236.625000', '091239.125000', '091241.625000', '091244.625000', '091247.125000', '091249.625000', '091252.125000', '091254.625000', '091257.625000', '091300.125000', '091302.625000', '091305.125000', '091307.625000', '091310.625000', '091313.125000', '091315.625000', '091318.125000', '091320.625000', '091323.625000', '091326.125000', '091328.625000', '091331.125000', '091333.625000', '091336.625000', '091339.125000', '091341.625000', '091344.125000', '091346.625000', '091349.625000', '091352.125000', '091354.625000', '091357.125000', '091359.625000', '091402.625000', '091405.125000', '091407.625000', '091410.125000', '091412.625000', '091415.625000', '091418.125000', '091420.625000', '091423.125000', '091425.625000', '091428.625000', '091431.125000', '091433.625000', '091436.125000', '091438.625000', '091441.625000', '091444.125000', '091446.625000', '091449.125000', '091451.625000', '091454.625000', '091457.125000', '091459.625000', '091502.125000', '091504.625000', '091507.625000', '091510.125000', '091512.625000', '091515.125000', '091517.625000', '091520.625000', '091523.125000', '091525.625000', '091528.125000', '091530.625000', '091533.625000', '091536.125000', '091538.625000', '091541.125000', '091543.625000', '091546.625000', '091549.125000', '091551.625000', '091554.125000', '091556.625000', '091559.625000', '091602.125000', '091604.625000', '091607.125000', '091609.625000', '091612.625000', '091615.125000', '091617.625000', '091620.125000', '091622.625000', '091625.625000', '091628.125000', '091630.625000', '091633.125000', '091635.625000', '091638.625000', '091641.125000', '091643.625000', '091646.125000', '091648.625000', '091651.625000', '091654.125000', '091656.625000', '091659.125000', '091701.625000', '091704.625000', '091707.125000', '091709.625000', '091712.125000', '091714.625000', '091717.625000', '091720.125000', '091722.625000', '091725.125000', '091727.625000', '091730.625000', '091733.125000', '091735.625000', '091738.125000', '091740.625000', '091743.625000', '091746.125000', '091748.625000', '091755.984000'], 'InstanceNumber': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150], 'WindowCenter': [828.0, 825.0, 826.0, 824.0, 823.0, 824.0, 823.0, 822.0, 823.0, 826.0, 824.0, 823.0, 823.0, 823.0, 823.0, 822.0, 822.0, 821.0, 821.0, 822.0, 822.0, 822.0, 821.0, 822.0, 823.0, 822.0, 821.0, 822.0, 822.0, 822.0, 821.0, 823.0, 822.0, 821.0, 822.0, 825.0, 824.0, 821.0, 822.0, 823.0, 823.0, 822.0, 821.0, 824.0, 824.0, 821.0, 821.0, 823.0, 823.0, 821.0, 825.0, 825.0, 823.0, 824.0, 825.0, 824.0, 822.0, 822.0, 822.0, 822.0, 823.0, 824.0, 824.0, 825.0, 826.0, 823.0, 824.0, 825.0, 824.0, 822.0, 821.0, 822.0, 822.0, 823.0, 824.0, 824.0, 824.0, 825.0, 825.0, 826.0, 823.0, 822.0, 823.0, 821.0, 822.0, 824.0, 824.0, 822.0, 824.0, 826.0, 824.0, 821.0, 824.0, 826.0, 824.0, 824.0, 824.0, 824.0, 824.0, 823.0, 823.0, 823.0, 825.0, 826.0, 824.0, 823.0, 823.0, 825.0, 828.0, 824.0, 822.0, 825.0, 825.0, 823.0, 822.0, 825.0, 823.0, 822.0, 824.0, 824.0, 824.0, 824.0, 823.0, 823.0, 823.0, 823.0, 824.0, 823.0, 822.0, 823.0, 827.0, 826.0, 824.0, 824.0, 825.0, 824.0, 823.0, 824.0, 825.0, 824.0, 824.0, 825.0, 824.0, 825.0, 827.0, 824.0, 823.0, 824.0, 825.0, 823.0], 'WindowWidth': [1868.0, 1859.0, 1860.0, 1854.0, 1852.0, 1857.0, 1852.0, 1849.0, 1853.0, 1862.0, 1856.0, 1853.0, 1853.0, 1853.0, 1853.0, 1848.0, 1850.0, 1847.0, 1846.0, 1849.0, 1850.0, 1851.0, 1846.0, 1849.0, 1852.0, 1849.0, 1846.0, 1850.0, 1851.0, 1850.0, 1847.0, 1855.0, 1850.0, 1847.0, 1849.0, 1860.0, 1854.0, 1847.0, 1849.0, 1854.0, 1853.0, 1849.0, 1846.0, 1856.0, 1857.0, 1847.0, 1848.0, 1852.0, 1852.0, 1849.0, 1859.0, 1858.0, 1852.0, 1855.0, 1860.0, 1857.0, 1849.0, 1850.0, 1848.0, 1849.0, 1854.0, 1857.0, 1855.0, 1860.0, 1862.0, 1853.0, 1856.0, 1861.0, 1854.0, 1848.0, 1847.0, 1851.0, 1850.0, 1853.0, 1856.0, 1856.0, 1857.0, 1858.0, 1858.0, 1862.0, 1853.0, 1850.0, 1852.0, 1847.0, 1849.0, 1857.0, 1854.0, 1851.0, 1856.0, 1863.0, 1856.0, 1848.0, 1856.0, 1861.0, 1857.0, 1855.0, 1857.0, 1856.0, 1857.0, 1853.0, 1852.0, 1855.0, 1861.0, 1861.0, 1855.0, 1853.0, 1853.0, 1860.0, 1869.0, 1856.0, 1851.0, 1859.0, 1858.0, 1853.0, 1851.0, 1859.0, 1852.0, 1849.0, 1855.0, 1856.0, 1857.0, 1855.0, 1851.0, 1853.0, 1852.0, 1854.0, 1855.0, 1853.0, 1850.0, 1854.0, 1867.0, 1862.0, 1856.0, 1857.0, 1858.0, 1855.0, 1852.0, 1856.0, 1859.0, 1857.0, 1857.0, 1859.0, 1855.0, 1858.0, 1864.0, 1855.0, 1853.0, 1857.0, 1858.0, 1853.0]}, 'slices': {}}</td></tr>
</table>

      </div>
    </div>
  </div>


  <div class="accordion-item">
    <h2 class="accordion-header" id="about-metadata-2">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#about-metadata-2-collapse" aria-controls="about-metadata-2-collapse">
        Extracted Image quality metrics (IQMs)
      </button>
    </h2>
    <div id="about-metadata-2-collapse" class="accordion-collapse collapse" aria-labelledby="about-metadata-2-heading" data-bs-parent="#about-metadata-2">
      <div class="accordion-body metadata-table">
      <table id="about-metadata-table-2" class="table table-sm table-striped">
<tr><td colspan=3>aor</td><td>0.0007749664429530201</td></tr>
<tr><td colspan=3>aqi</td><td>0.013949225503355709</td></tr>
<tr><td colspan=3>dummy_trs</td><td>1</td></tr>
<tr><td>dvars</td><td colspan=2>nstd</td><td>71.96949069547296</td></tr>
<tr><td>dvars</td><td colspan=2>std</td><td>1.0703813418243247</td></tr>
<tr><td>dvars</td><td colspan=2>vstd</td><td>1.0109241264864866</td></tr>
<tr><td colspan=3>efc</td><td>0.5584</td></tr>
<tr><td colspan=3>fber</td><td>377.7928</td></tr>
<tr><td>fd</td><td colspan=2>mean</td><td>0.08462252771811861</td></tr>
<tr><td>fd</td><td colspan=2>num</td><td>4</td></tr>
<tr><td>fd</td><td colspan=2>perc</td><td>2.684563758389262</td></tr>
<tr><td>fwhm</td><td colspan=2>avg</td><td>2.9991516727670073</td></tr>
<tr><td>fwhm</td><td colspan=2>x</td><td>2.8115216239217395</td></tr>
<tr><td>fwhm</td><td colspan=2>y</td><td>2.859233466483561</td></tr>
<tr><td>fwhm</td><td colspan=2>z</td><td>3.3266999278957208</td></tr>
<tr><td colspan=3>gcor</td><td>0.00476035</td></tr>
<tr><td>gsr</td><td colspan=2>x</td><td>-0.02368650957942009</td></tr>
<tr><td>gsr</td><td colspan=2>y</td><td>0.06087760627269745</td></tr>
<tr><td>size</td><td colspan=2>t</td><td>149</td></tr>
<tr><td>size</td><td colspan=2>x</td><td>188</td></tr>
<tr><td>size</td><td colspan=2>y</td><td>188</td></tr>
<tr><td>size</td><td colspan=2>z</td><td>46</td></tr>
<tr><td colspan=3>snr</td><td>2.1589830158135133</td></tr>
<tr><td>spacing</td><td colspan=2>tr</td><td>2.5999999046325684</td></tr>
<tr><td>spacing</td><td colspan=2>x</td><td>1.0957447290420532</td></tr>
<tr><td>spacing</td><td colspan=2>y</td><td>1.0957447290420532</td></tr>
<tr><td>spacing</td><td colspan=2>z</td><td>1.100000023841858</td></tr>
<tr><td>summary</td><td>bg</td><td>k</td><td>92.0096</td></tr>
<tr><td>summary</td><td>bg</td><td>mad</td><td>23.7714</td></tr>
<tr><td>summary</td><td>bg</td><td>mean</td><td>89.4646</td></tr>
<tr><td>summary</td><td>bg</td><td>median</td><td>44.0</td></tr>
<tr><td>summary</td><td>bg</td><td>n</td><td>1189029.0</td></tr>
<tr><td>summary</td><td>bg</td><td>p05</td><td>26.0</td></tr>
<tr><td>summary</td><td>bg</td><td>p95</td><td>280.0</td></tr>
<tr><td>summary</td><td>bg</td><td>stdv</td><td>150.4607</td></tr>
<tr><td>summary</td><td>fg</td><td>k</td><td>3.9548</td></tr>
<tr><td>summary</td><td>fg</td><td>mad</td><td>304.6797</td></tr>
<tr><td>summary</td><td>fg</td><td>mean</td><td>912.4651</td></tr>
<tr><td>summary</td><td>fg</td><td>median</td><td>862.0</td></tr>
<tr><td>summary</td><td>fg</td><td>n</td><td>436795.0</td></tr>
<tr><td>summary</td><td>fg</td><td>p05</td><td>326.0</td></tr>
<tr><td>summary</td><td>fg</td><td>p95</td><td>1615.0</td></tr>
<tr><td>summary</td><td>fg</td><td>stdv</td><td>399.2616</td></tr>
<tr><td colspan=3>tsnr</td><td>21.0459066927433</td></tr>
</table>

      </div>
    </div>
  </div>

</div>
        </div>
    </div>

<div id="qcrating-menu" class="card position-fixed d-none" style="width: 30%; top: 100px; left: 65%; max-height: 85%; overflow-y: auto;">
<div class="card-header m-0">
    Rating widget
    <button type="button" class="btn-close position-absolute top-0 end-0" aria-label="Close" id="close-qcrating-menu" onclick="toggle_rating()" style="margin: 10px 10px 0 0"></button>
</div>
<div class="card-body">
<div class="accordion">
  <div class="accordion-item">
    <h2 class="accordion-header" id="qcslider-head">
      <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#qcslider-collapse" aria-expanded="true" aria-controls="qcslider-collapse">Overall Quality Rating</button>
    </h2>
    <div id="qcslider-collapse" class="accordion-collapse collapse show" aria-labelledby="qcslider-head">
      <div class="accordion-body">
        <input type="range" min="1.0" max="4.0" step="0.05" value="2.5" id="qcslider" class="slider">
        <ul class="list-group list-group-horizontal slider-labels" style="width: 100%">
            <li class="list-group-item list-group-item-danger small" style="font-size: 0.7em; width: 25%; text-align:center">Exclude</li>
            <li class="list-group-item list-group-item-warning small" style="font-size: 0.7em; width: 25%; text-align:center">Poor</li>
            <li class="list-group-item list-group-item-primary small" style="font-size: 0.7em; width: 25%; text-align:center">Acceptable</li>
            <li class="list-group-item list-group-item-success small" style="font-size: 0.7em; width: 25%; text-align:center">Excellent</li>
        </ul>
      </div>
    </div>
  </div>

  <div class="accordion-item">
    <h2 class="accordion-header" id="qcartifacts-head">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#qcartifacts-collapse" aria-expanded="false" aria-controls="qcartifacts-collapse">
        Record specific artifacts
      </button>
    </h2>
    <div id="qcartifacts-collapse" class="accordion-collapse collapse" aria-labelledby="qcartifacts-head">
      <div class="accordion-body">
        <fieldset id="qcartifacts-group" class="form-group">
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="head-motion" id="qcartifacts-item-0" />
                <label class="form-check-label" for="qcartifacts-item-0">Head motion artifacts</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="eye-spillover" id="qcartifacts-item-1" />
                <label class="form-check-label" for="qcartifacts-item-1">Eye spillover through <abbr title="phase-encoding">PE</abbr> axis</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="noneye-spillover" id="qcartifacts-item-2" />
                <label class="form-check-label" for="qcartifacts-item-2">Non-eye spillover through <abbr title="phase-encoding">PE</abbr> axis</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="coil-failure" id="qcartifacts-item-3" />
                <label class="form-check-label" for="qcartifacts-item-3">Coil failure</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="noise-global" id="qcartifacts-item-4" />
                <label class="form-check-label" for="qcartifacts-item-4">Global noise</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="noise-local" id="qcartifacts-item-5" />
                <label class="form-check-label" for="qcartifacts-item-5">Local noise</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="em-perturbation" id="qcartifacts-item-6" />
                <label class="form-check-label" for="qcartifacts-item-6"><abbr title="electromagnetic">EM</abbr> interference/perturbation</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="wrap-around" id="qcartifacts-item-7" />
                <label class="form-check-label" for="qcartifacts-item-7">Problematic <abbr title="field-of-view">FoV</abbr> prescription / wrap-around</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="ghost-aliasing" id="qcartifacts-item-8" />
                <label class="form-check-label" for="qcartifacts-item-8">Aliasing ghosts</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="ghost-other" id="qcartifacts-item-9" />
                <label class="form-check-label" for="qcartifacts-item-9">Other ghosts (for example, <abbr title="radiofrequency">RF</abbr> spoiling)</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="inu" id="qcartifacts-item-10" />
                <label class="form-check-label" for="qcartifacts-item-10">Intensity non-uniformity (B<sub>1</sub> bias)</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="field-variation" id="qcartifacts-item-11" />
                <label class="form-check-label" for="qcartifacts-item-11">Temporal B<sub>1</sub> field non-uniformity variation</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="processing" id="qcartifacts-item-12" />
                <label class="form-check-label" for="qcartifacts-item-12">Processing such as denoising, defacing or resamplings happened</label>
            </div>
            <div class="form-check form-switch small">
                <input class="form-check-input" type="checkbox" name="uncategorized" id="qcartifacts-item-13" />
                <label class="form-check-label" for="qcartifacts-item-13">Other uncategorized artifact(s)</label>
            </div>
        </fieldset>
      </div> <!-- accordion-body -->
    </div> <!-- accordion-collapse -->
  </div> <!-- accordion-item -->
  <div class="accordion-item">
    <h2 class="accordion-header" id="qcextra-head">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#qcextra-collapse" aria-expanded="false" aria-controls="qcextra-collapse">
        Extra details
      </button>
    </h2>
    <div id="qcextra-collapse" class="accordion-collapse collapse" aria-labelledby="qcextra-head">
      <div class="accordion-body">
        <div class="input-group">
          <span class="input-group-text">Comments</span>
          <textarea class="form-control" aria-label="Comments" id="qcextra-comments"></textarea>
        </div>

        <p style="margin-top: 20px; font-weight: bold">Rater confidence</p>
        <input type="range" min="0.0" max="4.0" step="0.05" value="3.5" id="qcextra-confidence" class="slider" style="margin-left: 22%;width: 56%;">
        <ul class="list-group list-group-horizontal slider-labels" style="width: 100%">
            <li class="list-group-item list-group-item-warning small" style="width: 50%; text-align:center">Doubtful</li>
            <li class="list-group-item list-group-item-success bg-success text-white small" style="width: 50%; text-align:center">Confident</li>
        </ul>
       </div> <!-- accordion-body -->
    </div> <!-- accordion-collapse -->
  </div> <!-- accordion-item -->
</div>
<div style="margin-top: 10px">
<a class="btn btn-primary disabled" id="btn-download" href="">Download</a>
<button class="btn btn-primary" id="btn-post" value="8sSYVI0XjFqacEMZ8wF4" disabled>Share publicly</button>
</div>
<script type="text/javascript">
var MINIMUM_RATING_TIME = 10
$('#qcslider').on('input', function() {

    if ( (Date.now() - timestamp) / 1000 > MINIMUM_RATING_TIME) {
        $('#btn-download').removeClass('disabled');
        $('#btn-download').removeAttr('aria-disabled');
        $('#btn-post').removeAttr('disabled');
    };

    $('#qcslider-collapse .list-group-item').removeClass(function(index, classname) {
        return (classname.match(/(^|\s)bg-\S+/g) || []).join(' ');
    });
    $('#qcslider-collapse .list-group-item').removeClass(function(index, classname) {
        return (classname.match(/(^|\s)text-\S+/g) || []).join(' ');
    });

    if ( $(this).val() < 1.5 ) {
        $('#qcslider-collapse .list-group-item-danger').addClass('bg-danger text-white');
    } else if ( $(this).val() > 3.5 ) {
        $('#qcslider-collapse .list-group-item-success').addClass('bg-success text-white');
    } else if ( $(this).val() < 2.5 ) {
        $('#qcslider-collapse .list-group-item-warning').addClass('bg-warning text-dark');
    } else {
        $('#qcslider-collapse .list-group-item-primary').addClass('bg-primary text-white');
    };

    var payload = read_form();
});

$('#qcextra-confidence').on('input', function() {
    if ( (Date.now() - timestamp) / 1000 > MINIMUM_RATING_TIME) {
        $('#btn-download').removeClass('disabled');
        $('#btn-download').removeAttr('aria-disabled');
        $('#btn-post').removeAttr('disabled');
    };

    $('#qcextra-collapse .list-group-item').removeClass(function(index, classname) {
        return (classname.match(/(^|\s)bg-\S+/g) || []).join(' ');
    });
    $('#qcextra-collapse .list-group-item').removeClass(function(index, classname) {
        return (classname.match(/(^|\s)text-\S+/g) || []).join(' ');
    });

    if ( $(this).val() < 2.0 ) {
        $('#qcextra-collapse .list-group-item-warning').addClass('bg-warning text-dark');
    } else {
        $('#qcextra-collapse .list-group-item-success').addClass('bg-success text-white');
    };

    var payload = read_form();
});


$('#qcextra-comments').bind('input propertychange', function() {
    if ( (Date.now() - timestamp) / 1000 > MINIMUM_RATING_TIME) {
        $('#btn-download').removeClass('disabled');
        $('#btn-download').removeAttr('aria-disabled');
        $('#btn-post').removeAttr('disabled');
    };
});

$( '#btn-post' ).click( function() {
    var payload = read_form();
    var md5sum = "unspecified";
    var params = {
        'rating': payload['rating'],
        'md5sum': md5sum,
        'name': "",
        'comment': JSON.stringify(payload['artifacts'])
    };

    // disable development releases
    var authorization = $(this).val();
    var ratingReq = new XMLHttpRequest();
    ratingReq.open("POST", "https://mriqc.nimh.nih.gov:443/api/v1/rating");
    ratingReq.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
    ratingReq.setRequestHeader("Authorization", authorization);
    ratingReq.onload = function () {
        status = ratingReq.status;
        $('#btn-post').removeClass('btn-primary');
        $('#btn-post').attr('disabled', true);
        $('#btn-post').attr('aria-disabled', true);
        $('#btn-post').prop('disabled');
        $('#btn-post').addClass('disabled');
        $('#btn-post').removeClass('active');
        if (status === "201") {
            $('#btn-post').addClass('btn-success');
            $('#btn-post').html('Posted!');
        } else {
            $('#btn-post').addClass('btn-danger');
            $('#btn-post').html('Failed');
        };
    };
    ratingReq.send(JSON.stringify(params));
});

$( 'body' ).on( 'click', '#qcartifacts-group input', function(e) {
    if ( (Date.now() - timestamp) / 1000 > MINIMUM_RATING_TIME) {
        $('#btn-download').removeClass('disabled');
        $('#btn-download').removeAttr('aria-disabled');
        $('#btn-post').removeAttr('disabled');
    };
    
    var payload = read_form();
});

$( 'body' ).on( 'click', '#qcrating-toggler', function(e) {
    toggle_rating();
});
</script>
</div>

<script type="text/javascript">
function toggle(id) {
    var element = document.getElementById(id);
    if(element.style.display == 'block')
        element.style.display = 'none';
    else
        element.style.display = 'block';
}
</script>
</body>
</html><script>{let postHeight = () => {window.parent.postMessage({frameHeight: document.documentElement.offsetHeight || document.documentElement.scrollHeight}, '*')}; window.addEventListener('load', postHeight); window.addEventListener('message', (event) => {if (event.source === window.parent && event.data.requestOffsetHeight) postHeight()});}</script>