Skip to content

Commit

Permalink
Merge tag 'v1.0.20170923' into debian
Browse files Browse the repository at this point in the history
* tag 'v1.0.20170923': (43 commits)
  Increment version for new release
  Update dcm_qa submodule.
  Update dcm_qa submodule.
  Kludge for GEIIS violations https://www.nitrc.org/forum/message.php?msg_id=22370
  Fix file permissions
  Use ReconMatrixPE variable and update some inline comments
  @xjqian & @mharms tags BaseResolution, PhaseResolution, VendorReportedEchoSpacing, DerivedVendorReportedEchoSpacing rordenlab#130
  mharms suggestions for  rordenlab#130
  Partial fix for rordenlab#132
  Fix for rordenlab#131 (comment)
  bandwidthPerPixelCorrected from Dr. Junqian (Gordon) Xu rordenlab#130
  Add PhaseOversampling to BIDS
  BIDS Interpolation2D, RectangularFOV, improve ReadoutTime rordenlab#130
  TotalReadoutTime iPAT vs partial Fourier: rordenlab#130
  Move AsciiCsa to end of BIDS
  Eliminate AppVeyor compiler warnings
  Remove EchoTrainDuration and EPIFactor: rordenlab#127
  BIDS cleanup
  Reorder items in BIDS as suggested by Michael Harms
  Report Partial Fourier in BIDS json
  ...
  • Loading branch information
yarikoptic committed Sep 28, 2017
2 parents c0fac4b + d3b3402 commit 7d6e039
Show file tree
Hide file tree
Showing 14 changed files with 828 additions and 277 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ This software should run on macOS, Linux and Windows without requiring any other

## Versions

