Skip to content

Commit

Permalink
Update qForm with crop (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Nov 13, 2024
1 parent 586ca3c commit 74e6cc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
#define kCPUsuf " " // unknown CPU
#endif

#define kDCMdate "v1.0.20241106"
#define kDCMdate "v1.0.20241111"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; // maximum number of EPI images in Siemens Mosaic
Expand Down
10 changes: 10 additions & 0 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6502,6 +6502,16 @@ int nii_saveCrop(char *niiFilename, struct nifti_1_header hdr, unsigned char *im
hdrX.srow_x[3] += hdr.srow_x[2] * ventralCrop;
hdrX.srow_y[3] += hdr.srow_y[2] * ventralCrop;
hdrX.srow_z[3] += hdr.srow_z[2] * ventralCrop;
//issue889 - also change origin for qform
//mork
mat44 Q44;
LOAD_MAT44(Q44,
hdrX.srow_x[0], hdrX.srow_x[1], hdrX.srow_x[2], hdrX.srow_x[3],
hdrX.srow_y[0], hdrX.srow_y[1], hdrX.srow_y[2], hdrX.srow_y[3],
hdrX.srow_z[0], hdrX.srow_z[1], hdrX.srow_z[2], hdrX.srow_z[3]);
float dumdx, dumdy, dumdz;
nifti_mat44_to_quatern(Q44, &hdrX.quatern_b, &hdrX.quatern_c, &hdrX.quatern_d, &hdrX.qoffset_x, &hdrX.qoffset_y, &hdrX.qoffset_z, &dumdx, &dumdy, &dumdz, &hdrX.pixdim[0]);

// convert data
unsigned char *imX;
imX = (unsigned char *)malloc((nVox2D * slices) * 2); // sizeof( short) );
Expand Down

0 comments on commit 74e6cc3

Please sign in to comment.