For nii's where intensity values are high, this seems to be a reasonable step. However, when the intensity values are small (e.g., <= 400 over entire brain), this step aggressively compresses the dynamic range of the image, especially in the time dimension. My resulting .nii's after processing end up with 5-20 unique values over time for any given voxel.
Perhaps it's possible to add a check somewhere as to whether the cast to int16 would compress the data based on its range?