21-Aug-2017
23-Sept-2017
- Swap [phase-encoding direction polarity](https://github.com/rordenlab/dcm2niix/issues/125) for Siemens images where PE is in the Column direction.
- Sort diffusion volumes by [B-value amplitude](https://www.nitrc.org/forum/forum.php?thread_id=8396&forum_id=4703) (use "-d n"/"-d y" to turn the feature off/on).
- BIDS tag [TotalReadoutTime](https://github.com/rordenlab/dcm2niix/issues/130) handles partial fourier, Phase Resolution, etc (Michael Harms).
- Additional [json fields](https://github.com/rordenlab/dcm2niix/issues/127).

18-Aug-2017
- Better BVec extraction for [PAR/REC 4.1](https://www.nitrc.org/forum/forum.php?thread_id=8387&forum_id=4703).
Expand Down
8 changes: 5 additions & 3 deletions console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
add_definitions(-Wno-unused-result)
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.7)
add_definitions(-fno-diagnostics-show-caret)
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.4.7)
add_definitions(-Wno-unused-result) # available since GCC 4.5
endif()
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.7.4)
add_definitions(-fno-diagnostics-show-caret) # available since GCC 4.8
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
Expand Down
14 changes: 9 additions & 5 deletions console/jpg_0XC3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,21 @@ unsigned char * decode_JPEG_SOF_0XC3 (const char *fn, int skipBytes, bool verbo
unsigned char *lRawRA = (unsigned char*) malloc(lRawSz);
size_t lSz = fread(lRawRA, 1, lRawSz, reader);
fclose(reader);
if ((lSz < lRawSz) || (lRawRA[0] != 0xFF) || (lRawRA[1] != 0xD8) || (lRawRA[2] != 0xFF)) {
if ((lSz < (size_t)lRawSz) || (lRawRA[0] != 0xFF) || (lRawRA[1] != 0xD8) || (lRawRA[2] != 0xFF)) {
abortGoto("JPEG signature 0xFFD8FF not found at offset %d of %s\n", skipBytes, fn);//signature failure http://en.wikipedia.org/wiki/List_of_file_signatures
}
if (verbose)
printMessage("JPEG signature 0xFFD8FF found at offset %d of %s\n", skipBytes, fn);
//next: read header
long lRawPos = 2; //Skip initial 0xFFD8, begin with third byte
//long lRawPos = 0; //Skip initial 0xFFD8, begin with third byte
unsigned char btS1, btS2, SOSss, SOSse, SOSahal, SOSpttrans, btMarkerType, SOSns = 0x00; //tag
uint8_t SOFnf, SOFprecision;
uint16_t SOFydim, SOFxdim; //, lRestartSegmentSz;
unsigned char btS1, btS2, SOSse, SOSahal, btMarkerType, SOSns = 0x00; //tag
unsigned char SOSpttrans = 0;
unsigned char SOSss = 0;
uint8_t SOFnf = 0;
uint8_t SOFprecision = 0;
uint16_t SOFydim = 0;
uint16_t SOFxdim = 0;
// long SOSarrayPos; //SOFarrayPos
int lnHufTables = 0;
const int kmaxFrames = 4;
Expand Down Expand Up @@ -186,7 +190,7 @@ unsigned char * decode_JPEG_SOF_0XC3 (const char *fn, int skipBytes, bool verbo
DHTnLi = DHTnLi + l[lFrameCount].DHTliRA[lInc];
if (l[lFrameCount].DHTliRA[lInc] != 0) l[lFrameCount].MaxHufSi = lInc;
if (verbose) printMessage("DHT has %d combinations with %d bits\n", l[lFrameCount].DHTliRA[lInc], lInc);

}
if (DHTnLi > 17) {
abortGoto("Huffman table corrupted.\n");
Expand Down
6 changes: 6 additions & 0 deletions console/main_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void showHelp(const char * argv[], struct TDCMopts opts) {
printf(" -b : BIDS sidecar (y/n/o(o=only: no NIfTI), default %c)\n", bidsCh);
if (opts.isAnonymizeBIDS) bidsCh = 'y'; else bidsCh = 'n';
printf(" -ba : anonymize BIDS (y/n, default %c)\n", bidsCh);
printf(" -c : comment stored as NIfTI aux_file (up to 24 characters)\n");
if (opts.isSortDTIbyBVal) bidsCh = 'y'; else bidsCh = 'n';
printf(" -d : diffusion volumes sorted by b-value (y/n, default %c)\n", bidsCh);
#ifdef mySegmentByAcq
Expand Down Expand Up @@ -113,13 +114,15 @@ void showHelp(const char * argv[], struct TDCMopts opts) {
printf(" Defaults stored in Windows registry\n");
printf(" Examples :\n");
printf(" %s c:\\DICOM\\dir\n", cstr);
printf(" %s -c \"my comment\" c:\\DICOM\\dir\n", cstr);
printf(" %s -o c:\\out\\dir c:\\DICOM\\dir\n", cstr);
printf(" %s -f mystudy%%s c:\\DICOM\\dir\n", cstr);
printf(" %s -o \"c:\\dir with spaces\\dir\" c:\\dicomdir\n", cstr);
#else
printf(" Defaults file : %s\n", opts.optsname);
printf(" Examples :\n");
printf(" %s /Users/chris/dir\n", cstr);
printf(" %s -c \"my comment\" /Users/chris/dir\n", cstr);
printf(" %s -o /users/cr/outdir/ -z y ~/dicomdir\n", cstr);
printf(" %s -f %%p_%%s -b y -ba n ~/dicomdir\n", cstr);
printf(" %s -f mystudy%%s ~/dicomdir\n", cstr);
Expand Down Expand Up @@ -195,6 +198,9 @@ int main(int argc, const char * argv[])
opts.isAnonymizeBIDS = true;
} else
printf("Error: Unknown command line argument: '%s'\n", argv[i]);
} else if ((argv[i][1] == 'c') && ((i+1) < argc)) {
i++;
snprintf(opts.imageComments,24,"%s",argv[i]);
} else if ((argv[i][1] == 'd') && ((i+1) < argc)) {
i++;
if (invalidParam(i, argv)) return 0;
Expand Down
6 changes: 3 additions & 3 deletions console/nifti1_io_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ int isSameFloat (float a, float b) {

ivec3 setiVec3(int x, int y, int z)
{
ivec3 v = {x, y, z};
ivec3 v = {{x, y, z}};
return v;
}

vec3 setVec3(float x, float y, float z)
{
vec3 v = {x, y, z};
vec3 v = {{x, y, z}};
return v;
}

vec4 setVec4(float x, float y, float z)
{
vec4 v= {x, y, z, 1};
vec4 v= {{x, y, z, 1}};
return v;
}

Expand Down
Loading

0 comments on commit 7d6e039

Please sign in to comment.